British Airways APIbritishairways.com ↗
Search British Airways flights by route, date, and cabin class. Returns per-flight fare options, segment times, aircraft type, and CO2 data via one endpoint.
What is the British Airways API?
The British Airways API exposes 1 endpoint — search_flights — that returns available outbound flights between any two IATA airport codes on a specified date. Each response includes an array of flight objects with segment-level details (departure and arrival times, aircraft type, CO2 emissions), per-cabin fare breakdowns, and a total flight count. The endpoint supports both one-way and round-trip queries.
curl -X GET 'https://api.parse.bot/scraper/e0cfe764-548a-4c2c-8561-937ef120186a/search_flights?adults=1&origin=LHR&cabin_class=economy&destination=JFK&return_date=2026-08-12&departure_date=2026-08-05' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace britishairways-com-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: British Airways SDK — bounded, re-runnable; every call capped."""
from parse_apis.britishairways_com_api import BritishAirways, CabinClass, InvalidInput
client = BritishAirways()
# Search economy flights from London Heathrow to New York JFK
for flight in client.flights.search(
origin="LHR",
destination="JFK",
departure_date="2026-08-05",
return_date="2026-08-12",
cabin_class=CabinClass.ECONOMY,
limit=3,
):
print(flight.departure_time, flight.arrival_time, flight.is_direct)
for fare in flight.fares:
print(f" {fare.fare_family}: {fare.currency} {fare.total_price}")
# Get the first business class flight on a one-way trip
biz = client.flights.search(
origin="LHR",
destination="JFK",
departure_date="2026-08-05",
cabin_class=CabinClass.BUSINESS,
limit=1,
).first()
if biz:
for seg in biz.segments:
print(seg.flight_number, seg.airline, seg.aircraft, seg.co2_emissions_kg)
# Typed error handling
try:
client.flights.search(origin="LHR", destination="JFK", departure_date="bad-date", limit=1).first()
except InvalidInput as e:
print("invalid input:", e)
print("exercised: flights.search")
Search available flights between two airports on a given date. Returns all matching outbound flights with per-flight fare options across cabin sub-classes. Supports round-trip (with return_date) and one-way searches. Each flight includes segment details (times, aircraft, CO2) and multiple fare tiers with pricing. Results are a single page of up to 100 flights for the requested departure date.
| Param | Type | Description |
|---|---|---|
| adults | integer | Number of adult passengers. |
| originrequired | string | IATA airport code for departure (e.g. LHR, CDG, JFK). |
| cabin_class | string | Cabin class to search fares for. |
| destinationrequired | string | IATA airport code for arrival (e.g. JFK, LAX, CDG). |
| return_date | string | Return date in ISO format YYYY-MM-DD. When provided, searches round-trip flights; when omitted, searches one-way. |
| departure_daterequired | string | Departure date in ISO format YYYY-MM-DD. |
{
"type": "object",
"fields": {
"origin": "IATA code echoed back",
"flights": "array of flight objects with segments and fare options",
"cabin_class": "requested cabin class",
"destination": "IATA code echoed back",
"return_date": "requested return date or empty string",
"total_flights": "integer count of flights returned",
"departure_date": "requested departure date"
},
"sample": {
"data": {
"origin": "LHR",
"flights": [
{
"fares": [
{
"tags": [],
"currency": "GBP",
"fare_code": "BASICNX",
"fare_family": "Economy Basic",
"is_cheapest": true,
"total_price": 363,
"travel_class": "Economy"
},
{
"tags": [
"recommended"
],
"currency": "GBP",
"fare_code": "ECOPLUSNX",
"fare_family": "Economy Standard",
"is_cheapest": false,
"total_price": 428,
"travel_class": "Economy"
}
],
"segments": [
{
"airline": "British Airways",
"aircraft": "BOEING 777-200/300",
"arrival_time": "2026-08-05T11:10:00.000-04:00",
"flight_number": "BA117",
"departure_time": "2026-08-05T08:20:00.000+01:00",
"duration_hours": 7,
"arrival_airport": "JFK",
"co2_emissions_kg": 1334.42,
"duration_minutes": 50,
"departure_airport": "LHR",
"operating_airline": "British Airways"
}
],
"is_direct": true,
"arrival_city": "New York",
"arrival_time": "2026-08-05T11:10:00.000-04:00",
"departure_city": "London",
"departure_time": "2026-08-05T08:20:00.000+01:00",
"duration_hours": 7,
"arrival_airport": "JFK",
"duration_minutes": 50,
"departure_airport": "LHR"
}
],
"cabin_class": "economy",
"destination": "JFK",
"return_date": "2026-08-12",
"total_flights": 15,
"departure_date": "2026-08-05"
},
"status": "success"
}
}About the British Airways API
What the API covers
The search_flights endpoint accepts an origin and destination as IATA airport codes (e.g. LHR, JFK, CDG), a departure_date in YYYY-MM-DD format, and an optional return_date for round-trip searches. The cabin_class parameter filters fare results to a specific cabin (e.g. economy, business, first). The adults parameter controls passenger count for pricing context.
Response structure
Each response includes the echoed origin, destination, departure_date, return_date, and cabin_class alongside a total_flights integer and a flights array. Each flight object carries segment-level data: scheduled times, aircraft type, and CO2 figures. Fare options within the flight object are broken down by cabin sub-class, giving visibility into the fare buckets British Airways makes available for that itinerary.
Coverage and scope
The endpoint covers routes operated or marketed by British Airways and returns fares as they appear on the BA website for the requested date and cabin. Results reflect live availability, so fare options and prices vary by query time. There is no pagination parameter — all matching flights for the searched day are returned in a single response.
The British Airways API is a managed, monitored endpoint for britishairways.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when britishairways.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official britishairways.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Compare fare buckets across BA cabin sub-classes for a specific route and date
- Track CO2 emissions per flight segment for corporate travel sustainability reporting
- Monitor one-way vs round-trip fare availability between two airports
- Build a flight price alert system using departure_date and cabin_class parameters
- Aggregate aircraft type data across BA routes for fleet research
- Pull segment-level departure and arrival times for itinerary planning tools
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does British Airways have an official developer API?+
What does the search_flights endpoint return for a round-trip search?+
return_date, the endpoint searches for round-trip availability. The response echoes both departure_date and return_date and returns flight objects with segment details and fare options for the outbound journey. The cabin_class and adults parameters apply to both legs.Does the API return seat availability counts or booking class inventory?+
Can I retrieve multi-city or connecting flight itineraries?+
search_flights endpoint takes a single origin and destination pair per call, returning direct and connecting flights BA offers between those two airports. Multi-city itinerary searches across three or more city pairs are not supported in the current endpoint. You can fork this API on Parse and revise it to add a multi-city search endpoint.