关于 Google Flights (via Apify)
Google Flights (via Apify) 是 Apify Actor,可为旅行者和旅游数据工作流获取航班搜索结果,提供行程详情,并支持定期追踪票价下降。
主要功能
- 01航班价格与行程详情
- 02单程和往返搜索
- 03舱位、乘客与货币选项
- 04带价格门槛的降价追踪
适用场景
- 01比较航线与出行日期
- 02定期监测票价下降
MCP 相关
托管的 Apify MCP 服务向 MCP 客户端提供该 Actor 的航班搜索工具,也提供使用 @apify/actors-mcp-server 的本地配置说明。
配置
远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。
https://mcp.apify.com/?tools=automationnation/google-flights-scraperclaude mcp add --transport http retracn-google-flights https://mcp.apify.com/?tools=automationnation/google-flights-scraper{"mcpServers":{"retracn-google-flights":{"type":"http","url":"https://mcp.apify.com/?tools=automationnation/google-flights-scraper"}}}在 Cursor 中打开{"servers":{"retracn-google-flights":{"type":"http","url":"https://mcp.apify.com/?tools=automationnation/google-flights-scraper"}}}在 VS Code 中打开{"mcpServers":{"retracn-google-flights":{"type":"http","url":"https://mcp.apify.com/?tools=automationnation/google-flights-scraper"}}}{"mcpServers":{"retracn-google-flights":{"serverUrl":"https://mcp.apify.com/?tools=automationnation/google-flights-scraper"}}}命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。
https://mcp.apify.com/?tools=automationnation/google-flights-scraper需要授权工具
详细介绍
Google Flights 抓取工具和 API:价格、航空公司和时间
Google Flights Scraper 是一个 Apify Actor,可返回任意航线和日期的 Google Flights 结果:价格、航空公司、航班号、起飞和到达时间、时长、中途停留和转机信息、机型、座位间距和 CO2 排放量;支持单程或往返、任意舱位、乘客人数和货币,价格为每 1,000 个航班 $0.20。
**价格:**每 1,000 个航班 $0.20(Gold 及以上级别为 $0.16)· 运行:https://apify.com/automationnation/google-flights-scraper · 指南:https://retracn.github.io/automationnation-actors/google-flights-scraper/
快速了解
- 每个航班一行:价格、航空公司、航班号、时间、时长、中途停留、转机信息、包含机型和座位间距的航段,以及相较于典型水平的 CO2 排放量。
- 支持单程或往返、经济舱到头等舱、1–9 名成人、不经停筛选和任意货币。
- 支持机场代码或城市名称;每次运行可查询多条航线。
- 价格:每 1,000 个航班 $0.20(每次搜索不到一美分)。
- 正从 Amadeus Self-Service API 迁移?开源的 amadeus-cloud 软件包(github.com/retracn/amadeus-cloud)保留了 Amadeus Node SDK 的 flightOffersSearch.get/post,并返回由此 Actor 提供的 Amadeus 格式报价。
- 票价提醒:开启 Only fare drops 后,定时运行仅会在某条航线的最低票价低于上次运行时保存航班信息,并在每一行中记录上次价格;Max price 可添加“低于 $900”之类的阈值。
示例输入
{
"origin": "JFK",
"destination": "LHR",
"departureDate": "2026-11-12"
}
航班价格提醒(票价下降)
使用 "onlyPriceDrops": true 安排搜索:仅当某条航线的最低票价低于上次运行时,才会保存该航线的航班信息,并在每一行中添加 previousCheapestPrice。添加 "maxPrice": 900 可设置价格阈值提醒。首次运行会保存所有信息(change: "first_check");票价没有下降的运行不会保存任何信息。
{ "origin": "JFK", "destination": "LHR", "departureDate": "2026-12-18", "returnDate": "2027-01-03", "maxPrice": 900, "onlyPriceDrops": true }
开箱即用:n8n 工作流:将票价下降提醒发送到 Slack · 指南:通过 API 设置航班价格提醒 · 公开任务:纽约至伦敦票价提醒
通过代码运行
REST API
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 — 参见 examples/python_example.py
# pip install apify-client
from 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 — 参见 examples/node_example.mjs
// npm install apify-client
import { 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);
将其与 AI Agent 搭配使用(MCP)
托管 MCP 服务 URL(适用于 Claude、ChatGPT、Cursor 和其他支持远程 MCP 的客户端):
https://mcp.apify.com?tools=automationnation/google-flights-scraper
Claude Desktop / Cursor 的本地配置 — mcp/claude_desktop_config.json:
{
"mcpServers": {
"google-flights-scraper": {
"command": "npx",
"args": [
"-y",
"@apify/actors-mcp-server",
"--tools",
"automationnation/google-flights-scraper"
],
"env": {
"APIFY_TOKEN": "YOUR_APIFY_TOKEN"
}
}
}
}
常见问题
有官方的 Google Flights API 吗? 没有。Google 于 2018 年关闭了 QPX Express 航班 API。Google Flights Scraper 会将 Google Flights 搜索结果作为数据返回。
价格是按每位乘客计算的吗? 价格包含税费,涵盖所有乘客;往返行程显示往返总价。
可以向我发送航班价格提醒吗? 可以。开启 Only fare drops 并安排搜索:仅当最低票价下降时,每次运行才会保存航班信息及之前的价格;任务的 Integrations 选项卡会将其发送到 Slack、电子邮件或 Webhook。票价没有下降的运行不会保存任何信息。
更多 AutomationNation 内容
- AI 可见度追踪器 — 每检查一个答案收费 $0.05(Gold 方案为 $0.04)+ 每份可选报告收费 $0.50 · GitHub 示例
- Google Jobs 抓取工具 — 每 1,000 个职位收费 $2(付费方案为 $1.50)+ 每次搜索收费 $0.03 · GitHub 示例
- YouTube 字幕抓取工具 — 每 1,000 份字幕收费 $1.50(Gold 及以上方案为 $1.20)· GitHub 示例
- Google Shopping 抓取工具 — 每 1,000 件商品收费 $1(Gold 及以上方案为 $0.80)· GitHub 示例
- Google Hotels 抓取工具 — 每 1,000 家酒店收费 $1(Gold 及以上方案为 $0.80)· GitHub 示例
- Google Ads Transparency 抓取工具 — 每 1,000 条广告收费 $1(Gold 及以上方案为 $0.80)· GitHub 示例
- Google News 抓取工具 — 每 1,000 篇文章收费 $1(Gold 及以上方案为 $0.80)· GitHub 示例
- Google Images 抓取工具 — 每 1,000 张图片收费 $0.25(Gold 及以上方案为 $0.20)· GitHub 示例
- Google Custom Search API 替代方案 — 每 1,000 次搜索(最多返回 10 条结果)收费 $5(Gold 及以上方案为 $4)· GitHub 示例
- Google Videos 抓取工具 — 每 1,000 个视频收费 $1(Gold 及以上方案为 $0.80)· GitHub 示例
- Google Trends 抓取工具 — 每 1,000 份关键词报告收费 $1(付费方案为 $0.27–$0.90)· 每 1,000 条趋势搜索收费 $0.50 · GitHub 示例
- App Store 评论抓取工具 — 每 1,000 条评论收费 $0.08(付费方案为 $0.05–$0.07)· GitHub 示例
- Google Play 评论抓取工具 — 每 1,000 条评论收费 $0.08(付费方案为 $0.05–$0.07)· GitHub 示例
- AEO 和 GEO 追踪器 — Google AI Overview 引用检查工具 — 每个关键词收费 $0.04(Gold 方案为 $0.032),自 2026 年 11 月 17 日起每次运行另收 $2;截至 2026 年 10 月 16 日,每个关键词收费 $0.01 · GitHub 示例
- Google Maps 潜在客户抓取工具 — 每条潜在客户信息收费 $0.03(Gold 方案为 $0.024);使用无网站或未认领筛选条件时,每找到一家企业收费 $0.08 · GitHub 示例
- 英国 Google Maps 潜在客户抓取工具 — 每条潜在客户信息收费 $0.05(Gold 方案为 $0.04)· GitHub 示例
- App Store 和 Google Play 评论抓取工具 + AI — 每份应用报告收费 $0.05(Gold 方案为 $0.04)· GitHub 示例
- 英国 Companies House 潜在客户 — 申报信号和 AI 外联 — 每条潜在客户信息收费 $0.008
- 联系人瀑布式信息丰富工具 — 电子邮件和董事 — 每家公司收费 $0.015
- 所有 Actors 和指南 · AI 可见度追踪器对比 · Google Jobs 抓取工具对比 · Google Trends 抓取工具对比 · App Store 评论抓取工具对比 · Google Play 评论抓取工具对比 · YouTube 字幕抓取工具对比 · Google Flights 抓取工具对比 · Google Hotels 抓取工具对比 · Google Ads Transparency 抓取工具对比 · Google Shopping 抓取工具对比 · Google News 抓取工具对比
此仓库包含使用示例。抓取工具本身运行在 Apify 平台上;你需要一个免费的 Apify 账户和 API 令牌。示例采用 MIT 许可证。
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。