1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "mode": "search",
10 "queries": ["organic milk"],
11 "retailers": [
12 "costco",
13 "safeway",
14 ],
15 "urls": [
16 "https://www.instacart.com/store/costco/s?k=greek+yogurt",
17 "https://www.instacart.com/store/costco/products/19208138-kirkland-signature-homogenized-milk-2-gal-2-gal",
18 "https://www.instacart.com/store/costco/products/19208138",
19 "https://www.instacart.com/store/safeway/storefront",
20 "https://www.instacart.com/store/costco",
21 "https://www.instacart.com/store/costco/collections/produce",
22 "https://www.instacart.com/store/costco/s?k=greek+yogurt&page=2",
23 "https://www.instacart.com/store/s?k=milk",
24 ],
25 "includeDepartments": False,
26 "postalCode": "10001",
27 "inStockOnly": False,
28 "onSaleOnly": False,
29 "fetchDetails": False,
30 "proxy": {
31 "useApifyProxy": True,
32 "apifyProxyGroups": ["RESIDENTIAL"],
33 "apifyProxyCountry": "US",
34 },
35 "incrementalMode": False,
36 "emitUnchanged": False,
37 "emitExpired": False,
38 "ignoreFieldsForChanges": [],
39}
40
41
42run = client.actor("abotapi/instacart-grocery-price-scraper").call(run_input=run_input)
43
44
45print(f"πΎ Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
46for item in client.dataset(run.default_dataset_id).iterate_items():
47 print(item)
48
49