[Home](https://scrapfly.io/)/[Scrapers](https://scrapfly.io/scrapers)/Google Flights

Fares · flight details · price insights

# // Google Flights Scraper API

Get Google Flights fares, flight details and price insights as clean JSON, for one-way and round-trip searches. Send each search through a residential proxy in the country you pick, with a browser that opens each flight's details, and read the flights.

- **Clone it and run it.** An open-source Google Flights scraper for one-way and round-trip results and price insights, tested against live Google Flights every night.
- **Every flight's fare and details.** Each flight comes with its airline, price, stops and flight number, its aircraft, legroom and layovers, and the amenities and fare conditions Google lists for it.
 
 [Get free API key](https://scrapfly.io/register) [View GitHub scraper](https://github.com/scrapfly/scrapfly-scrapers/tree/main/google-flights-scraper) [Read Unblocker docs](https://scrapfly.io/docs/scrape-api/unblocker) 

1,000 free credits. No credit card required.

 [  ](https://scrapeway.com/web-scraping-api/scrapfly) [  ](https://www.capterra.com/p/212653/Scrapfly/reviews/)  

 4.8/5 from 248 reviews 

 

 

 

 

 Google Flights search · illustration

 

 

 Flight JSON**Output**

```
{
  <span class="c-str">"airline"</span>: <span class="c-str">"Delta"</span>,
  <span class="c-str">"flight_number"</span>: <span class="c-str">"DL 266"</span>,
  <span class="c-str">"departure_airport"</span>: <span class="c-str">"JFK"</span>,
  <span class="c-str">"arrival_airport"</span>: <span class="c-str">"CDG"</span>,
  <span class="c-str">"stops"</span>: <span class="c-num">0</span>,
  <span class="c-str">"price"</span>: <span class="c-str">"1273"</span>,
  <span class="c-str">"currency"</span>: <span class="c-str">"USD"</span>,
  <span class="c-str">"plane_model"</span>: <span class="c-str">"Boeing 767"</span>,
  <span class="c-str">"legroom"</span>: <span class="c-str">"31 in"</span>
}
```

Sample output of the open-source scraper[See the request ↓](#implementation)

  

What you can scrape from Google Flights

Four kinds of Google Flights data you can scrape with Scrapfly, no Google account required.

 

## // Scrape Google Flights search results

Every flight of a one-way or round-trip search, with its airline, price, number of stops, departure and arrival airports and times, total duration and cabin class. The scraper reads the price, the stops and the airline from each result card's `aria-label`. Its sample run saved 96 flights for a JFK to Paris CDG round trip and 103 for a one-way JFK to London Heathrow search.

- airline
- price
- stops
- departure\_time
- arrival\_time
- duration
- cabin\_class

  

## // Scrape flight details

The scraper clicks *View more flights*, then opens the details of each visible flight in the same browser scenario. With them, each flight comes with its flight number, aircraft, legroom and layover airports, and what Google lists for its legs and its fare: amenities such as *Wi-Fi for a fee*, an emissions estimate, and fare conditions such as *Checked baggage for a fee*.

- flight\_number
- plane\_model
- legroom
- layovers
- extensions

  

## // Scrape Google Flights price insights

`scrape_price_insights` opens the price history panel of a search: the best booking window, the current price level (low, typical or high), the typical price range and the savings line Google shows, such as *$55 cheaper*. It then scrolls through the departure dates and reads a price for each departure and return date pair from the page's `GetCalendarGrid` background calls: 312 pairs on the sample run.

- best\_booking\_window
- current\_price\_level
- typical\_range\_low
- typical\_range\_high
- savings\_vs\_typical
- calendar\_grid

  

## // Scrape one-way and round-trip searches

Give the scraper two airport codes, a departure date and, for a round trip, a return date. It writes the trip in words into the search URL's `q` parameter, such as *Flights from JFK to CDG on 2026-05-19 through 2026-05-26*, and adds `hl=en` and `curr=USD`: it reads each fare from a label that states it in dollars.

- origin
- destination
- depart
- ret
- hl=en
- curr=USD

  



Reliability

## // Get the whole Google Flights results page

The open-source scraper loads every search in a browser, and gets a flight's details, the extra results and the price history panel through clicks on the page. Every request it sends turns on the Unblocker, residential proxies from the US and a browser, and runs a browser scenario for the clicks.

`unblocker=true`

Scrapfly's [Unblocker](https://scrapfly.io/products/unblocker) (formerly ASP) on every search, with `proxy_pool=public_residential_pool` and `country=US`, as in the scraper's settings.



`js_scenario`

With `render_js=true`, the browser clicks *View more flights* and opens each flight's details, or opens the price history panel, before the page comes back.



`li.pIav2d`

The page holds a hidden copy of the result list, so a flight card can appear twice. Keep one card per `aria-label`, as the scraper does.



 



Choose your tools

## // Scrapfly products for Google Flights scraping

Start with the Web Scraping API, the Unblocker and residential proxies. Add an extraction prompt, screenshots or a browser session as your workflow needs them, or start from the open-source scraper. One API key covers all four products.

 

### Web Scraping API for Google Flights searches

Send a Google Flights search URL with the Unblocker, residential proxies in the country you choose and a browser, and get the rendered results page back as HTML.

Add a `js_scenario` to open flight details or the price history panel before the page comes back, as the scraper does.

```
GET /scrape?url=https://www.google.com/travel/flights?q=Flights+from+JFK+to+CDG+on+2027-01-20+through+2027-01-27%26hl=en%26curr=USD&unblocker=true&proxy_pool=public_residential_pool&country=US&render_js=true
```

 [Explore Web Scraping API →](https://scrapfly.io/products/web-scraping-api)  

### Data Extraction API for Google Flights results

Add an `extraction_prompt` that names the fields you want and get the flights back as JSON, with no parser to write.

Ask for each flight's airline, price, stops, times and duration.

```
GET /scrape?url=https://www.google.com/travel/flights?q=Flights+from+JFK+to+CDG+on+2027-01-20+through+2027-01-27%26hl=en%26curr=USD&unblocker=true&proxy_pool=public_residential_pool&country=US&render_js=true&extraction_prompt=List+each+flight%27s+airline,+price,+stops,+times+and+duration
```

 [Explore Data Extraction API →](https://scrapfly.io/products/extraction-api)  

### Screenshot API for Google Flights results

Capture the results page of a search once its flight cards have loaded.

Keep a dated visual record of fares next to your JSON.

```
GET /screenshot?url=https://www.google.com/travel/flights?q=Flights+from+JFK+to+CDG+on+2027-01-20+through+2027-01-27%26hl=en%26curr=USD&country=us&wait_for_selector=li.pIav2d&capture=fullpage&format=png
```

 [Explore Screenshot API →](https://scrapfly.io/products/screenshot-api)  

### Cloud Browser API for Google Flights sessions

Connect Playwright or Puppeteer to a hosted Chromium on a residential IP in the country you choose.

Open a search URL, wait for the `li.pIav2d` result cards, and click through flight details, dates or the price history panel.

```
chromium.connect_over_cdp("wss://browser.scrapfly.io?api_key=KEY&proxy_pool=residential&country=us")
```

 [Explore Cloud Browser API →](https://scrapfly.io/products/cloud-browser-api)  

### Open-source Google Flights scraper on GitHub

Clone the Python scraper for one-way and round-trip results, flight details and price insights.

It runs on the Web Scraping API with the Unblocker, residential proxies and a browser scenario, and is tested against live Google Flights every night.

- scrape\_flights
- scrape\_price\_insights

 [View the scraper on GitHub →](https://github.com/scrapfly/scrapfly-scrapers/tree/main/google-flights-scraper)  



One request

## // Fetch a Google Flights search and read its flights

The JSON at the top is cut from the sample output the open-source scraper saved for a JFK to Paris CDG round trip, May 19 to 26, 2026, `results/roundtrip.json`: the third of its 96 flights, nine of its fields. This code is a cut-down version of the scraper's request and parser for one search: Unblocker on, residential proxies from the US, a browser, and a scenario that opens each flight's details.

Install `scrapfly-sdk` and `parsel`, which `result.selector` uses, then replace the key below. It searches from today to a week from now, as the scraper's own run does, so the flights and fares it prints are those of your run. Change the airports in the query to search your own route.

**Prefer the full scraper?** The open-source [Google Flights scraper on GitHub](https://github.com/scrapfly/scrapfly-scrapers/tree/main/google-flights-scraper) collects one-way and round-trip results with each flight's details, and the price insights of a route, in Python 3.12. It runs against live Google Flights every night. Clone it, set `SCRAPFLY_KEY`, and run `poetry run python run.py`.

 

  Python · scrapfly-sdkscrape + parse

```
<span class="c-key">import</span> json
<span class="c-key">import</span> re
<span class="c-key">from</span> datetime <span class="c-key">import</span> date, timedelta
<span class="c-key">from</span> urllib.parse <span class="c-key">import</span> quote_plus
<span class="c-key">from</span> scrapfly <span class="c-key">import</span> ScrapeConfig, ScrapflyClient

client = ScrapflyClient(key=<span class="c-str">"YOUR_SCRAPFLY_KEY"</span>)
depart = date.today().isoformat()
ret = (date.today() + timedelta(days=<span class="c-num">7</span>)).isoformat()
query = <span class="c-str">f"Flights from JFK to CDG on {depart} through {ret}"</span>
result = client.scrape(ScrapeConfig(
    <span class="c-str">"https://www.google.com/travel/flights?q="</span>
    + quote_plus(query) + <span class="c-str">"&hl=en&curr=USD"</span>,
    unblocker=<span class="c-key">True</span>,  <span class="c-com"># previously asp</span>
    proxy_pool=<span class="c-str">"public_residential_pool"</span>, country=<span class="c-str">"US"</span>,
    render_js=<span class="c-key">True</span>,
    js_scenario=[  <span class="c-com"># open the details of each visible flight</span>
        {<span class="c-str">"execute"</span>: {<span class="c-str">"script"</span>: <span class="c-str">"document.querySelectorAll("</span>
            <span class="c-str">"'button[aria-label^=\"Flight details\"]')"</span>
            <span class="c-str">".forEach(b => b.offsetParent && b.click())"</span>,
            <span class="c-str">"timeout"</span>: <span class="c-num">15000</span>}},
        {<span class="c-str">"wait"</span>: <span class="c-num">2000</span>},
    ],
))

<span class="c-key">def</span> first(pattern, text):
    match = re.search(pattern, text <span class="c-key">or</span> <span class="c-str">""</span>, re.IGNORECASE)
    <span class="c-key">return</span> match.group(<span class="c-num">1</span>).strip() <span class="c-key">if</span> match <span class="c-key">else</span> <span class="c-key">None</span>

<span class="c-key">def</span> airport(legs, css):
    code = legs.css(css + <span class="c-str">" span[dir='ltr']::text"</span>).get(<span class="c-str">""</span>)
    <span class="c-key">return</span> code.strip(<span class="c-str">"()"</span>) <span class="c-key">or</span> <span class="c-key">None</span>

flights, seen = [], set()
<span class="c-key">for</span> card <span class="c-key">in</span> result.selector.css(<span class="c-str">"li.pIav2d"</span>):
    label = card.css(<span class="c-str">"div[role='link']::attr(aria-label)"</span>).get()
    <span class="c-key">if</span> <span class="c-key">not</span> label <span class="c-key">or</span> label <span class="c-key">in</span> seen:
        <span class="c-key">continue</span>  <span class="c-com"># the page also holds a hidden copy of the list</span>
    seen.add(label)
    legs = card.css(<span class="c-str">"div[jsname='XxAJue'] div[jsname='lVbzR']"</span>)
    impact = card.css(<span class="c-str">"[data-travelimpactmodelwebsiteurl]"</span>
        <span class="c-str">"::attr(data-travelimpactmodelwebsiteurl)"</span>).get()
    number = re.search(<span class="c-str">r"[A-Z]+-[A-Z]+-([A-Z]\w+)-(\d+)-\d{8}"</span>,
                       impact <span class="c-key">or</span> <span class="c-str">""</span>)
    hops = first(<span class="c-str">r"(Nonstop|\d+ stops?)"</span>, label) <span class="c-key">or</span> <span class="c-str">"Nonstop"</span>
    stops = <span class="c-num">0</span> <span class="c-key">if</span> hops.lower() == <span class="c-str">"nonstop"</span> <span class="c-key">else</span> int(hops.split()[<span class="c-num">0</span>])
    model = [s.css(<span class="c-str">"::text"</span>).get()
             <span class="c-key">for</span> s <span class="c-key">in</span> legs[:<span class="c-num">1</span>].css(<span class="c-str">"div.MX5RWe span.Xsgmwe"</span>)
             <span class="c-key">if</span> <span class="c-str">"sI2Nye"</span> <span class="c-key">not in</span> s.attrib.get(<span class="c-str">"class"</span>, <span class="c-str">""</span>)
             <span class="c-key">and</span> <span class="c-str">"QS0io"</span> <span class="c-key">not in</span> s.attrib.get(<span class="c-str">"class"</span>, <span class="c-str">""</span>)
             <span class="c-key">and</span> s.attrib.get(<span class="c-str">"jsname"</span>) != <span class="c-str">"Pvlywd"</span>]
    flights.append({
        <span class="c-str">"airline"</span>: first(<span class="c-str">r"flight with (.+?)\."</span>, label),
        <span class="c-str">"flight_number"</span>: <span class="c-str">" "</span>.join(number.groups()) <span class="c-key">if</span> number <span class="c-key">else</span> <span class="c-key">None</span>,
        <span class="c-str">"departure_airport"</span>: airport(legs[:<span class="c-num">1</span>], <span class="c-str">"div.ZHa2lc"</span>),
        <span class="c-str">"arrival_airport"</span>: airport(legs[-<span class="c-num">1</span>:], <span class="c-str">"div.FY5t7d"</span>),
        <span class="c-str">"stops"</span>: stops,
        <span class="c-str">"price"</span>: first(<span class="c-str">r"From (\d[\d,]*) \w+ dollars"</span>, label) <span class="c-key">or</span> <span class="c-str">"0"</span>,
        <span class="c-str">"currency"</span>: <span class="c-str">"USD"</span>,
        <span class="c-str">"plane_model"</span>: model[-<span class="c-num">1</span>] <span class="c-key">if</span> model <span class="c-key">else</span> <span class="c-key">None</span>,
        <span class="c-str">"legroom"</span>: first(<span class="c-str">r"legroom\s*\((\d+ in)\)"</span>,
            <span class="c-str">" "</span>.join(legs[:<span class="c-num">1</span>].css(<span class="c-str">"li.WtSsrd ::text"</span>).getall())),
    })
print(json.dumps(flights, indent=<span class="c-num">2</span>, ensure_ascii=<span class="c-key">False</span>))
```

 

 



What the data is used for

## // Common Google Flights scraping use cases

### Fare tracking

Record the price of the routes and dates you watch, search after search.



### Fare alerts

Spot when a route drops below the price you care about, or when Google rates its price low.



### Airline price comparison

Compare your fares with other airlines' on the same route and day.



### Route and schedule research

See which airlines fly a route nonstop, at what times and on which aircraft.



### Travel date research

Read the price calendar to see which departure and return dates cost more.



### Fares for AI travel agents

Give an agent current fares and schedules for the trip it is planning.



 



Common questions

## // Google Flights scraping FAQ

 Is scraping Google Flights legal?

There is no universal answer. Legality depends on your jurisdiction, the data, the access method and how you use the result. Keep the workflow to public search results, stay signed out, review Google's terms of service, and get legal advice for commercial use.

 Does Google Flights have an API?

Google's developer site has partner integration specifications for Google Flights Search, for the airlines and online travel agencies whose booking options Google Flights links to, and Google shares them under a non-disclosure agreement with select, invite-only partners. These requests read the public Google Flights results page, so you need a Scrapfly API key, not a Google partnership.

 How do I build a Google Flights search URL?

Write the trip in words in the `q` parameter, as the scraper does: `Flights from JFK to CDG on 2027-01-20 through 2027-01-27` for a round trip, or `one way flights from JFK to LHR on 2027-01-20` for a one-way search. The scraper adds `hl=en` and `curr=USD`, for the English labels and the prices in dollars its parser reads.

 Why does each flight appear twice in the HTML?

The results page also holds a hidden copy of the result list, for another sort tab, so a flight card can appear twice in the HTML. The scraper keeps one card per `aria-label`, and its browser scenario opens the details of the visible flights only.

 How do I get price insights and the price calendar?

Call `scrape_price_insights`: its browser scenario opens the price history panel of the search, then scrolls through the departure dates. The scraper reads the best booking window, the price level, the typical price range and the savings from the page, and the price of each departure and return date pair from the page's `GetCalendarGrid` background calls, which Scrapfly records under `browser_data` when it renders the page.

 Do I need a Google account?

No. The open-source scraper reads public Google Flights search results without signing in. You only need a Scrapfly API key.

 How much does scraping Google Flights cost?

A Google Flights search fetched as the scraper fetches it, with the Unblocker, residential proxies and a browser, costs 30 credits: 25 for the residential proxy and 5 for the browser, which includes 3 MB of bandwidth. Past that, residential bandwidth costs 10 credits per 100 KB. The Unblocker has no flat fee, but a protected target can add its own, and the scrape log shows the cost. The scraper's flights and its price insights are one request each. An extraction prompt adds 5 credits, and 5 more for each 500 KB of page past the first 500 KB, and a Screenshot API capture costs 60 credits by default. The Free plan includes 1,000 credits a month.

 What are the rate limits when scraping Google Flights?

Your maximum parallelism is the concurrency quota of your plan, from 5 requests at once on the Free plan to 100 on Enterprise, or a lower limit set on the project. Each request counts against it while it is in flight.

 



Start with one request

## Send the route. Read the fares.

Web Scraping API with the Unblocker, residential proxies and a browser, one call per Google Flights search.

Proxies across 75+ countries

 [Google Flights scraper on GitHub](https://github.com/scrapfly/scrapfly-scrapers/tree/main/google-flights-scraper) [How to scrape Google Flights](https://scrapfly.io/blog/posts/how-to-scrape-google-flights) [Skyscanner Scraper API](https://scrapfly.io/scrapers/skyscanner) [All scraper pages](https://scrapfly.io/scrapers) 

 

 [Get free API key](https://scrapfly.io/register) [Read the docs](https://scrapfly.io/docs/scrape-api/unblocker)