![Google Flights Scraper avatar](https://images.apifyusercontent.com/w28JH1JzDZrTa1Jc5d3fZ7u-HhNPXsZjYXEALU-kfqQ/rs:fill:92:92/aHR0cHM6Ly9hcGlmeS1pbWFnZS11cGxvYWRzLXByb2QuczMudXMtZWFzdC0xLmFtYXpvbmF3cy5jb20vbUpiRkVjVFBudWZSUmgwbWovTGJuSjdjVnJVVW92eGNHeEotZ29vZ2xlLWZsaWdodDE2NzAuanBn.webp)
Google Flights Scraper
DeprecatedView all Actors![Google Flights Scraper](https://images.apifyusercontent.com/w28JH1JzDZrTa1Jc5d3fZ7u-HhNPXsZjYXEALU-kfqQ/rs:fill:92:92/aHR0cHM6Ly9hcGlmeS1pbWFnZS11cGxvYWRzLXByb2QuczMudXMtZWFzdC0xLmFtYXpvbmF3cy5jb20vbUpiRkVjVFBudWZSUmgwbWovTGJuSjdjVnJVVW92eGNHeEotZ29vZ2xlLWZsaWdodDE2NzAuanBn.webp)
This Actor is deprecated
This Actor is unavailable because the developer has decided to deprecate it. Would you like to try a similar Actor instead?
See alternative Actors![Google Flights Scraper](https://images.apifyusercontent.com/w28JH1JzDZrTa1Jc5d3fZ7u-HhNPXsZjYXEALU-kfqQ/rs:fill:92:92/aHR0cHM6Ly9hcGlmeS1pbWFnZS11cGxvYWRzLXByb2QuczMudXMtZWFzdC0xLmFtYXpvbmF3cy5jb20vbUpiRkVjVFBudWZSUmgwbWovTGJuSjdjVnJVVW92eGNHeEotZ29vZ2xlLWZsaWdodDE2NzAuanBn.webp)
Google Flights Scraper
epctex/google-flights-scraper
Gather flight information from Google Flights right away. Extract details such as flights, fares, availability, and additional data. Blazing fast, and very powerful data source is at your fingertips!
The code examples below show how to run the Actor and get its results. To run the code, you need to have an Apify account. Replace <YOUR_API_TOKEN> in the code with your API token, which you can find under Settings > Integrations in Apify Console. Learn more
1import { ApifyClient } from 'apify-client';
2
3// Initialize the ApifyClient with your Apify API token
4const client = new ApifyClient({
5 token: '<YOUR_API_TOKEN>',
6});
7
8// Prepare Actor input
9const input = {
10 "currency": "USD",
11 "maxItems": 20,
12 "mode": "oneWay",
13 "departure": "LAX",
14 "arrival": "JFK",
15 "departureDate": "2024-02-01",
16 "returnDate": "2024-02-22",
17 "adults": 1,
18 "children": 0,
19 "infantsOnSeat": 0,
20 "infantsOnLap": 0,
21 "extendOutputFunction": ($) => { return {} },
22 "customMapFunction": (object) => { return {...object} },
23 "proxy": {
24 "useApifyProxy": true
25 }
26};
27
28(async () => {
29 // Run the Actor and wait for it to finish
30 const run = await client.actor("epctex/google-flights-scraper").call(input);
31
32 // Fetch and print Actor results from the run's dataset (if any)
33 console.log('Results from dataset');
34 console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
35 const { items } = await client.dataset(run.defaultDatasetId).listItems();
36 items.forEach((item) => {
37 console.dir(item);
38 });
39})();
40
41// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs