1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "sourceRows": [
12 {
13 "offerId": "DEMO-1688-A",
14 "title": "FICTIONAL EXAMPLE: industrial LED light",
15 "sellerLoginId": "DEMO_ONLY_SUPPLIER_A",
16 "priceCny": 28.5,
17 "monthlySales": 130,
18 "minOrderQuantity": 20,
19 "supplierYears": 5,
20 "searchQuery": "demo",
21 "offerUrl": "https://example.org/fictional-1688-a"
22 },
23 {
24 "offerId": "DEMO-1688-B",
25 "title": "FICTIONAL EXAMPLE: charging cable",
26 "sellerLoginId": "DEMO_ONLY_SUPPLIER_B",
27 "priceCny": 5.4,
28 "monthlySales": 240,
29 "minOrderQuantity": 100,
30 "supplierYears": 2,
31 "searchQuery": "demo",
32 "offerUrl": "https://example.org/fictional-1688-b"
33 }
34 ],
35 "queries": [
36 "LED灯"
37 ],
38 "previousSnapshot": []
39};
40
41
42const run = await client.actor("quanmatrix/1688-supplier-sourcing-intelligence").call(input);
43
44
45console.log('Results from dataset');
46console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
47const { items } = await client.dataset(run.defaultDatasetId).listItems();
48items.forEach((item) => {
49 console.dir(item);
50});
51
52