What is a codeshare flight and how do airlines share the same flight under different flight numbers? Learn about codeshare agreement types, how to identify codeshare flights in booking data, and which airline is responsible for your journey.
Codeshare Flights. What is a codeshare flight, how codeshare agreements work, codeshare flight meaning, codeshare database, airline codeshare partners API and codeshare agreement list.
A codeshare flight is a flight that is marketed and sold by one airline but physically operated by a different airline. In a codeshare arrangement, two or more airlines share the same flight — the operating carrier flies the aircraft and crew, while the marketing carrier sells tickets under its own flight number and airline code. This means a single physical flight can appear in booking systems under multiple flight numbers from different airlines simultaneously.
For passengers, codeshare flights are often encountered when booking a connecting itinerary. You may purchase a ticket from Airline A for your entire journey, but one or more segments may actually be operated by Airline B. Your boarding pass will typically show both the marketing carrier (the airline you booked with) and the operating carrier (the airline that owns and flies the aircraft).
For developers building travel applications, understanding codeshare data is essential. A single physical departure from London Heathrow to New York JFK might appear in your API results as BA117 (British Airways), AA6140 (American Airlines) and AY5503 (Finnair) — all referring to the same aircraft, same departure time, same gate. Without proper codeshare handling, your application could display these as three separate flights, misleading users and inflating available options.
"Codeshare information is derived from published airline schedules and route data. AirLabs provides comprehensive route and flight data through its APIs. On this page you can read about codeshare flights and how to work with related aviation data using AirLabs."
A codeshare agreement is a commercial arrangement between two or more airlines that allows one carrier to market and sell seats on flights operated by another carrier. These agreements are a fundamental part of modern airline alliances and partnerships, enabling carriers to extend their network reach without operating additional aircraft.
There are several types of codeshare arrangements used across the airline industry, each with different levels of cooperation and commercial structure:
Codeshare agreements serve several strategic purposes for airlines. They allow carriers to offer a broader network of destinations without the capital cost of flying additional routes. A regional carrier in Southeast Asia, for example, can codeshare with a European long-haul airline, giving passengers the appearance of a seamless single-carrier journey from Bangkok to small cities across Europe that neither airline could serve economically on its own.
Additionally, codeshare flights enable airlines to feed traffic into each other's hubs. Passengers connecting from a codeshare partner's domestic flight onto an international departure are more likely to book with the marketing carrier, creating revenue opportunities that would not exist without the partnership. This is why the three major airline alliances — Star Alliance, Oneworld and SkyTeam — all rely heavily on codeshare agreements among their member carriers.
For developers and travel technology companies, codeshare data appears across multiple API endpoints. Understanding where and how this data is exposed helps you build accurate flight search and booking applications.
| Data Point | Description | Where It Appears |
| flight_iata | The IATA flight number as marketed (e.g. BA117) | Flight Info, Real-Time Flights, Schedules |
| cs_flight_iata | The codeshare flight number — the operating carrier's real flight code | Schedules API, Flight Info API |
| airline_iata | The marketing airline's IATA code | Schedules, Routes DB, Airlines DB, Flight Info |
| cs_airline_iata | The operating airline's IATA code for codeshare flights | Schedules API, Flight Info API |
dep_iata / arr_iata |
Departure and arrival airport IATA codes | Routes DB, Schedules, Flight Info |
AirLabs provides the data infrastructure that enables developers to work with codeshare information effectively. The Schedules API is the primary source of codeshare data — it returns live departure and arrival schedules with explicit codeshare fields (cs_airline_iata, cs_flight_iata, cs_flight_number) that tell you exactly which flight is the operating carrier and which is the marketing carrier.
Here is a real example from the Schedules API — a departure from Miami that is a codeshare flight:
https://airlabs.co/api/v9/schedules?dep_iata=MIA&api_key={API_KEY}
[{
"airline_iata": "BA",
"airline_icao": "BAW",
"flight_iata": "BA6984",
"flight_icao": "BAW6984",
"flight_number": "6984",
// ← codeshare fields: this flight is actually operated by AA
"cs_airline_iata": "AA",
"cs_flight_number": "2421",
"cs_flight_iata": "AA2421",
"dep_iata": "MIA",
"dep_terminal": "C",
"dep_gate": "E4",
"dep_time": "2021-07-14 19:53",
"arr_iata": "SFO",
"arr_terminal": "1",
"arr_gate": "B24",
"arr_time": "2021-07-14 22:52",
"status": "scheduled",
"duration": 359,
"delayed": 137
}]
In this example, the flight appears in the schedule as BA6984 (British Airways) — this is the marketing carrier, the airline that sells the ticket. But the three cs_* fields reveal the truth: the physical aircraft, crew and operation belong to American Airlines flight AA2421. A passenger who booked through British Airways will board an American Airlines plane at gate E4, terminal C in Miami.
This is exactly how codeshare works in practice — and the Schedules API exposes it directly with the cs_airline_iata, cs_flight_iata and cs_flight_number fields, so your application can show both the marketed and operating carrier to the user.
The majority of codeshare agreements exist within the framework of the three global airline alliances. Each alliance has developed its own network of codeshare partnerships that allow member airlines to offer seamless travel across hundreds of destinations worldwide.
| Alliance | Founded | Member Airlines | Destinations | Notable Codeshare Pairs |
| Star Alliance | 1997 | 26 | 1,200+ | United–Lufthansa, ANA–Singapore Airlines |
| Oneworld | 1999 | 13 | 900+ | British Airways–American Airlines, Qantas–Cathay Pacific |
| SkyTeam | 2000 | 19 | 1,000+ | Delta–Air France-KLM, Korean Air–China Eastern |
However, codeshare agreements are not limited to alliance members. Many airlines maintain bilateral codeshare partnerships outside of their alliance, and some non-alliance carriers codeshare extensively. For example, Emirates (which is not a member of any alliance) has codeshare agreements with over 20 airlines worldwide.
Using the AirLabs Airlines Database, developers can retrieve detailed information about each carrier including alliance membership, operational status and the full scope of their network — data that provides context for understanding codeshare relationships.
https://airlabs.co/api/v9/airlines?iata_code=BA&api_key={API_KEY}
[{
"name": "British Airways",
"iata_code": "BA",
"icao_code": "BAW",
"callsign": "SPEEDBIRD",
"country_code": "GB",
"is_scheduled": 1,
"is_passenger": 1,
"is_international": 1,
"total_aircrafts": 273,
"average_fleet_age": 14,
"website": "www.britishairways.com",
"slug": "british-ba-baw-gb"
}]
If you are building a flight search, status tracking or travel booking application, handling codeshare flights correctly is critical. Here are the key steps to implement codeshare logic using AirLabs data:
cs_airline_iata, cs_flight_iata and cs_flight_number fields — if these fields are present, the flight is a codeshare, and the cs_* values identify the actual operating carrier.airline_iata and flight_iata fields show the marketing carrier (who sells the ticket). The cs_airline_iata and cs_flight_iata fields show the operating carrier (who flies the plane). Always display both to the user.If you are a developer working with codeshare data or if you are looking for a way to build a flight application that correctly handles codeshare flights, you can refer to the developer documentation where you will find comprehensive examples of using the codeshare-related data across our APIs.
Our Developer API allows you to create a custom experience for your users and increase the value of your product.
You can try it right now without any obligation! Get a free flight API plan and see for yourself that we have exactly the data you need!
If you need more information, don't hesitate to contact us. We are always happy to chat with our customers and are sure to find a customized solution for each request.
Explore AirLabs, or create an account instantly and start using API.
Get FREE API Key