1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "search": "New York",
10 "checkInDate": "2025-01-01",
11 "checkOutDate": "2025-10-01",
12 "startUrls": [
13 "https://www.tripadvisor.com/Hotel_Review-g35805-d236299-Reviews-Sofitel_Chicago_Magnificent_Mile-Chicago_Illinois.html",
14 "https://www.tripadvisor.com/Hotels-g294200-Egypt-Hotels.html",
15 "https://www.tripadvisor.com/FindRestaurants?geo=32655&establishmentTypes=10591&mealTypes=10606&priceTypes=10955&broadened=false",
16 "https://www.tripadvisor.com/Tourism-g60763-New_York_City_New_York-Vacations.html",
17 "https://www.tripadvisor.com/Trips/122547544",
18 ],
19 "language": "en",
20 "currency": "USD",
21 "maxItems": 20,
22 "endPage": 1,
23 "extendOutputFunction": "($) => { return {} }",
24 "customMapFunction": "(object) => { return {...object} }",
25 "proxy": { "useApifyProxy": True },
26}
27
28
29run = client.actor("epctex/tripadvisor-scraper").call(run_input=run_input)
30
31
32print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
33for item in client.dataset(run["defaultDatasetId"]).iterate_items():
34 print(item)
35
36