Booking.com flight search
One-way or round-trip flight offers: total price with base fare, taxes and fees, and per segment the airports, times, duration, stops and each leg's flight number, carrier, operating carrier and cabin, plus cabin and checked luggage allowances and the branded fare. aggregation holds the filter counts and minimum prices by stops, airline, times and duration. 15 offers per page; pass next_offset as offset (null on the last page).
Every response includes credits_used: the credits this call cost.
Parameters
| name | type | description |
|---|---|---|
fromrequired | string | Origin airport code (JFK), city code (LON.CITY) or place name. Example: JFK |
torequired | string | Destination airport code, city code or place name. Example: LHR |
departrequired | string | Departure date (YYYY-MM-DD). Example: 2027-03-10 |
return | string | Return date (YYYY-MM-DD) for a round trip. |
adults | integer | Adults (default 1). |
children | string | Children's ages, comma-separated. |
cabin | ECONOMY | PREMIUM_ECONOMY | BUSINESS | FIRST | ECONOMY (default), PREMIUM_ECONOMY, BUSINESS or FIRST. |
sort | BEST | CHEAPEST | FASTEST | BEST (default), CHEAPEST or FASTEST. |
stops | integer | Maximum stops (0, 1 or 2). |
airlines | string | Only these airlines (IATA codes, comma-separated). |
currency | string | Currency code. |
offset | integer | Offer offset. Pass next_offset from the previous response. |
Every endpoint also takes fresh, raw, fields (see lean responses and caching).
Example
curl "https://api.api.sh/booking/v1/flights?from=JFK&to=LHR&depart=2027-03-10" \
-H "x-api-key: $APISH_KEY" import os, requests
res = requests.get(
"https://api.api.sh/booking/v1/flights",
params={"from": "JFK", "to": "LHR", "depart": "2027-03-10"},
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/booking/v1/flights");
url.searchParams.set("from", "JFK");
url.searchParams.set("to", "LHR");
url.searchParams.set("depart", "2027-03-10");
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).