Dev.to WebDev 🛠 Dev 👁 0 📖 4 min read

I checked Google Flights' calendar prices against full searches, and 10 of 10 matched

I build a small Google Flights API, and this week I wanted to settle one question. When Google's date calendar says a trip costs $627 on a given day, does a real search for that day agree? It matters because the calenda

I build a small Google Flights API, and this week I wanted to settle one question. When Google's date calendar says a trip costs $627 on a given day, does a real search for that day agree?

It matters because the calendar is the cheap read. One request gives you a whole month of prices, while a full search prices one date pair at a time and takes longer (in my runs today the month took 1 to 5 seconds, a single full round-trip search 5 to 32 seconds). If the calendar holds up, you scan with it and only run the full search on the date you actually pick.

The test

Three round trips in March 2027, one adult, prices in USD:

  • New York JFK to Lisbon, 7 nights
  • London Heathrow to Barcelona, 4 nights
  • Los Angeles to Mexico City, 5 nights

For each route I read the calendar for the whole month (31 departure dates, all 31 came back priced), then ran a full round-trip search on three of those dates: the cheapest, one from the middle and the most expensive. I had already checked one extra JFK to Lisbon date while testing the call, so that's 10 checks. Everything ran on 19 November 2026 between 07:02 and 07:05 UTC.

The result

Route Calendar, whole month Date checked Calendar Full search
JFK → LIS, 7 nights $627 to $747 Mar 1 → Mar 8 $627 $627
Mar 3 → Mar 10 $627 $627
Mar 15 → Mar 22 $716 $716
Mar 20 → Mar 27 $747 $747
LHR → BCN, 4 nights $83 to $285 Mar 8 → Mar 12 $83 $83
Mar 19 → Mar 23 $132 $132
Mar 25 → Mar 29 $285 $285
LAX → MEX, 5 nights $289 to $367 Mar 1 → Mar 6 $289 $289
Mar 6 → Mar 11 $334 $334
Mar 28 → Apr 2 $367 $367

All 10 matched to the dollar. "Full search" here is the cheapest of the rows the round-trip search returned for that exact date pair.

The other thing the table shows is why it's worth scanning at all: London to Barcelona went from $83 to $285 inside one month, more than three times the price for the same 4-night trip.

A few honest notes before anyone builds on this:

  • 10 checks, on busy routes, a few minutes after reading the calendar. Fares move during the day, so the longer you wait between the calendar and the search, the more room there is for a gap. I'd always confirm the date before showing someone a price.
  • The calendar is a number per date and nothing else: no airline, no times, no stops. The full search has all of that (the $627 JFK to Lisbon trip on March 3 was a TAP / JetBlue nonstop).
  • I only tested adults. A party with children prices differently and I left it out of this run.

The call

One request for the whole month. This is the shape of it on RapidAPI:

curl -X POST "https://google-flights-live-api.p.rapidapi.com/api/google_flights/cheapest_dates/v1" \
  -H "Content-Type: application/json" \
  -H "x-rapidapi-host: google-flights-live-api.p.rapidapi.com" \
  -H "x-rapidapi-key: $RAPIDAPI_KEY" \
  -d '{"from_airport":"JFK","to_airport":"LIS","month":"2027-03","nights":7,"currency":"USD"}'

And what came back for JFK to Lisbon (first 3 of 31 dates):

{
  "from_airport": "JFK",
  "to_airport": "LIS",
  "trip_type": "roundtrip",
  "nights": 7,
  "adults": 1,
  "currency": "USD",
  "fetched_at": "2026-11-19T07:02:12Z",
  "dates_searched": 31,
  "dates_with_price": 31,
  "cheapest": { "departure_date": "2027-03-01", "return_date": "2027-03-08", "price": 627.0 },
  "dates": [
    { "departure_date": "2027-03-01", "return_date": "2027-03-08", "price": 627.0 },
    { "departure_date": "2027-03-02", "return_date": "2027-03-09", "price": 679.0 },
    { "departure_date": "2027-03-03", "return_date": "2027-03-10", "price": 627.0 }
  ]
}

Drop nights and you get a one-way calendar instead. You can also send departure_date_from / departure_date_to for any range up to 61 days instead of a month.

Scan with the calendar, confirm with a full search

This is the whole pattern in a few lines of Node (18+, built-in fetch):

const HOST = "google-flights-live-api.p.rapidapi.com";
const headers = {
  "Content-Type": "application/json",
  "x-rapidapi-host": HOST,
  "x-rapidapi-key": process.env.RAPIDAPI_KEY,
};

async function post(path, body) {
  const res = await fetch(`https://${HOST}${path}`, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
  });
  if (!res.ok) throw new Error(`${path} answered ${res.status}`);
  return res.json();
}

// 1. One request: the whole month
const cal = await post("/api/google_flights/cheapest_dates/v1", {
  from_airport: "JFK",
  to_airport: "LIS",
  month: "2027-03",
  nights: 7,
  currency: "USD",
});
const { departure_date, return_date, price } = cal.cheapest;
console.log(`Calendar says ${departure_date} -> ${return_date} at $${price}`);

// 2. One more request: the full search for that date pair only
const rows = await post("/api/google_flights/roundtrip/v1", {
  from_airport: "JFK",
  to_airport: "LIS",
  departure_date,
  return_date,
  currency: "USD",
});
const best = rows.reduce((a, b) =>
  b.total_price_as_number < a.total_price_as_number ? b : a
);
console.log(
  `Full search: $${best.total_price_as_number}, ` +
  `${best.departure_flight_airline}, ${best.total_stops} stops`
);
console.log(best.buy_link);

Two requests instead of 31, and the second one gives you the airline, the times and a link to book.

If the two prices ever disagree, trust the full search: it's the one that reflects the actual flights on sale right now.

Disclosure: I built the API used here (FlightPowers), and the docs for the cheapest dates endpoint have the full field list and error codes. An AI agent I run wrote and published this post, and the numbers in it come from the calls described above, which I saved as raw responses.

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.