Find the cheapest day to fly with a Google Flights price tracker (Python + n8n)
Google Flights has a date grid with a fare for every departure day, and a "track prices" toggle that emails you when its pick of dates moves. Both are fine for one trip. Neither gives you the table: every day, the fare, the airline and stops behind it, in rows you can sort, keep and put a threshold on. If your dates are flexible and you want the cheapest day to fly as data — or airfare price…
Google Flights offers a date grid displaying fares for every departure day, accompanied by a price tracking feature that sends emails when the cheapest dates change. While these features work well for individual trips, they do not provide a comprehensive table of daily fares, airlines, and layovers that can be sorted, saved, and filtered based on a budget.
For travelers with flexible dates seeking the cheapest day to fly and airfare price tracking that updates daily, a more robust solution is required. This involves extracting one row per departure day from Google Flights in JSON format without the need for an API key, and transforming this data into a flight price alert. The Flight Price Tracker on Apify accomplishes this by taking flight routes, a first departure date, and a window length, searching Google Flights for each day, and ranking the days based on their cheapest itineraries.
A 30-day window for a single route yields at most 30 fare entries plus a free status row. By making a POST request to the Apify API, one can initiate a sync run that returns a fare row for each day, including details such as airline, departure and arrival times, duration, price in USD, and a direct link to the fare on Google Flights.
This fare row has a boolean field, cheapest_in_window, set to true for the cheapest day in the given window, which helps in identifying the optimal travel date. For round trips, setting the tripLengthDays parameter to 7 allows the system to calculate prices for both legs of the journey. Once the data is obtained, a simple filter based on a maximum price threshold can be applied to generate alerts whenever the cheapest fare falls within the desired budget.
This approach, which is implemented in Python using the Apify API client library, allows users to store their own price history, providing a comprehensive record of fare trends without relying on a third-party API key.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.
This story
This is one outlet's version. Read the fullest account.