10 min read
How to scrape flight prices
Get fares as JSON with airline, times, stops and price from Kayak, Skyscanner and airline sites.
| Site | Route | Flight | Fare |
|---|---|---|---|
| Google Flights | JFK → LAX | Delta, nonstop | $204 |
| Google Flights | JFK → LAX | JetBlue, 1 stop | $184 |
| Google Flights | JFK → LAX | American, nonstop | $319 |
| Google Flights | JFK ⇄ LAX | Delta, round trip | $418 |
| Kayak | LGA → LAX | Frontier, 1 stop | $190 |
| Skyscanner | EWR → LAX | Frontier, 1 stop | £78 |
The String Web Access API is the best way to scrape flight prices. It returns any airline or travel page, or just its fares as JSON with airline, times and price. In our October 2026 benchmark it returned 98.6% of requests across 100 bot-protected sites, the most of 17 providers, and 44 of 45 attempts on the 9 travel sites, including every attempt on Expedia, Kayak and aa.com.
Quickstart
Add the hosted MCP server to Claude, Cursor, ChatGPT or any MCP client. Then give your agent a flight search URL. It calls the web_access_fetch tool and reads the fares.
https://mcp.usestring.ai/v3/mcp
One call returns the flights on a Google Flights search page as JSON. If extraction can't fill the required fields, you get "extracted": false back instead of a guess.
curl https://request.usestring.ai/v1/fetch \
-H "Authorization: Bearer $STRING_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://www.google.com/travel/flights?q=Flights%20to%20LAX%20from%20JFK%20on%202026-11-12%20oneway&hl=en&gl=us&curr=USD",
"countryCode": "US",
"jsonSchema": {
"type": "object",
"properties": {
"flights": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"properties": {
"airline": { "type": "string" },
"depart": { "type": "string" },
"arrive": { "type": "string" },
"stops": { "type": "integer" },
"price": { "type": "number" }
},
"required": ["airline", "depart", "arrive", "price"]
}
}
},
"required": ["flights"]
}
}'Response (first 3 of 34 flights)
{
"flights": [
{
"airline": "Delta",
"depart": "2026-11-12T14:00",
"arrive": "2026-11-12T17:16",
"stops": 0,
"price": 204
},
{
"airline": "Delta",
"depart": "2026-11-12T15:20",
"arrive": "2026-11-12T18:33",
"stops": 0,
"price": 204
},
{
"airline": "JetBlue",
"depart": "2026-11-12T15:29",
"arrive": "2026-11-12T18:46",
"stops": 0,
"price": 204
}
]
}Why scrape flight prices?
Airfares change many times a day, and the free official flight APIs have mostly closed. A flight price scraper checks the same routes and dates on a schedule and records what each one costs. It answers these questions:
- What does this route cost today? Travel apps, fare alert products and corporate travel teams need the current price, not last week's.
- Is the fare going up or down? A daily series per route and date shows when prices drop and how far ahead people should book.
- Who sells it cheapest? The same flight is often sold by the airline and by several travel agencies at different prices.
What you can collect
Fares
The price for every passenger, one way or round trip, in the currency of the market you search from.
Schedules
Airline, flight numbers, departure and arrival times, duration, stops and layover airports.
Sellers
Each airline or travel agency that sells an itinerary, with its fare family and price.
Fare calendars
The lowest price for every departure date in a range, for spotting the cheapest days to fly.
Why does flight price scraping break?
- Airline and travel sites block scrapers. In our October 2026 benchmark, 11 of the 16 other scraping APIs couldn't fetch skyscanner.net on every attempt, including Apify (0 of 5), Zyte (2 of 5) and Bright Data (3 of 5). On aa.com, 14 of 16 fell short, including Firecrawl (0 of 5) and Bright Data (1 of 5). Browserbase got 0 of 5 on 7 of the 9 travel sites. String got all 5 on 8 of the 9 and 4 of 5 on skyscanner.net. Context.dev got all 5 on all 9.
- The price depends on where you search from. Fares and currency change with the country of the search. skyscanner.net quoted New York to Los Angeles in pounds for the UK market, even through a US connection.
- Many prices on the page are old. Kayak's New York to Los Angeles route page leads with $190, which it says is the cheapest fare a Kayak user found in the last 72 hours. Store it as a live fare and your data is days out of date.
Why do teams choose String?
- It fetches the most pages. String returned 98.6% of requests across 100 bot-protected sites in our October 2026 benchmark, the most of 17 providers, and 44 of 45 attempts on the 9 travel sites in it.
- You choose the country. Set
countryCodeto send each request from one country, so every run in a series sees the same market. - Google Flights comes back as rows. The Google Flights integration returns live searches, round trips, date calendars and every seller's price as typed JSON.
- You pay only for pages that come back. Blocks and errors are free.
How do I scrape flight prices?
Pick your sources
Metasearch sites like Google Flights, Kayak and Skyscanner show many airlines on one page, so they cost the fewest requests per route. Airline sites like aa.com show the airline's own fares. Online travel agencies like Expedia show what resellers charge.
With String: Fetch any of them by URL. For Google Flights, the site integration returns each search as typed rows.
Fix the country and currency
Pick one country and one currency for each price series and never change them. Google Flights takes them in the URL as
glandcurr. Each Skyscanner and Kayak domain serves its own market, so skyscanner.net quotes UK prices in pounds.With String: Set
countryCodeon every request. The Google Flights integration also takescountry, which sets the point of sale, andcurrency.Tell live fares from cached ones
A dated search shows the price for that day. Route and deal pages often show prices other people found earlier: Kayak's route page labels its headline fare as found in the last 72 hours. Use cached prices for trends, and dated searches for the price of a flight.
Read round-trip prices as the whole trip
On a round-trip search, each outbound flight shows the price of the whole trip. The same Delta nonstop from JFK to LAX on November 12 showed $204 one way and $418 round trip. Save the trip type, dates and number of passengers with every price, or you will compare one-way and round-trip fares as if they were the same.
With String: The Google Flights integration's
return-flightsaction lists the return flights for a chosen outbound flight, each priced for the round trip.Treat a blank page as a failure
Count the fares on every page. A Kayak dated search came back as a 200 with no fares, because Kayak loads them with JavaScript. A Google Flights search from the UK came back as a 200 with no fares at all. Flag the page and keep the last good run, so a route doesn't look sold out because one page failed.
With String: Mark the fare list as required with at least one item. A page without fares comes back as
"extracted": false. SetexecuteJSfor sites that load fares with JavaScript.Match the same flight across sellers
Match on flight number and date, not on airline name. One flight can be sold by its airline and by travel agencies, and under partner airlines' flight numbers too.
With String: The Google Flights integration returns each leg's flight number and codeshares. Its
booking-optionsaction lists every seller of an itinerary with its fare family and price.Track prices on a schedule
Check each route and date once a day to build a fare history. Store the time you checked in your own code. Check more often only for routes where you must react to a change within hours.
With String: The Google Flights
calendaraction prices every departure date in a range of up to 180 days in one call.
Get a free sample of fare data
Tell us which routes, dates and sites you track. We'll run String on them and email you a sample of the fare data, free.
| Site | Route | Flight | Fare |
|---|---|---|---|
| Google Flights | JFK → LAX | Delta, nonstop | $204 |
| Google Flights | JFK → LAX | JetBlue, 1 stop | $184 |
| Google Flights | JFK → LAX | American, nonstop | $319 |
| Google Flights | JFK ⇄ LAX | Delta, round trip | $418 |
| Kayak | LGA → LAX | Frontier, 1 stop | $190 |
| Skyscanner | EWR → LAX | Frontier, 1 stop | £78 |
Frequently asked questions
What's the best way to scrape flight prices?
Fetch dated search pages for a fixed list of routes and dates, from one country and in one currency, once a day. Metasearch sites like Google Flights cover the most airlines per request. The hard part is getting the pages at all, because airline and travel sites block most scrapers. The String Web Access API returned 44 of 45 attempts on the 9 travel sites in our October 2026 benchmark, and 98.6% of requests across 100 bot-protected sites, the most of 17 providers.
How do I scrape Google Flights?
Google closed its QPX Express flight API in 2018, so you read the search pages. Fetch a search URL with the route and date in the q parameter and fix gl and curr. The fares are in the first HTML, so no browser is needed. Or call String's Google Flights integration, which returns one-way and round-trip searches, return flights, a date calendar and booking options as typed JSON. Our Python guide to scraping flight prices walks through a full script.
How much does it cost to track flight prices every day?
Checking 20 routes on 30 dates every day is 18,000 requests a month. At the standard rate on the Starter plan ($19 a month, $0.25 per 1,000) that's $4.50 in usage. Every Google Flights, Kayak, Skyscanner and aa.com page we fetched for this guide was billed at the standard rate. Pages that need a real browser bill at browser rates, $1.20 per 1,000 on standard proxies and $4.80 on premium. Structured extraction adds a fee per request. See pricing. Failed requests aren't billed.
Is it legal to scrape flight prices?
Prices are facts, and facts aren't protected by copyright. Airlines have still sued. Ryanair won a jury verdict against Booking.com in 2024 over scraping ryanair.com, and the court overturned it in 2025 because Ryanair hadn't proved its losses. Read public search pages while logged out, read each site's terms, keep your request rate reasonable, and check with your counsel. We go through the case law in Is web scraping legal?
How do I avoid getting blocked on airline and travel sites?
Send each request to String instead of the site. Proxy rotation, browser fingerprints, captcha solving and retries happen behind the endpoint, and JavaScript rendering is switched on per request for pages that need it. Requests that still fail aren't billed.
Why does the same flight show different prices?
Fares change with the country and currency of the search, the trip type, the number of passengers and the seller. A round-trip search shows the whole trip's price on each outbound flight. A route page may show a price someone found days ago. Fix the country, currency, trip type and passengers for each series, and store the seller with the price.
Can I scrape Kayak or Skyscanner?
Yes, String can scrape Kayak and Skyscanner. In our benchmark String got all 5 attempts on kayak.com and 4 of 5 on skyscanner.net. Browserbase got 0 of 5 on both. Both sites' route pages came back with plain requests. Kayak's dated search pages load their fares with JavaScript, so set executeJS on those. skyscanner.net serves the UK market in pounds.
Can I get prices from every site that sells a flight?
Yes, on Google Flights. Pass a flight's selectionToken from a search to the Google Flights integration's booking-options action. It lists each airline or travel agency that sells the itinerary, with its fare family, price and booking site.
Does String work on the travel sites I need?
Send us the routes and URLs and we'll run them and show you what comes back before you commit. Ask for a free sample of fare data, or test them yourself with your first 20,000 free standard fetches.