1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = { "products": [
9 {
10 "sku": "BOOK-ATTIC",
11 "name": "A Light in the Attic",
12 "yourPrice": 49.99,
13 "currency": "GBP",
14 "costPrice": 20,
15 "competitors": [{
16 "name": "Books to Scrape",
17 "url": "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html",
18 }],
19 },
20 {
21 "sku": "BOOK-VELVET",
22 "name": "Tipping the Velvet",
23 "yourPrice": 55,
24 "currency": "GBP",
25 "costPrice": 25,
26 "competitors": [{
27 "name": "Books to Scrape",
28 "url": "https://books.toscrape.com/catalogue/tipping-the-velvet_999/index.html",
29 }],
30 },
31 {
32 "sku": "RUNNER-TREE-M8",
33 "name": "Men's Tree Runner (size 8)",
34 "yourPrice": 105,
35 "currency": "USD",
36 "costPrice": 45,
37 "competitors": [{
38 "name": "Allbirds (Shopify)",
39 "url": "https://www.allbirds.com/products/mens-tree-runners",
40 }],
41 },
42 ] }
43
44
45run = client.actor("prevailing_glow/competitor-price-monitor").call(run_input=run_input)
46
47
48print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
49for item in client.dataset(run.default_dataset_id).iterate_items():
50 print(item)
51
52