Scrape Google Flights Calendar: How to Find the Cheapest Dates to Fly SerpApi released a Google Flights Calendar API that returns per-date airfare prices as structured JSON or Markdown, with one entry per date in the requested range. On a test route from Paris Charles de Gaulle (CDG) to Austin-Bergstrom (AUS), a 7-day round trip cost $1,201 departing November 29 versus $757 departing December 2, and the API flags a date with low_price: true when its fare is within 5% of the lowest price in the range. The API defaults to round trips of 7 days spanning today through the end of next month, prices in USD, and is aimed at travel apps, fare alerts, and AI travel agents that need a cheapest-date lookup. When travelers have flexible dates or travel agencies are planning trips for clients, the first question isn’t “which flight?” but “which day is the cheapest?” Google Flights answers that with a calendar of prices showing one fare per date. On our test route, a 7-day round trip from Paris to Austin cost $1,201 leaving on November 29 and $757 leaving on December 2. If you’re building tools for these users such as a travel app, a fare alert, or an AI travel assistant, that per-date price view is often the most useful piece of flight data. SerpApi's Google Flights Calendar API https://serpapi.com/google-flights-calendar-api returns those calendar prices as structured JSON or Markdown. It consists of one entry per date, with the price for that day. You can use it to: - Show a flexible-date price grid in your app: Let users pick the cheapest day before they choose a flight. - Track a route's cheapest dates over time: Run the same request on a schedule and alert users when a low fare appears. - Give an AI travel agent a "when should I fly?" tool: Return the cheapest dates for a route in one request. In this tutorial, you'll try the API in the playground and make your first request with cURL, Python, and JavaScript. Then you'll change the date range, trip type, and currency, and pass the cheapest date to the Google Flights API to see the actual flights. What data can you retrieve with the Google Flights Calendar API? The response centers on one array, prices , with one entry for each date in the requested range. - Departure date: outbound date , the day the trip starts. - Return date: return date , included for round trips the default trip type . - Price: price , a whole number in the selected currency. It defaults to USD. - Low-price flag: low price appears as true when a price is within 5% of the lowest price in the requested date range. By default, the date range runs from today to the end of next month, and round trips last 7 days . See the Google Flights Calendar API documentation https://serpapi.com/google-flights-calendar-api for every field and parameter. How to scrape the Google Flights Calendar Try it in the playground Open the SerpApi Playground https://serpapi.com/playground?engine=google flights calendar&departure id=CDG&arrival id=AUS with the google flights calendar engine. This link searches round trips from Paris Charles de Gaulle CDG to Austin-Bergstrom AUS . We'll use this route in every example below. Run the search and look at the prices array. Each entry pairs an outbound date and return date with a price . To spot the cheapest days, looks for entries with "low price": true . If you want different dates, pick your own start and end dates in the playground's date range fields. departure id and arrival id take an uppercase 3-letter airport code, such as CDG or AUS . They also accept a location kgmid, such as /m/0vzm for Austin, TX, if you want to search from a city rather than one airport. Get your API key Create a SerpApi account https://serpapi.com/users/sign up , then copy your private key from the API key page https://serpapi.com/manage-api-key . Set it as an environment variable so your code can read it: export SERPAPI API KEY="YOUR SERPAPI API KEY" Replace YOUR SERPAPI API KEY with your own key on your machine. Keep it private, and don't commit it to a repository. Make a GET request Besides your API key, the Google Flights Calendar API needs three parameters: engine=google flights calendar , departure id , and arrival id . The response is JSON by default: https://serpapi.com/search?engine=google flights calendar&departure id=CDG&arrival id=AUS&api key=YOUR SERPAPI API KEY To get Markdown instead, add output=md : https://serpapi.com/search?engine=google flights calendar&departure id=CDG&arrival id=AUS&output=md&api key=YOUR SERPAPI API KEY Markdown works well when you pass results to an LLM or AI agent, because it's compact and easy to read. Use JSON when your code needs exact values, such as a price for a specific date. Read more in the Markdown output documentation https://serpapi.com/markdown-output . cURL implementation Here's the same request with cURL. It reads your key from the environment variable you set earlier: curl --get https://serpapi.com/search \ -d engine="google flights calendar" \ -d departure id="CDG" \ -d arrival id="AUS" \ -d api key="$SERPAPI API KEY" - engine=google flights calendar selects the Google Flights Calendar API. - departure id and arrival id set the route. - api key authenticates the request. Python implementation Install the official SerpApi Python library https://serpapi.com/integrations/python : pip install serpapi Create a file named main.py : python import os import sys import serpapi client = serpapi.Client api key=os.environ "SERPAPI API KEY" results = client.search { "engine": "google flights calendar", "departure id": "CDG", "arrival id": "AUS", } if "error" in results: sys.exit f"Google Flights Calendar API: {results 'error' }" prices = results.get "prices", if not prices: sys.exit "No prices were returned for this route and date range." for day in prices: marker = " <- low price" if day.get "low price" else "" print f"{day 'outbound date' } to {day.get 'return date' } | ${day 'price' }{marker}" cheapest = min prices, key=lambda day: day "price" print f"\nCheapest: {cheapest 'outbound date' } to {cheapest.get 'return date' } for ${cheapest 'price' }" Run it: python main.py The script prints each outbound and return date with its price, marks the low-price days, and ends with the cheapest pair of dates. Prices are in USD because that's the default currency. If the request fails, the response includes an error message, and the script prints it and stops. An empty prices array gets its own message, so "no prices for this route" never looks like a failed request. In the example above, the cheapest calendar price $757 matched the top best flights price for those dates. Export results to CSV Each date is one row, so the calendar fits neatly into a spreadsheet. Add import csv at the top of main.py , then add this to the end. It reuses the prices variable from the request above: with open "flight calendar prices.csv", "w", newline="", encoding="utf-8" as file: writer = csv.writer file writer.writerow "outbound date", "return date", "price", "low price" for day in prices: writer.writerow day.get "outbound date" , day.get "return date" , day.get "price" , day.get "low price", False , return date is empty for one-way trips, and low price is written as False when the flag isn't present. Look up flights for the cheapest date The calendar tells you when to fly. To see which flights are available on that date, pass the cheapest dates to the Google Flights API https://serpapi.com/google-flights-api as outbound date and return date . Add this to the end of main.py . It reuses client and cheapest from above: flights = client.search { "engine": "google flights", "departure id": "CDG", "arrival id": "AUS", "outbound date": cheapest "outbound date" , "return date": cheapest "return date" , } for option in flights.get "best flights" or flights.get "other flights", : print option.get "price" , "-", option.get "total duration" , "min" This is a second search. Our Google Flights tutorial https://serpapi.com/blog/how-to-scrape-google-flights/ covers that response in detail. JavaScript implementation Install the official SerpApi JavaScript library https://github.com/serpapi/serpapi-javascript/ : npm install serpapi Create a file named main.js : async function main { const { getJson } = await import "serpapi" ; const apiKey = process.env.SERPAPI API KEY; if apiKey { throw new Error "Set the SERPAPI API KEY environment variable first." ; } const results = await getJson { engine: "google flights calendar", departure id: "CDG", arrival id: "AUS", api key: apiKey, } ; if results.error { throw new Error Google Flights Calendar API: ${results.error} ; } const prices = results.prices ?? ; if prices.length === 0 { console.log "No prices were returned for this route and date range." ; return; } for const day of prices { const marker = day.low price ? " <- low price" : ""; console.log ${day.outbound date} to ${day.return date} | $${day.price}${marker} ; } const cheapest = prices.reduce low, day = day.price < low.price ? day : low ; console.log \nCheapest: ${cheapest.outbound date} to ${cheapest.return date} for $${cheapest.price} ; } main .catch error = { console.error error.message ; process.exitCode = 1; } ; Run it: node main.js You'll see the same dates, prices, and cheapest pair as in the Python example. Other languages and no-code options SerpApi also has official libraries for other programming languages. Browse them on the integrations page https://serpapi.com/integrations . If you'd rather not write code, you can call the Google Flights Calendar API from automation tools: - Make.com: Google APIs are called through the Universal "Make an API Call" module in SerpApi's Make.com app https://serpapi.com/blog/announcing-serpapis-make-app/ . Set the URL to /search.json and add engine=google flights calendar , departure id , and arrival id as query parameters. - n8n: SerpApi's verified n8n node https://serpapi.com/blog/boost-your-n8n-workflows-with-serpapis-verified-node/ includes the Google Flights API, but its listed APIs don't include the calendar engine. Use n8n's HTTP Request node with your SerpApi credentials and set engine=google flights calendar . Customize or filter the results Three groups of parameters shape the calendar: - date range start and date range end : Set the dates to price, in YYYY-MM-DD format. date range start defaults to today, and date range end defaults to the end of next month. - type , round trip days , and fixed outbound date : type is 1 for round trip default or 2 for one way. For round trips, round trip days sets the trip length default 7 . Alternatively, set fixed outbound date=true to depart on date range start and get a price for each return date instead. You can't combine round trip days and fixed outbound date , and both apply only to round trips. - currency : Returns prices in another currency. It defaults to USD. This example prices 10-day round trips with departure dates from 30 to 90 days from today. It computes the dates at runtime, so they never go stale: python import os from datetime import date, timedelta import serpapi client = serpapi.Client api key=os.environ "SERPAPI API KEY" start = date.today + timedelta days=30 end = start + timedelta days=60 results = client.search { "engine": "google flights calendar", "departure id": "CDG", "arrival id": "AUS", "date range start": start.isoformat , "date range end": end.isoformat , "round trip days": 10, } for day in results.get "prices", : print day "outbound date" , day.get "return date" , day "price" For a one-way trip priced in another currency, set type and currency . This request prices one-way flights from Karachi KHI to Islamabad ISB in Pakistani rupees: https://serpapi.com/search?engine=google flights calendar&departure id=KHI&arrival id=ISB&type=2¤cy=PKR&api key=YOUR SERPAPI API KEY One-way entries have no return date . You can also set travel class 1 Economy to 4 First and passenger counts adults , children , infants in seat , infants on lap . See the documentation for the full list. Conclusion You can now get prices for every date on a route with the Google Flights Calendar API, spot low-price days, and export the calendar to CSV. You can also change the date range, trip type, and currency, and pass the cheapest date to the Google Flights API to see the actual flights. The same request works in cURL, Python, and JavaScript, and it returns Markdown when you're feeding results to an LLM. Next, open the Google Flights Calendar API playground https://serpapi.com/playground?engine=google flights calendar&departure id=CDG&arrival id=AUS and try a route you care about. For more ways to work with flight data, see these tutorials: - How to Scrape Google Flights https://serpapi.com/blog/how-to-scrape-google-flights/ : Get flights, prices, and price insights for specific dates. - How to Scrape Google Flights Deals with a simple API https://serpapi.com/blog/how-to-scrape-google-flights-deals/ : Find discounted fares from a departure city. - Making a Flight Price Tracker with Google Flights and Make.com https://serpapi.com/blog/making-a-flight-price-tracker-with-google-flights-and-make-com/ : Track a route's prices without writing code. - How to Scrape Flightradar24’s Live Flights https://serpapi.com/blog/how-to-scrape-flightradar24/ : Track aircraft in real time, with their position, altitude, and speed. - How to Scrape Google Hotels https://serpapi.com/blog/scraping-google-hotels/ : Find hotel prices for the trip once your dates are set. Frequently asked questions What's the difference between the Google Flights API and the Google Flights Calendar API? The Google Flights API https://serpapi.com/google-flights-api returns the flights for specific dates, including airlines, times, layovers, and prices. The Google Flights Calendar API returns one price per date across a range, so you can find the cheapest dates first. Use the calendar to choose dates, then the Google Flights API to choose a flight. Which dates does the API cover by default? From today to the end of next month. Set date range start and date range end in YYYY-MM-DD format to price a different range. What does low price mean? low price is true when a date's price is within 5% of the lowest price in the requested date range. It's a quick way to highlight the cheapest days without comparing every price yourself. Can I search from a city instead of a specific airport? Yes. departure id and arrival id accept a location kgmid, a string that starts with /m/ . For example, /m/0vzm is Austin, TX. Can I get the results in Markdown for an LLM? Yes. Add output=md to your request to get a compact Markdown version of the results. JSON remains the default and works better when your code needs exact values.