1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "origin": "DEL",
10 "destination": "BOM",
11 "tripType": "ONE_WAY",
12 "departureDate": "AUTO",
13 "adults": 1,
14 "children": 0,
15 "infantsInSeats": 0,
16 "maxStops": 2,
17 "maxRetries": 2,
18 "maxOutboundSelections": 2,
19 "maxReturnOptions": 5,
20 "maxResults": 10,
21 "cabinClass": "ECONOMY",
22 "flightType": "ALL",
23 "locale": "en",
24 "country": "IN",
25}
26
27
28run = client.actor("aiconsulting/google-flights-scraper-v2").call(run_input=run_input)
29
30
31print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
32for item in client.dataset(run.default_dataset_id).iterate_items():
33 print(item)
34
35