Skip to main content
Glama

Flight Fares API: Google Flights Search & Deals

search_flights
Read-only

Search flight prices for routes and departure dates, compare airlines, times, stops, and typical route costs, and find the cheapest day to fly with multi-date searches.

Instructions

Flight prices from Google Flights for a route and one or several departure dates: airlines, times, stops, price, and the typical price range of the route. Use numberOfDates with cheapestOnly to find the cheapest day to fly. Pay per result on your Apify account: run start $0.005, flight delivered $0.003.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "search_flights"
  }
}

Input Schema

NameRequiredDescriptionDefault
adultsNoNumber of adult passengers. Prices are totals for all passengers.
routesNoOrigin and destination as 3-letter airport or city codes, e.g. "CDG-BCN", "PAR-LIS" (all Paris airports), "LON-NYC". Names of major cities work too: "Paris-Tokyo", "New York to London". You can also paste a Google Flights search URL (one way or round trip): its dates, passengers and cabin are used as they are.
currencyNoCurrency of all prices.
maxStopsNoMaximum number of stops.
cabinClassNoTravel class.
cheapestOnlyNoOne flight per route and date: the cheapest. Ideal for price calendars and alerts (fewer items, lower cost).
departureDateNoFirst departure date (YYYY-MM-DD). Default: in 30 days.
numberOfDatesNoSearch several departure dates in a row, e.g. 30 = every day of the next month, to find the cheapest day to fly.
tripLengthDaysNo0 = one way. For example 7 = return one week after each departure date.
daysBetweenDatesNo1 = every day, 7 = same weekday every week.
maxFlightsPerSearchNoGoogle's best flights come first, then other flights. Default here: 5.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.1.3
    • changedInput schema / properties / routes / description
      Previous value: -"Origin and destination as 3-letter airport or city codes, e.g. \"CDG-BCN\", \"PAR-LIS\" (all Paris airports), \"LON-NYC\"."New value: +"Origin and destination as 3-letter airport or city codes, e.g. \"CDG-BCN\", \"PAR-LIS\" (all Paris airports), \"LON-NYC\". Names of major cities work too: \"Paris-Tokyo\", \"New York to London\". You can also paste a Google Flights search URL (one way or round trip): its dates, passengers and cabin are used as they are."
  2. First observedv0.1.2

TDQS

A3.9/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover the safety profile (readOnlyHint, openWorldHint), and the description adds genuinely new behavior: per-result billing ($0.005 per run start, $0.003 per flight delivered), that cheapestOnly lowers cost by returning fewer items, and that Google returns its 'best' flights first before others. It stops short of describing pagination or result caps beyond the default of 5 per search.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences: capability and return fields first, the key parameter combination second, cost model last. No filler, and the most decision-relevant information is front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 11-parameter, zero-required, read-only search tool with no output schema, the description covers purpose, a non-obvious parameter pairing, and cost implications. Missing are notes on defaults or limits for the many optional parameters, but the schema itself already carries those.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description earns an extra point by describing a cross-parameter interaction (numberOfDates + cheapestOnly) that the schema documents only in isolation. It does not, however, add anything about routes/tripLengthDays/daysBetweenDates combinations that the schema doesn't already say.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource — flight prices from Google Flights for a route and one or more departure dates — and enumerates the returned fields (airlines, times, stops, price, typical price range). It is clear enough to act on, but it never contrasts itself with the adjacent fare tool (find_ryanair_fares), so sibling differentiation is left to the reader.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is one concrete usage hint: pair numberOfDates with cheapestOnly to find the cheapest day to fly. Beyond that, the description gives no explicit when-to-use/when-not-to-use framing and no mention of alternatives for single-date vs multi-date or one-way vs return searches, leaving usage context implied.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.