Google Flights' price graph: the lowest fare per departure day over the next six months by default (or start_date..end_date, up to 300 days), one-way or for round trips of trip_length days. Each day comes with its price and return date; the cheapest and most expensive day and the median price are included.
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. Example: JFK
destinationrequired
string
Arrival airport or city: 3-letter IATA code; several comma separated. Example: LHR
trip_length
integer
Round trip: days between departure and return (1-60). Omit for one-way fares. Example: 7
start_date
string
First departure day, YYYY-MM-DD (default tomorrow).
end_date
string
Last departure day, YYYY-MM-DD (default 180 days after start_date).
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/price-graph",
params={"origin": "JFK", "destination": "LHR"},
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/price-graph");
url.searchParams.set("origin", "JFK");
url.searchParams.set("destination", "LHR");
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.