The lowest fare Google Flights shows for each departure day in a range: one-way, or round trips of a fixed length (trip_length). Give a month (YYYY-MM) or start_date/end_date (default: the next 30 days; up to 300 days). Returns every day with its price (and return date for round trips), the cheapest and most expensive day and the median price. Prices are for all passengers together.
Every response includes credits_used: the credits this call cost.
Parameters
name
type
description
originrequired
string
Departure airport or city: 3-letter IATA code; several comma separated (e.g. JFK,EWR). Example: JFK
destinationrequired
string
Arrival airport or city: 3-letter IATA code; several comma separated. Example: LAX
month
string
A month to show, YYYY-MM (instead of start_date/end_date).
start_date
string
First departure day, YYYY-MM-DD (default tomorrow).
end_date
string
Last departure day, YYYY-MM-DD (default 30 days after start_date).
trip_length
integer
Round trip: days between departure and return (1-60). Omit for one-way fares.
adults
integer
Adults (1-9, default 1).
children
integer
Children (0-8).
infants_in_seat
integer
Infants with their own seat (0-8).
infants_on_lap
integer
Infants on a lap (0-8).
cabin
economy | premium_economy | business | first
Cabin class (default economy).
stops
any | nonstop | 1 | 2
At most this many stops: any (default), nonstop, 1, 2.
airlines
string
Only these airlines: 2-letter IATA airline codes, comma separated (e.g. UA,DL).
currency
string
Price currency, a 3-letter code (default USD).
country
string
Two-letter country whose point of sale prices are shown (default US).
import os, requests
res = requests.get(
"https://api.api.sh/google-flights/v1/calendar",
params={"origin": "JFK", "destination": "LAX"},
headers={"x-api-key": os.environ["APISH_KEY"]},
timeout=120,
)
res.raise_for_status()
data = res.json()
const url = new URL("https://api.api.sh/google-flights/v1/calendar");
url.searchParams.set("origin", "JFK");
url.searchParams.set("destination", "LAX");
const res = await fetch(url, { headers: { "x-api-key": process.env.APISH_KEY } });
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const data = await res.json();
Response
A JSON object with the fields described above, plus raw (the source's own data), cached, fetched_at and credits_used. Errors return {"success": false, "error": "…"} with the HTTP status (see errors). A lookup that ran but found nothing (404) costs the price above; refused calls and errors on our side are free (what's charged).
The fastest way to see the full response is the playground: it runs this endpoint with your account and shows the exact JSON.