1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "locations": [
10 {
11 "name": "New York, NY",
12 "latitude": 40.7128,
13 "longitude": -74.006,
14 },
15 {
16 "name": "Chicago, IL",
17 "latitude": 41.8781,
18 "longitude": -87.6298,
19 },
20 ],
21 "searchTerms": ["pizza"],
22 "restaurantIds": [],
23 "maxRestaurants": 10,
24 "includeMenuItems": True,
25 "maxMenuItemsPerRestaurant": 20,
26 "proxyConfiguration": {
27 "useApifyProxy": True,
28 "apifyProxyGroups": ["SHADER"],
29 "apifyProxyCountry": "US",
30 },
31}
32
33
34run = client.actor("automation-lab/grubhub-restaurant-menus-scraper").call(run_input=run_input)
35
36
37print("πΎ Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
38for item in client.dataset(run["defaultDatasetId"]).iterate_items():
39 print(item)
40
41