1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "trackingInputs": [
12 {
13 "trackingNumber": "LP00123456789012",
14 "orderId": "8182736455463721"
15 },
16 {
17 "trackingNumber": "CNABC0012345678",
18 "carrierHint": "Cainiao",
19 "countryHint": "PK"
20 }
21 ],
22 "sourcePriority": [
23 "cainiao_web",
24 "aliexpress_web",
25 "seventeen_track_web"
26 ],
27 "includeEventHistory": true,
28 "includeRawSourcePayload": false,
29 "includeDerivedStatus": true,
30 "maxEventsPerTracking": 50,
31 "outputMode": "dataset",
32 "outputKvStoreKey": "TRACKING_OUTPUT",
33 "requestTimeoutSecs": 45,
34 "maxConcurrency": 3,
35 "retriesPerSource": 2,
36 "challengeWaitSecs": 12,
37 "blockAssets": true,
38 "debugMode": false,
39 "saveHtmlSnapshot": false,
40 "saveScreenshot": false,
41 "useCarrierAutoDetect": true,
42 "cookiesText": "",
43 "cookiesJson": "",
44 "seventeenTrackApiKey": ""
45};
46
47
48const run = await client.actor("sovanza.inc/ali-express-tracking").call(input);
49
50
51console.log('Results from dataset');
52console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
53const { items } = await client.dataset(run.defaultDatasetId).listItems();
54items.forEach((item) => {
55 console.dir(item);
56});
57
58