1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "cadence": "daily",
12 "competitorPolicyUrls": [
13 "https://shop-a.example.com/shipping",
14 "https://shop-a.example.com/returns",
15 "https://shop-a.example.com/cart",
16 "https://shop-b.example.com/shipping",
17 "https://shop-b.example.com/returns",
18 "https://shop-b.example.com/cart",
19 "https://shop-c.example.com/shipping",
20 "https://shop-c.example.com/returns",
21 "https://shop-c.example.com/cart"
22 ],
23 "competitors": [
24 "shop-a.example.com",
25 "shop-b.example.com",
26 "shop-c.example.com"
27 ],
28 "computeCapUsd": 39,
29 "maxSpendUsd": 29,
30 "capMode": "capped",
31 "synthetic": true,
32 "watchId": "shipping-watch-demo-01"
33};
34
35
36const run = await client.actor("steadyworks/shipping-policy-change-monitor").call(input);
37
38
39console.log('Results from dataset');
40console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
41const { items } = await client.dataset(run.defaultDatasetId).listItems();
42items.forEach((item) => {
43 console.dir(item);
44});
45
46