
HasData Google Flights Deals
com.hasdatav1.0.0更新於 Oct 5, 2026
A plain-language trip description becomes dated flight deals with prices and booking links.
概覽
把一句自然語言的旅行想法變成帶日期的 Google Flights 機票優惠,含票價、典型價格、航空公司、轉機次數與訂票連結。
- 功能
- 提供一個工具 hasdata_google_travel_flights_deals_getGoogleFlightsDeals,輸入自由文字的行程描述與出發地 IATA 代碼,回傳結構化 JSON:帶日期的優惠,包含票價、該航線的典型價格、飛行時間、行程天數、轉機次數、營運航空公司、機場,以及 Google Flights 訂票連結。同時回報 Google 從查詢中解析出的出發機場、搜尋日期範圍與價格區間。選用參數可指定目的地、行程類型、艙等、日期、行程長度、轉機次數、最長飛行時間、最高價格,以及航空公司包含或排除清單。
- 適用情境
- 適合行程還在構想階段時使用:從一句模糊描述(例如賞櫻之旅或海島度假)找出可以去的地方與適合的時間。行程確定之後,改用一般的機票比價 API 更合適。
- 執行需求
- 需要一組 HasData API 金鑰:使用 npm 或 PyPI 的 stdio 啟動器時透過環境變數 HASDATA_API_KEY 提供,連線託管端點時透過標頭 x-api-key 提供。遠端服務只需要 MCP 用戶端與網路連線;stdio 啟動器需要 Node.js 或 uvx。不涉及 Google 帳號。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 HasData Google Flights Deals,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。
其他 MCP 客戶端
把它新增到你客戶端的 mcpServers 設定中。
{
"mcpServers": {
"google-flights-deals": {
"type": "http",
"url": "https://mcp.hasdata.com/mcp?apis=google_travel_flights_deals"
}
}
}README
Google Flights Deals MCP Server
A hosted Model Context Protocol (MCP) server that gives Claude, Cursor, Windsurf and any other MCP client one Google Flights Deals tool. Describe a trip in plain language, such as "cherry blossom in Japan" or "beach escape", and get dated fares from one origin airport with the typical price beside them, the airline, the stops and a booking link, as structured JSON.
1,000 free credits every month, no card required, which is about 66 searches.
[Glama score] [tool contract] [MCP] [Tools] [npm] [PyPI] [License]
Contents
- What you need
- Quick start
- Example prompts
- Tools
- Errors and failure paths
- Pricing, free tier and limits
- How it compares
- FAQ
- HasData links
- Development
- Contributing
- License
What you need
An MCP client and a HasData API key from the dashboard, free to create with no card, and the free tier covers about 66 calls a month at the 15-credit rate. This is a remote server, so the simplest path is a URL and an x-api-key header, with no container to run and no Google account anywhere in the flow. A client that only speaks stdio reaches it through a thin launcher, published as @hasdata/google-flights-deals-mcp on npm and hasdata-google-flights-deals-mcp on PyPI, shown below.
Quick start
The server URL is the same for every client. We run it hands-on in Claude Code and Claude Desktop. The other blocks follow each client's own documented format for a remote server.
Clients with OAuth support can add the same URL as a connector and sign in without putting a key in a config file.
Claude Code
Claude Desktop
Cursor
VS Code
Example prompts
Prompts, not code. Paste one in and the agent picks the tool itself. Each is annotated with the calls it takes, because every successful call costs 15 credits.
I want to see cherry blossom in Japan, flying from LAX. What are the cheapest dates?
One call, 15 credits. Google picks the destinations and the date range from the description.
Beach escape from London in February, nothing over 600 pounds, direct only.
One call, 15 credits. The price ceiling and the stops filter both need a destination pinned with arrivalId, so the agent has to name one or drop the filters.
Same trip but to Tokyo specifically, ten days, business class.
One call, 15 credits. With arrivalId set, the trip length and the cabin become available.
Compare the cherry blossom idea from LAX and from JFK.
Two calls, 30 credits. One origin per call.
Tools
One tool, 15 credits per successful call.
Find flight deals
hasdata_google_travel_flights_deals_getGoogleFlightsDeals
The filters are the thing to get right. All of them require arrivalId. A prompt that asks for direct flights under a price cap while letting Google pick the destination is asking for two things that cannot be combined, and the API says so with a 422 naming the offending pair. Pin a destination or drop the filters.
searchInformation reports what Google made of the query: the departure airport in full with its city and coordinates, the dateRange it settled on, the priceRange it found and the airlines involved.
Errors and failure paths
Your client almost never sees an HTTP error code from a tool call. The MCP layer answers 200 and puts the failure inside the result, with isError set to true and the reason as text.
discountPercent is the exception, not the rule. Across 351 deals measured on 2026-10-05 it was present on 109 of them. Where it appears it matches the gap between price and typicalPrice to within a rounding step, and where it is absent that gap ran from 4% to 15%, so Google appears to publish the field only past a threshold of its own. typicalPrice was on every deal, so compute the comparison yourself rather than reporting "no discount" because the key is missing.
airline and airlineCode go missing together. In that same sample 269 deals named a carrier and 82 did not, and the split is exactly the multipleAirlines flag: every deal that set it to true omitted both fields, every deal that did not carried both. Read the flag before reporting a carrier, and say "several airlines" rather than leaving the field blank.
A filter without arrivalId is rejected before it runs. The API answers 422 with rule: "requiredIfExists" naming both arrivalId and the filter that triggered it, and nothing is billed. All eleven filters behave this way, so the failure is loud and cheap rather than silent.
Dates are what Google chose unless you pinned them. searchInformation.dateRange is the range it searched, which can be months away from today. Quote it when presenting prices, because a fare for next March is not a fare for next month.
Each successful call spends credits from the connected account. Neither a 422 from validation nor a 400 from upstream is billed, measured by reading the balance either side of a call.
Pricing, free tier and limits
The Google Flights Deals tool costs 15 credits per successful call, the same as the Google Flights API. The number of deals returned does not change the price.
The free tier is 1,000 credits every month with no card, which is about 66 searches.
Paid plans start at $59 a month for 200,000 credits, which is about 13,000 searches. The unit price falls on larger plans. Current numbers are on the plans page.
How it compares
The two sit next to each other rather than competing. Use this one to find where and when, then the Google Flights API to price the itinerary once the trip is decided.
FAQ
Do I need a Google account?
No. The only credential involved is your HasData key.
Why were my filters ignored?
They almost certainly went out without arrivalId. Every filter on this tool needs a pinned destination, and a request that omits it still succeeds.
Can I search from several origins at once?
No. departureId takes one airport, so comparing origins means one call each.
How far ahead does it search?
As far as Google decides from the query. Read searchInformation.dateRange rather than assuming the next few weeks.
Is HasData affiliated with Google?
No. HasData is an independent web data provider and is not affiliated with, endorsed by or sponsored by Google. All trademarks belong to their owners.
Compliance and personal data
The server reads the public Google Flights deals interface. It carries no passenger data and books nothing.
HasData links
Development
The tests in test/ assert the tool contract, the part that can break without a commit here. They check that ?apis=google_travel_flights_deals returns the one expected tool, that its name and required parameters have not changed, that it carries a description, and that a real search still returns flightDeals with the documented fields.
Contributing
The parameter table and the sample above were read from the live schema and from a real call rather than from documentation. A correction is welcome when a field or a failure mode has changed. Open an issue with the response you saw.
License
MIT
來源:README.md,提交 4652cca
工具
0版本歷史
1- v1.0.0最新Oct 5, 2026
