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": "cat1",
14 "title": "portable espresso",
15 "demandScore": 91,
16 "competitionScore": 42,
17 "growthPct": 36,
18 "avgRating": 4.1,
19 "reviewCount": 4800,
20 "priceRoomPct": 28,
21 "sellerCount": 85
22 },
23 {
24 "id": "cat2",
25 "title": "phone stands",
26 "demandScore": 62,
27 "competitionScore": 89,
28 "growthPct": 4,
29 "avgRating": 4.6,
30 "reviewCount": 42000,
31 "priceRoomPct": 6,
32 "sellerCount": 640
33 }
34 ],
35 "previousItems": [
36 {
37 "id": "cat1",
38 "title": "portable espresso",
39 "demandScore": 75,
40 "competitionScore": 48,
41 "growthPct": 18,
42 "avgRating": 4,
43 "reviewCount": 3500,
44 "priceRoomPct": 20,
45 "sellerCount": 72
46 }
47 ]
48};
49
50
51const run = await client.actor("quanmatrix/amazon-product-whitespace-intelligence").call(input);
52
53
54console.log('Results from dataset');
55console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
56const { items } = await client.dataset(run.defaultDatasetId).listItems();
57items.forEach((item) => {
58 console.dir(item);
59});
60
61