1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "searches": [
12 {
13 "origin": "JFK",
14 "destination": "LAX",
15 "departureDate": "2027-03-17"
16 }
17 ],
18 "currency": "USD",
19 "country": "US",
20 "language": "en-US",
21 "cabinClass": "economy",
22 "adults": 1,
23 "children": 0,
24 "infantsOnLap": 0,
25 "infantsInSeat": 0,
26 "sortBy": "best",
27 "includeBookingDetails": false,
28 "airlines": []
29};
30
31
32const run = await client.actor("danthedataman/google-flights-fare-atlas").call(input);
33
34
35console.log('Results from dataset');
36console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
37const { items } = await client.dataset(run.defaultDatasetId).listItems();
38items.forEach((item) => {
39 console.dir(item);
40});
41
42