How to Scrape Google Flights Data in 2026
Learn what Google Flights data you can access, how to use a documented third-party API, and when to choose an authorized flight-data source.

There is no general public Google Flights route-search API for arbitrary developers. Google’s Flights Search (GFS) documentation describes a metasearch engine and points airlines and online travel agencies (OTAs) to an invitation-only partner integration. A documented alternative for extracting Google Flights results is SerpApi, a third-party service; it is not Google’s API. If you need inventory you can search or book under an authorized agreement, evaluate travel-data or booking APIs instead.
That distinction should decide your implementation. Reproducing Google Flights display data raises questions about permitted access, terms, data rights, freshness, and vendor dependence. Finding bookable inventory is a separate problem: use a provider whose access terms cover your use and whose data and booking workflow meet your requirements. Neither approach guarantees results identical to a traveler’s live Google Flights view.
1. Decide which flight data you need
Start by writing down the output and what you intend to do with it. Search results may contain itinerary legs, carriers, prices, times, layovers, emissions, and booking options. Availability and exact field shape depend on the source and request; do not assume every result includes every field or is complete.

| Need | Route to investigate | Questions to settle |
|---|---|---|
| Google Flights display results for research or comparison | Evaluate a documented third-party extraction provider | Are automated requests allowed for the relevant target and jurisdiction? What are the provider’s data rights, coverage, freshness, limits, and price? |
| Searchable flight inventory | Evaluate authorized travel-data APIs | Which airlines, routes, currencies, and locales are covered? How are changes and stale prices handled? |
| Reservations or ticketing | Evaluate a booking provider with an authorized purchase flow | Does it return bookable offers and support the ticketing workflow, or only search results? |
| Google partner flight integration | Review Google’s Flights Search partner onboarding | Google describes partner material shared with select invite-only partners under NDA; this is not a public self-serve API. |
Google describes GFS as a free, organic metasearch engine that provides flight solutions and links to partners. A booking-options lookup documented by a third-party extraction vendor does not itself buy or reserve a ticket. Confirm the actual downstream purchase capability with the relevant booking provider. Google’s partner overview is at Flights Search.
2. Review access rules before automating
Do not assume that a page visible in a browser is automatically permitted for automated extraction. Google’s US Terms of Service effective July 30, 2026 prohibit automated access that violates machine-readable instructions on Google pages. Google Search Central also says automated queries to Google Search without express permission violate its spam policies and Terms of Service. That Search policy has a defined scope: automated queries to Google Search. It should not be presented as a universal ruling about every Google Flights method, country, or page.
Before choosing direct automation, check the current machine-readable instructions for the exact target paths, applicable service terms, and local law. The research behind this guide did not establish current Google Flights robots directives. Do not bypass access controls or identity checks. For managed extraction, check the vendor’s terms and downstream-use rights too; outsourcing the request does not establish that your intended use is permitted.
For authorized partner integrations, Google’s partner documentation describes onboarding for selected airlines and OTAs. Partner dashboards track operational measures such as response success, errors, whether an itinerary was found, and price discrepancies. These monitoring concepts are useful for any flight-data integration, but partner dashboard figures are not a performance promise for third-party extraction services.
3. Use a documented third-party Google Flights API
SerpApi documents a Google Flights engine with route, dates, locale, currency, and output parameters, plus Python and JavaScript usage. It is a vendor service, not an official Google API. The following example follows the vendor’s documented pattern; it has not been independently executed here, and the response schema or parameters may change. Check the current Google Flights API documentation before deployment.
Python example
Install the HTTP client with python -m pip install requests. Set the key in your environment rather than committing it to source control. This example requests one-way results and checks both the HTTP response and the API error payload.
import os
from datetime import date, timedelta
import requests
API_KEY = os.environ["SERPAPI_KEY"]
departure_date = date.today() + timedelta(days=30)
params = {
"engine": "google_flights",
"departure_id": "JFK",
"arrival_id": "LHR",
"outbound_date": departure_date.isoformat(),
"type": "2", # one-way trip
"currency": "USD",
"hl": "en",
"api_key": API_KEY,
"output": "json",
}
response = requests.get(
"https://serpapi.com/search.json",
params=params,
timeout=60,
)
response.raise_for_status()
data = response.json()
if data.get("error"):
raise RuntimeError(f"SerpApi error: {data['error']}")
for group in ("best_flights", "other_flights"):
for option in data.get(group, []):
print(group, option)
Use airport or location identifiers that the provider accepts; the example uses JFK and LHR. The documented response may group results under best_flights and other_flights. Treat those groups as optional: an empty or missing group is not proof that the route has no flights. Log the request context and inspect the full response during integration development, while keeping credentials and sensitive data out of logs.
JavaScript example
This Node.js example uses built-in fetch. Set SERPAPI_KEY in the process environment. Node versions without global fetch need a compatible HTTP client instead.
const key = process.env.SERPAPI_KEY;
if (!key) throw new Error("Set SERPAPI_KEY first");
const params = new URLSearchParams({
engine: "google_flights",
departure_id: "JFK",
arrival_id: "LHR",
outbound_date: "2026-11-15",
type: "2",
currency: "USD",
hl: "en",
api_key: key,
output: "json",
});
const response = await fetch(
`https://serpapi.com/search.json?${params}`,
{ signal: AbortSignal.timeout(60_000) }
);
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${await response.text()}`);
}
const data = await response.json();
if (data.error) throw new Error(`SerpApi error: ${data.error}`);
for (const group of ["best_flights", "other_flights"]) {
for (const option of data[group] ?? []) {
console.log(group, option);
}
}
Replace the fixed outbound date with a validated date supplied by your application. Validate route identifiers, trip type, and date combinations before making a request. The exact accepted values and additional filters are vendor-specific; consult current documentation instead of guessing parameter names.
cURL example
For a quick request, keep the key in an environment variable and URL-encode query parameters. Avoid pasting a real key into a shared shell history or support ticket.
curl --get 'https://serpapi.com/search.json' \
--data-urlencode 'engine=google_flights' \
--data-urlencode 'departure_id=JFK' \
--data-urlencode 'arrival_id=LHR' \
--data-urlencode 'outbound_date=2026-11-15' \
--data-urlencode 'type=2' \
--data-urlencode 'currency=USD' \
--data-urlencode 'hl=en' \
--data-urlencode "api_key=$SERPAPI_KEY" \
--data-urlencode 'output=json'
4. Set parameters and parse results deliberately
A route search is only as useful as its context. Keep the following request choices and stored fields explicit:

- Route: departure and arrival identifiers. Verify whether the provider accepts airports, cities, or both for your use case.
- Dates and trip type: outbound date, and a return date when requesting a round trip. Validate that dates are in the future where required and that a return date follows departure.
- Currency and language: set these explicitly so observations are comparable. Locale can affect labels, presentation, and possibly available options.
- Result groups: inspect both
best_flightsandother_flightswhen present. Do not hard-code an assumption that either is always returned. - Provenance: record observation time, route, travel dates, currency, locale, source, and request parameters alongside each price. Without these, a price record is hard to interpret.
For round trips, the vendor documents a flow in which a departure selection token is used to retrieve return options. Booking tokens can be passed to a booking-options lookup. Tokens are opaque: obtain them from actual results, do not construct them, and do not treat a booking-options lookup as a reservation. The vendor also documents pinning a specific flight. Because token behavior and parameters can change, follow the current vendor guide for the exact request sequence.
Handle JSON as untrusted, changing external input. Validate types and required fields before storing or displaying them. Preserve the raw response for a short, policy-compliant debugging window if your data rights allow it; normalize the fields your application needs into a versioned internal schema. Do not silently turn missing values into zero prices or zero-duration flights.
5. Or skip the browser setup
If the task is to capture a webpage for documentation or visual review, rather than to obtain flight inventory, ScreenshotNeo is a website screenshot API and MCP server. One GET request returns PNG, JPEG, WebP, or PDF. See the API documentation. For example, this cURL call captures a public page as WebP:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://www.google.com/travel/flights -o shot.webp
ScreenshotNeo accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and the response identifies the page verdict and billing status in headers. Its MCP server gives AI agents tools for taking screenshots, getting page info, and capturing PDFs. This captures a rendered page; it does not produce structured, searchable flight inventory or establish permission to automate access to a Google page.
The Free plan includes 1,000 screenshots per month with no card. Paid plans start at $5 for 3,000; yearly billing gives two months free, and every feature is on every plan. If a rendered-page capture fits your task, sign up for 1,000 free screenshots a month, with no card.
6. Reliability, performance, and cost
Flight fares and availability change. Treat every result as an observation made at a particular time, not a durable quote or promise that a traveler can still buy at that price. For price tracking, retain timestamps and request context, refresh according to the decision your application makes, and show users when the information was observed. Avoid presenting a third-party result as guaranteed to match Google Flights at the moment a person opens it.
Set finite connection/read timeouts, handle non-success HTTP statuses, and treat an API error field as failure even when the transport returned HTTP success. Retry only transient failures, with bounded attempts and backoff; do not retry invalid parameters or authentication failures unchanged. Respect the provider’s current rate limits and quota rules. Batch or schedule requests only within the service’s documented allowances.
No comparable vendor prices, quotas, latency figures, or licensing terms were established by the source material for this guide. Check current provider pricing and terms before selecting a service. Estimate cost from your expected query volume, refresh frequency, retries, and retained history, then test the budget against actual usage. Do not infer completeness from a low response time or a non-empty result.
7. Troubleshooting
| Symptom | Likely cause | What to do |
|---|---|---|
| HTTP error or API error payload | Bad credentials, invalid parameters, quota, or provider-side issue | Check status and response body; verify the key and current parameter documentation. Treat an error field as failure even for HTTP 200. |
No best_flights or other_flights |
Response shape varies, a group is absent, or no matching options were returned | Handle missing groups as empty; inspect the full response and verify route, dates, trip type, locale, and filters. |
| Unexpected currency or language | Localization parameters were omitted, misspelled, or not supported as assumed | Set currency and language explicitly, then confirm the provider’s documented accepted values. |
| Round-trip options do not match the selected departure | A selection token was omitted, stale, or paired with a different search | Use the opaque token returned by the current departure result and follow the vendor’s documented sequence. Do not synthesize tokens. |
| Booking options appear but no ticket is issued | A booking-options lookup presents paths or partners; it is not necessarily a purchase | Use an authorized booking or ticketing integration for the actual purchase flow. |
| Direct browser automation is blocked or challenged | Access restrictions or identity checks may be in place | Do not bypass controls. Recheck target instructions and terms, or use an authorized provider or partner route. |
| Price differs from a later user view | Fares and availability changed, or source, locale, currency, or observation time differ | Store and show observation context; refresh before making a user-facing decision and avoid promising a fare remains available. |
8. Frequently asked questions
Is there an official public Google Flights API?
The cited Google Flights Search material describes partner onboarding for selected airlines and OTAs, not a general public route-search API. Recheck current onboarding details if you represent an eligible travel business.
Does SerpApi return every Google Flights result?
The cited documentation describes structured result groups, but the research does not establish completeness or equivalence to a live traveler view. Treat result coverage as something to evaluate against your actual routes and use.
Can I book a flight with a booking token?
A token can be part of a documented booking-options lookup, but that lookup does not itself buy or reserve a ticket. Confirm the provider’s supported purchase flow and terms.
Can I use a screenshot API to extract fares?
A screenshot is a visual capture of a rendered page, not structured inventory. Use an authorized data source when your application needs queryable offers or a booking workflow.
What should a price-history record contain?
At minimum, retain the route, travel dates, observation timestamp, currency, locale, source, and the fields needed to distinguish itineraries. Keep storage and reuse within applicable provider terms and law.


