1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "enableListingDiscovery": True,
10 "listingTasks": [
11 {
12 "category": "restaurant",
13 "location": "New York",
14 "maxItems": 50,
15 },
16 {
17 "category": "hotel",
18 "location": "Las Vegas",
19 "maxItems": 30,
20 },
21 ],
22 "maxPagesPerTask": 20,
23 "enrichListings": True,
24 "maxReviewsPerPlace": 30,
25 "maxItems": 1000,
26 "proxyConfiguration": {
27 "useApifyProxy": True,
28 "apifyProxyGroups": ["RESIDENTIAL"],
29 "apifyProxyCountry": "US",
30 },
31}
32
33
34run = client.actor("b2b_leads/tripadvisor-real-time-data").call(run_input=run_input)
35
36
37print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
38for item in client.dataset(run.default_dataset_id).iterate_items():
39 print(item)
40
41