Codeshare problems

Also running into a bigger problem than the response time.

We are running into a serious problem with the use of your FlightXML API (JSON).

If we request all the flights between 2 cities on a certain date we generally get all the flight info back in the data format defined by Flightaware.

We are only running into a problem with code shares.

For example if we use the following request :

flightxml.flightaware.com/json/F … howMany=45

We get the following response:

{“AirlineFlightSchedulesResult”:{“next_offset”:-1,“data”:{“ident”:“EZY7925”,“actual_ident”:“”,“departuretime”:1452407700,“arrivaltime”:1452414900,“origin”:“EHAM”,“destination”:“LFMN”,“aircrafttype”:“A320”,“meal_service”:“”,“seats_cabin_first”:0,“seats_cabin_business”:0,“seats_cabin_coach”:180},{“ident”:“ETD7336”,“actual_ident”:“KLM1273”,“departuretime”:1452453900,“arrivaltime”:1452460500,“origin”:“EHAM”,“destination”:“LFMN”,“aircrafttype”:“E190”,“meal_service”:“”,“seats_cabin_first”:0,“seats_cabin_business”:20,“seats_cabin_coach”:80},{“ident”:“DAL9546”,“actual_ident”:“KLC1263”,“departuretime”:1452415500,“arrivaltime”:1452422400,“origin”:“EHAM”,“destination”:“LFMN”,“aircrafttype”:“B737”,“meal_service”:“Business: Ontbijt / Economy: Ontbijt”,“seats_cabin_first”:0,“seats_cabin_business”:20,“seats_cabin_coach”:102},{“ident”:“KLM1273”,“actual_ident”:“KLC1273”,“departuretime”:1452453900,“arrivaltime”:1452460500,“origin”:“EHAM”,“destination”:“LFMN”,“aircrafttype”:“E190”,“meal_service”:“Business: Maaltijd / Economy: Maaltijd”,“seats_cabin_first”:0,“seats_cabin_business”:20,“seats_cabin_coach”:80},{“ident”:“AFR8275”,“actual_ident”:“KLC1273”,“departuretime”:1452453900,“arrivaltime”:1452460500,“origin”:“EHAM”,“destination”:“LFMN”,“aircrafttype”:“E190”,“meal_service”:“Business: Maaltijd / Economy: Versnapering of brunch”,“seats_cabin_first”:0,“seats_cabin_business”:20,“seats_cabin_coach”:80},{“ident”:“ETD7316”,“actual_ident”:“KLM1263”,“departuretime”:1452415500,“arrivaltime”:1452422400,“origin”:“EHAM”,“destination”:“LFMN”,“aircrafttype”:“B737”,“meal_service”:“”,“seats_cabin_first”:0,“seats_cabin_business”:20,“seats_cabin_coach”:102},{“ident”:“AFR8271”,“actual_ident”:“KLC1263”,“departuretime”:1452415500,“arrivaltime”:1452422400,“origin”:“EHAM”,“destination”:“LFMN”,“aircrafttype”:“B737”,“meal_service”:“Business: Maaltijd / Economy: Versnapering of brunch”,“seats_cabin_first”:0,“seats_cabin_business”:20,“seats_cabin_coach”:102},{“ident”:“KLM1263”,“actual_ident”:“KLC1263”,“departuretime”:1452415500,“arrivaltime”:1452422400,“origin”:“EHAM”,“destination”:“LFMN”,“aircrafttype”:“E190”,“meal_service”:“Business: Maaltijd / Economy: Maaltijd”,“seats_cabin_first”:0,“seats_cabin_business”:20,“seats_cabin_coach”:80},{“ident”:“KQA1273”,“actual_ident”:“KLM1273”,“departuretime”:1452453900,“arrivaltime”:1452460500,“origin”:“EHAM”,“destination”:“LFMN”,“aircrafttype”:“E190”,“meal_service”:“”,“seats_cabin_first”:0,“seats_cabin_business”:20,“seats_cabin_coach”:80},{“ident”:“TRA5585”,“actual_ident”:“”,“departuretime”:1452447000,“arrivaltime”:1452453900,“origin”:“EHAM”,“destination”:“LFMN”,“aircrafttype”:“B738”,“meal_service”:“”,“seats_cabin_first”:0,“seats_cabin_business”:0,“seats_cabin_coach”:189},{“ident”:“KQA1263”,“actual_ident”:“KLM1263”,“departuretime”:1452415500,“arrivaltime”:1452422400,“origin”:“EHAM”,“destination”:“LFMN”,“aircrafttype”:“B737”,“meal_service”:“”,“seats_cabin_first”:0,“seats_cabin_business”:20,“seats_cabin_coach”:102}]}}

