I’m using your APIs FlightInfoEx function and it works perfectly for fetching estimated time of arrival (it’s important for my firm because we transfer tourists from an airport to their final destinations).
But… when my app pings for a flight that’s been canceled I’m not getting an information that the flight is canceled, e.g. flight STATUS (canceled, scheduled or delayed), instead of that I get next flight data for that flight/ident. Is there a way I can read/conclude from FlightInfoStruct that a flight was canceled?
Or via your API get flight status for specific date and ident?
You need to specify howMany > 1 when you invoke FlightInfoEx, and your application needs to be prepared to look through the multiple flights that are returned rather than assuming that the first result is the only one that it needs to look at.
FlightInfoEx returns flights time-ordered starting with up to a few days in the future, to the current, and then to the past. New flights in the future are always getting added, so your application needs to be prepared for that.
Still FlightExStruct, return value of FlightInfoEx function doesn’t return flight status. Is there a way I can conclude from that struct that a flight is/was:
canceled,
delayed or
scheduled (on time) ?
I can see from my tests that actualdeparturetime and actualarrivaltime equals ZERO whan plane did not departed/arrived yet. Can I made simillar conclusion that a flight was canceled if date passed but actualdeparturetime and actualarrivaltime still remain ZERO ?
If there is a delay, actualdeparturetime will be greater then filed_departuretime. Or actualarrivaltime will be greater than (filed_departuretime + filed_ete).
If the flight hasn’t departed yet (actualdeparturetime == 0), then the estimatearrivaltime will be greater than (filed_departuretime + filed_ete).
If the flight is cancelled, actualdeparturetime == -1.
Thank you very much… You helped me A LOT, and now my firm started using your API. Just one more question for now.
I noticed that for some flights e.g. FR6464 I get wrong results… When I enter that flight on your page URI (flightaware.com/live/flight/RYR6464
And I get arrival time with a questionmark. From your API I get arrivaltime that’s the same like actualdeparturetime (guessing that’s wrong?), but diiferent from the one shown on the above mentioned page.
Can you maybe explain why is this happening and how can I fix it on my end?
Also for some flights e.g. EI0446 your page redirects me to EIN446 but API gives me SoapFault (SoapException).
I would just like to know if I can fix this behaviour in API?
We always recommend using the ICAO code for flight identifiers, rather than IATA codes which are ambiguous and conflicting. We are sometimes able to automatically convert such IATA requests for you, but we don’t recommend relying upon that if you are able to do it yourself.
When (actualarrivaltime == actualdeparturetime) && (actualdeparturetime != 0), then that indicates the condition “flight result unknown”, which is shown on the website as a question mark. It indicates that we don’t know when the flight arrived, but we suspect it’s no longer in the air.