Google Flights (via Apify)

io.github.retracnv1.0.0更新于 Oct 5, 2026

Google Flights for AI agents: prices, airlines, flight numbers, times, stops, emissions.

已验证Streamable HTTP可网页运行Location & LifestyleWeb Search & Scraping

概览

AI 生成的概览

让助手按航线和日期查询 Google Flights 结果,返回价格、航空公司、时间、经停和排放信息。

功能
这个远程 MCP 服务器把托管在 Apify 上的 Google Flights 抓取器作为工具提供。给定出发地、目的地和出发日期后,它按航班返回一行数据,包含价格、航空公司、航班号、出发和到达时间、时长、经停、中转、机型、腿部空间以及与典型值对比的二氧化碳排放。它支持单程或往返、从经济舱到头等舱、1-9 名成人、仅直飞筛选、任意货币,并可在一次运行中处理多个航线,接受机场代码或城市名。
适用场景
当助手需要针对特定航线和日期的当前航班选项与票价时使用,例如比较行程、查询价格,或为旅行规划收集航空公司和排放信息。
运行要求
远程 MCP 端点 mcp.apify.com,需要在 Authorization 头中以 'Bearer ' 形式提供 Apify API 令牌。需要免费的 Apify 账户来获取令牌,并按返回的航班数量计费。
安装前请注意
Authorization 头携带 Apify API 令牌,应视为机密,避免在共享配置中泄露。运行按每 1,000 个航班 0.20 美元计费,因此重复或大范围搜索会消耗 Apify 账户余额。结果来自抓取 Google Flights 而非官方 API,准确性和可用性无法保证。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Google Flights (via Apify),将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "mcpServers": {
    "google-flights": {
      "type": "http",
      "url": "https://mcp.apify.com/?tools=automationnation/google-flights-scraper"
    }
  }
}

README

Google Flights Scraper & API: prices, airlines and times

[Run on Apify]

Google Flights Scraper is an Apify Actor that returns Google Flights results for any route and date: price, airlines, flight numbers, departure and arrival times, duration, stops and layovers, aircraft, legroom and CO2 emissions, one way or round trip, any cabin, passengers and currency, at $0.20 per 1,000 flights.

Price: $0.20 per 1,000 flights ($0.16 on Gold and above) · Run it: https://apify.com/automationnation/google-flights-scraper · Guide: https://retracn.github.io/automationnation-actors/google-flights-scraper/

Quick facts

  • One row per flight: price, airlines, flight numbers, times, duration, stops, layovers, legs with aircraft and legroom, CO2 vs typical.
  • One way or round trip, economy to first, 1–9 adults, nonstop filter, any currency.
  • Airport codes or city names; many routes per run.
  • Price: $0.20 per 1,000 flights (a search costs under a cent).

Example input

json
{  "origin": "JFK",  "destination": "LHR",  "departureDate": "2026-11-12"}

Run it from code

REST API

bash
curl -X POST "https://api.apify.com/v2/acts/automationnation~google-flights-scraper/run-sync-get-dataset-items?token=$APIFY_TOKEN" \  -H "Content-Type: application/json" \  -d '{"origin": "JFK", "destination": "LHR", "departureDate": "2026-11-12"}'

Python — see examples/python_example.py

python
# pip install apify-clientfrom apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")run = client.actor("automationnation/google-flights-scraper").call(run_input={  "origin": "JFK",  "destination": "LHR",  "departureDate": "2026-11-12"})for item in client.dataset(run["defaultDatasetId"]).iterate_items():    print(item.get("price"), item.get("airlines"), item.get("departure"), item.get("duration"))

JavaScript — see examples/node_example.mjs

js
// npm install apify-clientimport { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });const run = await client.actor('automationnation/google-flights-scraper').call({  "origin": "JFK",  "destination": "LHR",  "departureDate": "2026-11-12"});const { items } = await client.dataset(run.defaultDatasetId).listItems();for (const item of items) console.log(item.price, item.airlines, item.departure, item.duration);

Use it with AI agents (MCP)

Hosted MCP server URL (Claude, ChatGPT, Cursor and other clients with remote MCP support):

https://mcp.apify.com?tools=automationnation/google-flights-scraper

Local config for Claude Desktop / Cursor — mcp/claude_desktop_config.json:

json
{  "mcpServers": {    "google-flights-scraper": {      "command": "npx",      "args": [        "-y",        "@apify/actors-mcp-server",        "--tools",        "automationnation/google-flights-scraper"      ],      "env": {        "APIFY_TOKEN": "YOUR_APIFY_TOKEN"      }    }  }}

FAQ

Is there an official Google Flights API? No. Google shut down its QPX Express flights API in 2018. Google Flights Scraper returns Google Flights results as data.

Are prices per person? Prices include taxes and cover all passengers; round trips show the round-trip total.

More from AutomationNation


This repository holds usage examples. The scraper itself runs on the Apify platform; you need a free Apify account and API token. Examples are MIT licensed.

来源:README.md,提交 00b8766

工具

0
工具元数据尚未被收录。

版本历史

1
  1. v1.0.0最新Oct 5, 2026