Now, we want to filter out the codeshares, so we only have the actual flights that we need. Simple enough you’d think as in general this can be achieved by taking actual ident == “:” and that are the original flights.

Now if we look at the above response we see that ETD7336 is a codeshare with KLM1273, but then we see that KLM1273 is a codeshare again with KLC1273 and KLC1273 is not even in the response. This is because KLC1273 doesn’t even exist. It is a flight excecuted by KLM Cityhopper for KLM and so should return with a KLM1273 flightnumber.

We are also seeing the same problems with Lufthansa and Lufthansa cityline , also with Airfrance and Airfrance HOP/AirLinair/Bitair.

This is making it impossible for us to compile a simple list of the flights between 2 cities.

Are we making a incorrect request or is there something else we missed?

FlightAware, could you please get back to us on the posts above? This issue prevents us from continuing development and we’ll have to move on to another flight data provider if it turns out to be unsolvable.

Up…

We are running into a serious problem with the use of your FlightXML API (JSON).

If we request all the flights between 2 cities on a certain date we generally get all the flight info back in the data format defined by Flightaware.

We are only running into a problem with code shares.

For example if we use the following request :

flightxml.flightaware.com/json/F … howMany=45

We get the following response:

{“AirlineFlightSchedulesResult”:{“next_offset”:-1,“data”:{“ident”:“EZY7925”,“actual_ident”:“”,“departuretime”:1452407700,“arrivaltime”:1452414900,“origin”:“EHAM”,“destination”:“LFMN”,“aircrafttype”:“A320”,“meal_service”:“”,“seats_cabin_first”:0,“seats_cabin_business”:0,“seats_cabin_coach”:180},{“ident”:“ETD7336”,“actual_ident”:“KLM1273”,“departuretime”:1452453900,“arrivaltime”:1452460500,“origin”:“EHAM”,“destination”:“LFMN”,“aircrafttype”:“E190”,“meal_service”:“”,“seats_cabin_first”:0,“seats_cabin_business”:20,“seats_cabin_coach”:80},{“ident”:“DAL9546”,“actual_ident”:“KLC1263”,“departuretime”:1452415500,“arrivaltime”:1452422400,“origin”:“EHAM”,“destination”:“LFMN”,“aircrafttype”:“B737”,“meal_service”:“Business: Ontbijt / Economy: Ontbijt”,“seats_cabin_first”:0,“seats_cabin_business”:20,“seats_cabin_coach”:102},{“ident”:“KLM1273”,“actual_ident”:“KLC1273”,“departuretime”:1452453900,“arrivaltime”:1452460500,“origin”:“EHAM”,“destination”:“LFMN”,“aircrafttype”:“E190”,“meal_service”:“Business: Maaltijd / Economy: Maaltijd”,“seats_cabin_first”:0,“seats_cabin_business”:20,“seats_cabin_coach”:80},{“ident”:“AFR8275”,“actual_ident”:“KLC1273”,“departuretime”:1452453900,“arrivaltime”:1452460500,“origin”:“EHAM”,“destination”:“LFMN”,“aircrafttype”:“E190”,“meal_service”:“Business: Maaltijd / Economy: Versnapering of brunch”,“seats_cabin_first”:0,“seats_cabin_business”:20,“seats_cabin_coach”:80},{“ident”:“ETD7316”,“actual_ident”:“KLM1263”,“departuretime”:1452415500,“arrivaltime”:1452422400,“origin”:“EHAM”,“destination”:“LFMN”,“aircrafttype”:“B737”,“meal_service”:“”,“seats_cabin_first”:0,“seats_cabin_business”:20,“seats_cabin_coach”:102},{“ident”:“AFR8271”,“actual_ident”:“KLC1263”,“departuretime”:1452415500,“arrivaltime”:1452422400,“origin”:“EHAM”,“destination”:“LFMN”,“aircrafttype”:“B737”,“meal_service”:“Business: Maaltijd / Economy: Versnapering of brunch”,“seats_cabin_first”:0,“seats_cabin_business”:20,“seats_cabin_coach”:102},{“ident”:“KLM1263”,“actual_ident”:“KLC1263”,“departuretime”:1452415500,“arrivaltime”:1452422400,“origin”:“EHAM”,“destination”:“LFMN”,“aircrafttype”:“E190”,“meal_service”:“Business: Maaltijd / Economy: Maaltijd”,“seats_cabin_first”:0,“seats_cabin_business”:20,“seats_cabin_coach”:80},{“ident”:“KQA1273”,“actual_ident”:“KLM1273”,“departuretime”:1452453900,“arrivaltime”:1452460500,“origin”:“EHAM”,“destination”:“LFMN”,“aircrafttype”:“E190”,“meal_service”:“”,“seats_cabin_first”:0,“seats_cabin_business”:20,“seats_cabin_coach”:80},{“ident”:“TRA5585”,“actual_ident”:“”,“departuretime”:1452447000,“arrivaltime”:1452453900,“origin”:“EHAM”,“destination”:“LFMN”,“aircrafttype”:“B738”,“meal_service”:“”,“seats_cabin_first”:0,“seats_cabin_business”:0,“seats_cabin_coach”:189},{“ident”:“KQA1263”,“actual_ident”:“KLM1263”,“departuretime”:1452415500,“arrivaltime”:1452422400,“origin”:“EHAM”,“destination”:“LFMN”,“aircrafttype”:“B737”,“meal_service”:“”,“seats_cabin_first”:0,“seats_cabin_business”:20,“seats_cabin_coach”:102}]}}

