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