SweetTracker SDK for Asynchronous Node.js. You can easily search for delivery information.
Table of Contents
Use Sweet Tracker API to track shipment status. if you do not have an API KEY, click here to register as a member.
Use NPM
$ npm install sweettracker
Or Yarn
$ yarn add sweettracker
import SweetTracker from 'sweettracker';
const tracker = new SweetTracker('{ WRITE YOUR SWEET TRACKER API KEY }');
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": "롯데택배" },
...
]
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": "롯데택배" },
...
]
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": {}
}
...
]
}
Copyright (c) 2020 Daniel Uhm.