1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "asins": [
12 "B08N5WRWNW",
13 "B0B7X9X1Y2",
14 "B09G9D7K1S"
15 ],
16 "urls": [
17 "https://www.amazon.com/dp/B08N5WRWNW",
18 "https://www.walmart.com/ip/Sony-WH-1000XM5/123456789",
19 "https://www.bestbuy.com/site/sony-wh-1000xm5/12345.p",
20 "https://example.myshopify.com/products/sony-headphones"
21 ],
22 "products": [
23 {
24 "platform": "amazon",
25 "productId": "B08N5WRWNW",
26 "url": "https://www.amazon.com/dp/B08N5WRWNW"
27 },
28 {
29 "platform": "walmart",
30 "productId": "123456789"
31 },
32 {
33 "platform": "shopify",
34 "productId": "sony-headphones",
35 "domain": "example"
36 }
37 ],
38 "competitorPrices": [
39 {
40 "platform": "walmart",
41 "price": 329.99,
42 "seller": "Walmart"
43 },
44 {
45 "platform": "bestbuy",
46 "price": 349.99,
47 "seller": "Best Buy"
48 }
49 ]
50};
51
52
53const run = await client.actor("luckborn/price-intelligence").call(input);
54
55
56console.log('Results from dataset');
57console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
58const { items } = await client.dataset(run.defaultDatasetId).listItems();
59items.forEach((item) => {
60 console.dir(item);
61});
62
63