Now, we want to filter out the codeshares, so we only have the actual flights that we need. Simple enough you’d think as in general this can be achieved by taking actual ident == “:” and that are the original flights.

Now if we look at the above response we see that ETD7336 is a codeshare with KLM1273, but then we see that KLM1273 is a codeshare again with KLC1273 and KLC1273 is not even in the response. This is because KLC1273 doesn’t even exist. It is a flight excecuted by KLM Cityhopper for KLM and so should return with a KLM1273 flightnumber.

We are also seeing the same problems with Lufthansa and Lufthansa cityline , also with Airfrance and Airfrance HOP/AirLinair/Bitair.

This is making it impossible for us to compile a simple list of the flights between 2 cities.

Are we making a incorrect request or is there something else we missed?

It seems that the problem isn’t just confined to a JSON request.

We tested it with a simple Python request :

#!/usr/bin/python

import sys
from suds import null, WebFault
from suds.client import Client
import logging

username = ‘stafftraveler’
apiKey = ‘XXX’
url = ‘http://flightxml.flightaware.com/soap/FlightXML2/wsdl

logging.basicConfig(level=logging.INFO)
api = Client(url, username=username, password=apiKey)
#print api

Get the schedules

result = api.service.AirlineFlightSchedules(‘1452380400’,‘1452466799’,‘AMS’,‘NCE’,‘’,‘’,‘45’,‘0’)
print result

And the results where as follows:

