# Flight Search — Google Flights Scraper (`herus13/flight-search`) Actor

Search flight prices for a single route with optional flex dates. Powered by Google Flights.

- **URL**: https://apify.com/herus13/flight-search.md
- **Developed by:** [bootforge](https://apify.com/herus13) (community)
- **Categories:** Automation, Travel
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.002 / per flight result

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

## Flight Search

Search flight prices from Google Flights. One actor for all use cases.

### Features

- **Single or bulk** — one route or many in a single run
- **Deal finding** — use `flex_days` + `max_price` to find cheapest across dates
- **Price tracking** — enable `track_history` for scheduled monitoring with drop alerts
- Round-trip and one-way
- Cabin class, currency, max stops filters
- Apify Proxy support
- PPE pricing: pay per result

### Why not the official Google Flights actor?

| Feature | `apify/google-flights-scraper` | This actor |
|---|---|---|
| Single search | ✓ | ✓ |
| Bulk routes in one run | ✗ (N runs, N start fees) | ✓ |
| Flex-date deal finding | ✗ | ✓ |
| Scheduled price tracking + alerts | ✗ | ✓ |
| Airport fuzzy matching | limited | ✓ (bundled OurAirports CSV) |
| Pay-per-result pricing | ✓ | ✓ |

---

### Mode 1: Single Route

```json
{
  "origin": "SGN",
  "destination": "HAN",
  "departure_date": "2026-05-15",
  "return_date": "2026-05-20"
}
````

### Mode 2: Bulk Routes

```json
{
  "searches": [
    {"origin": "SGN", "destination": "HAN", "departure_date": "2026-05-15"},
    {"origin": "SGN", "destination": "DAD", "departure_date": "2026-05-16"},
    {"origin": "HAN", "destination": "PQC", "departure_date": "2026-05-17"}
  ],
  "adults": 2,
  "cabin": "economy"
}
```

### Mode 3: Deal Finding

Search ±N days around your target date, filter by max price, return cheapest:

```json
{
  "origin": "SGN",
  "destination": "HAN",
  "departure_date": "2026-05-15",
  "flex_days": 3,
  "max_price": 200,
  "max_results_per_search": 10
}
```

### Mode 4: Price Tracking

Schedule this actor to run daily. It stores price history in KVS and fires alerts when price drops:

```json
{
  "origin": "SGN",
  "destination": "HAN",
  "departure_date": "2026-05-15",
  "track_history": true,
  "alert_threshold_pct": 10
}
```

Output includes `price_change`, `pct_change`, and `alert: true/false`.

***

### Output example

```json
{
  "origin": "SGN",
  "destination": "HAN",
  "departure_date": "2026-05-15",
  "price": 178.0,
  "currency": "USD",
  "outbound_total_duration_minutes": 130,
  "outbound_stops": 0,
  "outbound_segment_0_airline": "Vietnam Airlines",
  "booking_url": "https://www.google.com/travel/flights/..."
}
```

### Pricing

| Event | Price |
|---|---|
| Actor start | $0.02 |
| Per flight result | $0.002 |
| Per price alert (tracking mode) | $0.01 |

**Examples:**

- 1 route × 20 results = $0.02 + $0.04 = **$0.06**
- 10 routes × 20 results = $0.02 + $0.40 = **$0.42**
- Daily tracking × 30 days = 30 × ($0.02 + $0.002) = **$0.66/month**

# Actor input Schema

## `searches` (type: `array`):

Array of routes to search. Each: {origin, destination, departure\_date, return\_date?, flex\_days?, max\_stops?}. If provided, single-route fields below are ignored.

## `origin` (type: `string`):

IATA code or city name (e.g. SGN, 'Ho Chi Minh City')

## `destination` (type: `string`):

IATA code or city name

## `departure_date` (type: `string`):

YYYY-MM-DD

## `return_date` (type: `string`):

YYYY-MM-DD. Leave empty for one-way.

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

Search ±N days around the departure date. Use for deal finding.

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

Maximum number of stops (omit for any)

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

Number of adult passengers (1-9)

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

Number of child passengers (0-9)

## `cabin` (type: `string`):

Cabin class preference

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

ISO 4217 currency code for prices (e.g. USD, EUR, VND)

## `max_price` (type: `number`):

Filter out results above this price (deal finding)

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

Limit results per route

## `track_history` (type: `boolean`):

Enable for scheduled price monitoring. Stores history in KVS and fires alerts on price drops.

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

Fire price-alert event when price drops by this percentage

## `tracking_key` (type: `string`):

Override auto-generated history key. Use when running multiple schedules for the same route.

## `proxy` (type: `object`):

Proxy provider config — Apify Proxy or raw\_urls

## Actor input object example

```json
{
  "origin": "SGN",
  "destination": "HAN",
  "departure_date": "2026-05-15",
  "flex_days": 0,
  "adults": 1,
  "children": 0,
  "cabin": "economy",
  "currency": "USD",
  "max_results_per_search": 50,
  "track_history": false,
  "alert_threshold_pct": 10,
  "proxy": {
    "provider": "apify",
    "group": "RESIDENTIAL"
  }
}
```

# 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 = {
    "origin": "SGN",
    "destination": "HAN",
    "departure_date": "2026-05-15",
    "proxy": {
        "provider": "apify",
        "group": "RESIDENTIAL"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("herus13/flight-search").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 = {
    "origin": "SGN",
    "destination": "HAN",
    "departure_date": "2026-05-15",
    "proxy": {
        "provider": "apify",
        "group": "RESIDENTIAL",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("herus13/flight-search").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "origin": "SGN",
  "destination": "HAN",
  "departure_date": "2026-05-15",
  "proxy": {
    "provider": "apify",
    "group": "RESIDENTIAL"
  }
}' |
apify call herus13/flight-search --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=herus13/flight-search",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Flight Search — Google Flights Scraper",
        "description": "Search flight prices for a single route with optional flex dates. Powered by Google Flights.",
        "version": "0.1",
        "x-build-id": "lAAnKawxOrTGTIL6q"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/herus13~flight-search/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-herus13-flight-search",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/herus13~flight-search/runs": {
            "post": {
                "operationId": "runs-sync-herus13-flight-search",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/herus13~flight-search/run-sync": {
            "post": {
                "operationId": "run-sync-herus13-flight-search",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "searches": {
                        "title": "Bulk searches",
                        "type": "array",
                        "description": "Array of routes to search. Each: {origin, destination, departure_date, return_date?, flex_days?, max_stops?}. If provided, single-route fields below are ignored."
                    },
                    "origin": {
                        "title": "Origin",
                        "type": "string",
                        "description": "IATA code or city name (e.g. SGN, 'Ho Chi Minh City')"
                    },
                    "destination": {
                        "title": "Destination",
                        "type": "string",
                        "description": "IATA code or city name"
                    },
                    "departure_date": {
                        "title": "Departure date",
                        "type": "string",
                        "description": "YYYY-MM-DD"
                    },
                    "return_date": {
                        "title": "Return date (optional)",
                        "type": "string",
                        "description": "YYYY-MM-DD. Leave empty for one-way."
                    },
                    "flex_days": {
                        "title": "Flex days (±)",
                        "minimum": 0,
                        "maximum": 14,
                        "type": "integer",
                        "description": "Search ±N days around the departure date. Use for deal finding.",
                        "default": 0
                    },
                    "max_stops": {
                        "title": "Max stops",
                        "minimum": 0,
                        "maximum": 3,
                        "type": "integer",
                        "description": "Maximum number of stops (omit for any)"
                    },
                    "adults": {
                        "title": "Adults",
                        "minimum": 1,
                        "maximum": 9,
                        "type": "integer",
                        "description": "Number of adult passengers (1-9)",
                        "default": 1
                    },
                    "children": {
                        "title": "Children",
                        "minimum": 0,
                        "maximum": 9,
                        "type": "integer",
                        "description": "Number of child passengers (0-9)",
                        "default": 0
                    },
                    "cabin": {
                        "title": "Cabin class",
                        "enum": [
                            "economy",
                            "premium",
                            "business",
                            "first"
                        ],
                        "type": "string",
                        "description": "Cabin class preference",
                        "default": "economy"
                    },
                    "currency": {
                        "title": "Currency",
                        "type": "string",
                        "description": "ISO 4217 currency code for prices (e.g. USD, EUR, VND)",
                        "default": "USD"
                    },
                    "max_price": {
                        "title": "Max price",
                        "type": "number",
                        "description": "Filter out results above this price (deal finding)"
                    },
                    "max_results_per_search": {
                        "title": "Max results per search",
                        "minimum": 1,
                        "maximum": 200,
                        "type": "integer",
                        "description": "Limit results per route",
                        "default": 50
                    },
                    "track_history": {
                        "title": "Track price history",
                        "type": "boolean",
                        "description": "Enable for scheduled price monitoring. Stores history in KVS and fires alerts on price drops.",
                        "default": false
                    },
                    "alert_threshold_pct": {
                        "title": "Alert threshold (%)",
                        "minimum": 1,
                        "maximum": 90,
                        "type": "integer",
                        "description": "Fire price-alert event when price drops by this percentage",
                        "default": 10
                    },
                    "tracking_key": {
                        "title": "Tracking key (optional)",
                        "type": "string",
                        "description": "Override auto-generated history key. Use when running multiple schedules for the same route."
                    },
                    "proxy": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Proxy provider config — Apify Proxy or raw_urls"
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
