# Google Flights Search API (`gauravlabs/google-flights-search-api`) Actor

Fast and reliable Google Flights Search API for retrieving flight prices, airlines, schedules, durations, airport details, price insights, carbon emissions, and booking data in structured JSON. Supports one-way, round-trip, localization, and multiple travel classes.

- **URL**: https://apify.com/gauravlabs/google-flights-search-api.md
- **Developed by:** [Gaurav Kumar Choudhary](https://apify.com/gauravlabs) (community)
- **Categories:** Travel, Automation, Developer tools
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 2 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $1.20 / 1,000 successful flight searches

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## ✈️ Google Flights Search API

Search Google Flights and retrieve structured flight search results including prices, airlines, flight duration, carbon emissions, booking tokens, airport information, and much more.

Perfect for travel applications, AI agents, travel analytics, fare monitoring, booking platforms, and market research.

***

## 🚀 Features

- ✅ One-way Flights
- ✅ Round-trip Flights
- ✅ Economy, Premium Economy, Business & First Class
- ✅ Direct or Multi-stop Flights
- ✅ Multiple Passengers
- ✅ Currency Selection
- ✅ Country & Language Localization
- ✅ Best Flight Recommendations
- ✅ Other Available Flights
- ✅ Price Insights
- ✅ Airport Information
- ✅ Carbon Emissions
- ✅ Booking Tokens
- ✅ Structured JSON Output

***

## Example Input

### One Way Flight

```json
{
    "departureId": "JFK",
    "arrivalId": "LAX",
    "outboundDate": "2026-09-10",
    "type": 2,
    "adults": 1,
    "children": 0,
    "infantsInSeat": 0,
    "infantsOnLap": 0,
    "travelClass": 1,
    "stops": 0,
    "sortBy": 1,
    "currency": "USD",
    "gl": "US",
    "hl": "en"
}
```

***

### Round Trip

```json
{
    "departureId": "JFK",
    "arrivalId": "LAX",
    "outboundDate": "2026-09-10",
    "returnDate": "2026-09-17",
    "type": 1,
    "adults": 2,
    "travelClass": 1,
    "currency": "USD",
    "gl": "US",
    "hl": "en"
}
```

***

## Input Parameters

| Parameter | Type | Description |
|------------|------|-------------|
| departureId | string | Departure Airport IATA Code |
| arrivalId | string | Arrival Airport IATA Code |
| outboundDate | string | YYYY-MM-DD |
| returnDate | string | Required for Round Trip |
| type | integer | 1 = Round Trip, 2 = One Way |
| adults | integer | 1-9 |
| children | integer | 0-9 |
| infantsInSeat | integer | 0-4 |
| infantsOnLap | integer | 0-4 |
| travelClass | integer | 1 Economy, 2 Premium Economy, 3 Business, 4 First |
| stops | integer | 0 Any, 1 Non-stop, 2 One Stop, 3 Multiple Stops |
| sortBy | integer | Flight Sorting |
| currency | string | Currency Code |
| gl | string | Google Country |
| hl | string | Language |

***

## Example Response

```json
{
  "search_parameters": {},
  "best_flights": [],
  "other_flights": [],
  "price_insights": {},
  "airports": []
}
```

***

## Response Includes

### ✈️ Best Flights

Every flight includes

- Airline
- Flight Number
- Aircraft
- Departure Airport
- Arrival Airport
- Departure Time
- Arrival Time
- Duration
- Flight Price
- Travel Class
- Airline Logo
- Legroom
- Carbon Emissions
- Booking Token

***

### 🌍 Airport Information

- Airport Name
- IATA Code
- City
- Country
- Country Code
- Airport Images
- Latitude
- Longitude

***

### 💰 Price Insights

Includes

- Lowest Available Price
- Typical Price Range

***

### 🌱 Carbon Emissions

For every flight you receive

- Flight CO₂ emissions
- Typical emissions
- Difference percentage

***

### 📊 Other Flights

Additional flight options that don't appear in Google's "Best Flights".

***

## Supported Travel Classes

| Value | Class |
|--------|--------|
| 1 | Economy |
| 2 | Premium Economy |
| 3 | Business |
| 4 | First |

***

## Flight Types

| Value | Type |
|--------|------|
| 1 | Round Trip |
| 2 | One Way |

***

## Use Cases

- ✈️ Flight Search Websites
- 📊 Travel Analytics
- 💵 Price Monitoring
- 🤖 AI Travel Assistants
- 📱 Travel Apps
- 🏢 Corporate Travel
- 📈 Fare Comparison
- 🧠 AI Agents (ChatGPT, Claude, Cursor)
- 🧳 Booking Platforms

***

## Error Response

```json
{
    "error": true,
    "message": "Flight search is temporarily unavailable. Please retry shortly."
}
```

***

## Notes

- Airport codes must be valid IATA codes (JFK, LAX, ORD, SFO, etc.)
- Dates must use YYYY-MM-DD format.
- Round-trip searches require a return date.
- Returns structured JSON ready for APIs, databases, dashboards, and AI workflows.

***

## Why Choose This API?

✅ Fast Responses

✅ Structured JSON

✅ No HTML Parsing Required

✅ Ready for Production

✅ AI-Friendly Output

✅ Global Flight Coverage

✅ Simple Integration

***

## Pricing

One successful flight search returns all matching flight results for the requested route, including:

- Best Flights
- Other Flights
- Price Insights
- Airport Information

One API call = One Flight Search.

***

Need a custom scraper or integration?

Feel free to reach out through my Apify profile.

# Actor input Schema

## `departureId` (type: `string`):

IATA code(s), e.g. JFK or JFK,LGA,EWR.

## `arrivalId` (type: `string`):

IATA code(s), e.g. LAX.

## `outboundDate` (type: `string`):

YYYY-MM-DD; today or later.

## `returnDate` (type: `string`):

YYYY-MM-DD; required for a round trip.

## `type` (type: `integer`):

1: round trip; 2: one way. Inferred when omitted.

## `adults` (type: `integer`):

Number of adult passengers (1-9).

## `children` (type: `integer`):

Number of child passengers (0-9).

## `infantsInSeat` (type: `integer`):

Number of infants occupying a seat (0-4).

## `infantsOnLap` (type: `integer`):

Number of infants travelling on an adult's lap (0-4).

## `travelClass` (type: `integer`):

1: economy; 2: premium economy; 3: business; 4: first.

## `stops` (type: `integer`):

0: any; 1: nonstop; 2: up to 1; 3: up to 2.

## `sortBy` (type: `integer`):

1: top; 2: price; 3: departure; 4: arrival; 5: duration; 6: emissions.

## `includeAirlines` (type: `string`):

Comma-separated IATA airline codes; cannot be used with excludeAirlines.

## `excludeAirlines` (type: `string`):

Comma-separated IATA airline codes; cannot be used with includeAirlines.

## `hl` (type: `string`):

Language code for returned content, e.g. en.

## `gl` (type: `string`):

Country code used for local results, e.g. us.

## `currency` (type: `string`):

Currency code for prices, e.g. USD.

## Actor input object example

```json
{
  "type": 2,
  "adults": 1,
  "children": 0,
  "infantsInSeat": 0,
  "infantsOnLap": 0,
  "travelClass": 1,
  "stops": 0,
  "sortBy": 1,
  "hl": "en",
  "gl": "us",
  "currency": "USD"
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("gauravlabs/google-flights-search-api").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("gauravlabs/google-flights-search-api").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call gauravlabs/google-flights-search-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,gauravlabs/google-flights-search-api"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/lLZLUFNhij9CXCOBt/builds/ZHpDhBkTzaqzNDGow/openapi.json
