sweettracker
v1.1.1
Published
📦 - Unofficial sweettracker SDK for Node.js
Downloads
702
Maintainers
Readme
SweetTracker(스윗트래커) SDK
📦 - Unofficial sweettracker SDK for Node.js
SweetTracker SDK for Asynchronous Node.js. You can easily search for delivery information.
Table of Contents
How does it work?
Use Sweet Tracker API to track shipment status. if you do not have an API KEY, click here to register as a member.
Install
Use NPM
$ npm install sweettracker
Or Yarn
$ yarn add sweettracker
Usage
Create SweetTracker Client
import SweetTracker from 'sweettracker';
const tracker = new SweetTracker('{ WRITE YOUR SWEET TRACKER API KEY }');
Get Companies
import SweetTracker from 'sweettracker';
const tracker = new SweetTracker('{ WRITE YOUR SWEET TRACKER API KEY }');
const companies = await tracker.getCompanies().then(console.log);
If no error occurs, the following response will come.
[
{ "id": "04", "name": "CJ대한통운" },
{ "id": "05", "name": "한진택배" },
{ "id": "08", "name": "롯데택배" },
...
]
Get Recommended Companies
import SweetTracker from 'sweettracker';
const tracker = new SweetTracker('{ WRITE YOUR SWEET TRACKER API KEY }');
const companies = await tracker
.getRecommendedCompanies('{ WRITE YOUR TRACKING NUMBER }')
.then(console.log);
If no error occurs, the following response will come.
[
{ "id": "04", "name": "CJ대한통운" },
{ "id": "05", "name": "한진택배" },
{ "id": "08", "name": "롯데택배" },
...
]
Get Tracking Information
import SweetTracker from 'sweettracker';
const tracker = new SweetTracker('{ WRITE YOUR SWEET TRACKER API KEY }');
const companies = await tracker
.getTracking('{ WRITE COMPANY ID }', '{ WRITE YOUR TRACKING NUMBER }')
.then(console.log);
If no error occurs, the following response will come.
{
"status": "arrived",
"receiver": {},
"item": {},
"details": [
{
"timestamp": "2020-11-13T03:25:00.000Z",
"kind": "Shipping Label Created, USPS Awaiting Item",
"where": "FORT LAUDERDALE, FL 33351",
"status": "collected",
"phoneNumber": [],
"courier": {}
}
...
]
}
License
Copyright (c) 2020 Daniel Uhm.