"Codeshared" Array Explained

1. Understanding How Codeshares Work

Let’s walk through an example to explain how codeshares work in aviation and how the “codeshared” array works in our /timetable and /flightsHistory endpoints.

In this example, flight EI3618 (BHD-MAN) is operated by Aer Lingus (EI), meaning Aer Lingus is responsible for physically operating the flight. However, British Airways (BA) and Qatar Airways (QR) are codeshare partners for this flight, marketing it under their own flight numbers, BA8906 and QR9683, respectively.

A codeshare agreement allows airlines to sell seats on a flight operated by another airline under their own flight numbers. In this case, passengers who book BA8906 through British Airways or QR9683 through Qatar Airways will actually travel on EI3618, operated by Aer Lingus. Their booking confirmation will typically state something like:
“BA8906 operated by Aer Lingus, Flight EI3618.”

As a result, in this scenario, there is one actual flight (EI3618) and two codeshare listings (BA8906 and QR9683).

2. How Codeshares Are Displayed In Our Data

This request will give you the current arrival schedule of MAN airport. Let’s assume flight EI3618 is operating today and we expect to see this flight in the output: https://aviation-edge.com/v2/public/timetable?key=APIKEY&iataCode=MAN&type=arrival

The output will show the details for each flight number separately. For EI3618, which is the actual flight operated by Aer Lingus, the “codeshared” field will be null here because it’s not a codeshare—this is the flight everyone is physically flying on.

For the codeshare flights (BA8906 and QR9683), the “codeshared” field will show the details of the actual flight (EI3618). This tells you that even though the booking is under British Airways or Qatar Airways, passengers will still be flying on the same plane operated by Aer Lingus.

1)
{
“airline”: {
“iataCode”: “BA”,
“icaoCode”: “BAW”,
“name”: “British Airways”
},
“arrival”: {
“actualRunway”: null,
“actualTime”: null,
“baggage”: “6”,
“delay”: null,
“estimatedRunway”: null,
“estimatedTime”: null,
“gate”: null,
“iataCode”: “MAN”,
“icaoCode”: “EGCC”,
“scheduledTime”: “2025-02-14T19:05:00.000”,
“terminal”: “1”
},
“codeshared”: {
“airline”: {
“iataCode”: “ei”,
“icaoCode”: “ein”,
“name”: “aer lingus”
},
“flight”: {
“iataNumber”: “ei3618”,
“icaoNumber”: “ein3618”,
“number”: “3618”
}
},
“departure”: {
“actualRunway”: null,
“actualTime”: null,
“baggage”: null,
“delay”: null,
“estimatedRunway”: null,
“estimatedTime”: “2025-02-14T17:49:00.000”,
“gate”: null,
“iataCode”: “BHD”,
“icaoCode”: “EGAC”,
“scheduledTime”: “2025-02-14T18:00:00.000”,
“terminal”: null
},
“flight”: {
“iataNumber”: “BA8906”,
“icaoNumber”: “BAW8906”,
“number”: “8906”
},
“status”: “scheduled”,
“type”: “arrival”
}

———
2)
{
“airline”: {
“iataCode”: “QR”,
“icaoCode”: “QTR”,
“name”: “Qatar Airways”
},
“arrival”: {
“actualRunway”: null,
“actualTime”: null,
“baggage”: “6”,
“delay”: null,
“estimatedRunway”: null,
“estimatedTime”: null,
“gate”: null,
“iataCode”: “MAN”,
“icaoCode”: “EGCC”,
“scheduledTime”: “2025-02-14T19:05:00.000”,
“terminal”: “1”
},
“codeshared”: {
“airline”: {
“iataCode”: “ei”,
“icaoCode”: “ein”,
“name”: “aer lingus”
},
“flight”: {
“iataNumber”: “ei3618”,
“icaoNumber”: “ein3618”,
“number”: “3618”
}
},
“departure”: {
“actualRunway”: null,
“actualTime”: null,
“baggage”: null,
“delay”: null,
“estimatedRunway”: null,
“estimatedTime”: “2025-02-14T17:49:00.000”,
“gate”: null,
“iataCode”: “BHD”,
“icaoCode”: “EGAC”,
“scheduledTime”: “2025-02-14T18:00:00.000”,
“terminal”: null
},
“flight”: {
“iataNumber”: “QR9683”,
“icaoNumber”: “QTR9683”,
“number”: “9683”
},
“status”: “scheduled”,
“type”: “arrival”
}

———-
3)
{
“airline”: {
“iataCode”: “EI”,
“icaoCode”: “EIN”,
“name”: “Aer Lingus”
},
“arrival”: {
“actualRunway”: null,
“actualTime”: null,
“baggage”: “6”,
“delay”: null,
“estimatedRunway”: null,
“estimatedTime”: null,
“gate”: null,
“iataCode”: “MAN”,
“icaoCode”: “EGCC”,
“scheduledTime”: “2025-02-14T19:05:00.000”,
“terminal”: “1”
},
“codeshared”: null, (CODESHARED IS NULL HERE BECAUSE IT’S THE ACTUAL FLIGHT)
“departure”: {
“actualRunway”: null,
“actualTime”: null,
“baggage”: null,
“delay”: null,
“estimatedRunway”: null,
“estimatedTime”: “2025-02-14T17:49:00.000”,
“gate”: null,
“iataCode”: “BHD”,
“icaoCode”: “EGAC”,
“scheduledTime”: “2025-02-14T18:00:00.000”,
“terminal”: null
},
“flight”: {
“iataNumber”: “EI3618”,
“icaoNumber”: “EIN3618”,
“number”: “3618”
},
“status”: “scheduled”,
“type”: “arrival”
}