1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "currentItems": [
12 {
13 "id": "offer-a",
14 "product": "Canvas Tote Bag",
15 "supplier": "Factory A",
16 "price": 8.4,
17 "moq": 50,
18 "supplierScore": 92,
19 "repeatBuyerPct": 38,
20 "orders": 1240,
21 "date": "2026-09-23"
22 },
23 {
24 "id": "offer-b",
25 "product": "Canvas Tote Bag",
26 "supplier": "Factory B",
27 "price": 7.9,
28 "moq": 200,
29 "supplierScore": 76,
30 "repeatBuyerPct": 22,
31 "orders": 880,
32 "date": "2026-09-23"
33 },
34 {
35 "id": "offer-c",
36 "product": "Canvas Tote Bag",
37 "supplier": "Factory C",
38 "price": 9.1,
39 "moq": 20,
40 "supplierScore": 95,
41 "repeatBuyerPct": 44,
42 "orders": 1560,
43 "date": "2026-09-23"
44 }
45 ],
46 "previousItems": [
47 {
48 "id": "offer-a",
49 "product": "Canvas Tote Bag",
50 "supplier": "Factory A",
51 "price": 8.8,
52 "moq": 50,
53 "supplierScore": 91,
54 "repeatBuyerPct": 35,
55 "orders": 1130,
56 "date": "2026-09-16"
57 },
58 {
59 "id": "offer-b",
60 "product": "Canvas Tote Bag",
61 "supplier": "Factory B",
62 "price": 7.9,
63 "moq": 200,
64 "supplierScore": 75,
65 "repeatBuyerPct": 21,
66 "orders": 810,
67 "date": "2026-09-16"
68 }
69 ]
70};
71
72
73const run = await client.actor("quanmatrix/1688-visual-sourcing-supplier-opportunity-intelligence").call(input);
74
75
76console.log('Results from dataset');
77console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
78const { items } = await client.dataset(run.defaultDatasetId).listItems();
79items.forEach((item) => {
80 console.dir(item);
81});
82
83