1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "competitors": [
12 {
13 "id": "acme-saas",
14 "name": "Acme SaaS",
15 "tier": "direct",
16 "tags": [
17 "crm",
18 "smb"
19 ],
20 "pricingPages": [
21 {
22 "id": "acme-pricing",
23 "name": "Acme Pricing",
24 "url": "https://example.com/pricing",
25 "includePatterns": [
26 "starter",
27 "pro",
28 "enterprise",
29 "per month",
30 "per user",
31 "pricing"
32 ],
33 "excludePatterns": [
34 "cookie",
35 "sign in",
36 "sign up",
37 "footer",
38 "nav"
39 ]
40 }
41 ]
42 }
43 ]
44};
45
46
47const run = await client.actor("taroyamada/competitive-pricing-monitor").call(input);
48
49
50console.log('Results from dataset');
51console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
52const { items } = await client.dataset(run.defaultDatasetId).listItems();
53items.forEach((item) => {
54 console.dir(item);
55});
56
57