(ArrayOfAirlineFlightScheduleStruct){
next_offset = -1
data] =
(AirlineFlightScheduleStruct){
ident = “EZY7925”
actual_ident = None
departuretime = 1452407700
arrivaltime = 1452414900
origin = “EHAM”
destination = “LFMN”
aircrafttype = “A320”
meal_service = None
seats_cabin_first = 0
seats_cabin_business = 0
seats_cabin_coach = 180
},
(AirlineFlightScheduleStruct){
ident = “ETD7336”
actual_ident = “KLM1273”
departuretime = 1452453900
arrivaltime = 1452460500
origin = “EHAM”
destination = “LFMN”
aircrafttype = “E190”
meal_service = None
seats_cabin_first = 0
seats_cabin_business = 20
seats_cabin_coach = 80
},
(AirlineFlightScheduleStruct){
ident = “DAL9546”
actual_ident = “KLC1263”
departuretime = 1452415500
arrivaltime = 1452422400
origin = “EHAM”
destination = “LFMN”
aircrafttype = “B737”
meal_service = “Business: Ontbijt / Economy: Ontbijt”
seats_cabin_first = 0
seats_cabin_business = 20
seats_cabin_coach = 102
},
(AirlineFlightScheduleStruct){
ident = “KLM1273”
actual_ident = “KLC1273”
departuretime = 1452453900
arrivaltime = 1452460500
origin = “EHAM”
destination = “LFMN”
aircrafttype = “E190”
meal_service = “Business: Maaltijd / Economy: Maaltijd”
seats_cabin_first = 0
seats_cabin_business = 20
seats_cabin_coach = 80
},
(AirlineFlightScheduleStruct){
ident = “AFR8275”
actual_ident = “KLC1273”
departuretime = 1452453900
arrivaltime = 1452460500
origin = “EHAM”
destination = “LFMN”
aircrafttype = “E190”
meal_service = “Business: Maaltijd / Economy: Versnapering of brunch”
seats_cabin_first = 0
seats_cabin_business = 20
seats_cabin_coach = 80
},
(AirlineFlightScheduleStruct){
ident = “ETD7316”
actual_ident = “KLM1263”
departuretime = 1452415500
arrivaltime = 1452422400
origin = “EHAM”
destination = “LFMN”
aircrafttype = “B737”
meal_service = None
seats_cabin_first = 0
seats_cabin_business = 20
seats_cabin_coach = 102
},
(AirlineFlightScheduleStruct){
ident = “AFR8271”
actual_ident = “KLC1263”
departuretime = 1452415500
arrivaltime = 1452422400
origin = “EHAM”
destination = “LFMN”
aircrafttype = “B737”
meal_service = “Business: Maaltijd / Economy: Versnapering of brunch”
seats_cabin_first = 0
seats_cabin_business = 20
seats_cabin_coach = 102
},
(AirlineFlightScheduleStruct){
ident = “KLM1263”
actual_ident = “KLC1263”
departuretime = 1452415500
arrivaltime = 1452422400
origin = “EHAM”
destination = “LFMN”
aircrafttype = “E190”
meal_service = “Business: Maaltijd / Economy: Maaltijd”
seats_cabin_first = 0
seats_cabin_business = 20
seats_cabin_coach = 80
},
(AirlineFlightScheduleStruct){
ident = “KQA1273”
actual_ident = “KLM1273”
departuretime = 1452453900
arrivaltime = 1452460500
origin = “EHAM”
destination = “LFMN”
aircrafttype = “E190”
meal_service = None
seats_cabin_first = 0
seats_cabin_business = 20
seats_cabin_coach = 80
},
(AirlineFlightScheduleStruct){
ident = “TRA5585”
actual_ident = None
departuretime = 1452447000
arrivaltime = 1452453900
origin = “EHAM”
destination = “LFMN”
aircrafttype = “B738”
meal_service = None
seats_cabin_first = 0
seats_cabin_business = 0
seats_cabin_coach = 189
},
(AirlineFlightScheduleStruct){
ident = “KQA1263”
actual_ident = “KLM1263”
departuretime = 1452415500
arrivaltime = 1452422400
origin = “EHAM”
destination = “LFMN”
aircrafttype = “B737”
meal_service = None
seats_cabin_first = 0
seats_cabin_business = 20
seats_cabin_coach = 102
},
}

Now, we want to filter out the codeshares, so we only have the actual flights that we need. Simple enough you’d think as in general this can be achieved by taking actual ident == “:” and that are the original flights.

Now if we look at the above response we see that ETD7336 is a codeshare with KLM1273, but then we see that KLM1273 is a codeshare again with KLC1273 and KLC1273 is not even in the response. This is because KLC1273 doesn’t even exist. It is a flight excecuted by KLM Cityhopper for KLM and so should return with a KLM1273 flightnumber.

We are also seeing the same problems with Lufthansa and Lufthansa cityline , also with Airfrance and Airfrance HOP/AirLinair/Bitair.

Basically this means the AirlineFlightSchedules XML request is useless… there is no way to get any coherent data from it…

Any ideas??

I did some merging to contain this request in it’s own thread separate from your latency question.

This is the standard way codeshares are handled with regional/express airlines. The actual_ident reflects the operator of the flight, KLM Cityhopper. KLM Cityhopper doesn’t market their own flights, they rely on KLM and other partners of KLM to do that, so KLM and those other airlines appear in the ident field. You cannot use such simple logic to filter out “codeshares” when the flight you want is only sold as a codeshare (marketing airline is not the operating airline).

This is particularly complex in Europe where the regional partners are able to use the parent/primary marketing airline’s three letter code in field 7 sometimes with the actual operator in field 18, unlike the US where the operating airlines uses their own three letter code in field 7.