FlightXML doesn't display correct time for delayed flights.


#1

So I am working on the server-side in C#.

I was looking for flight AA2262 to Las Vegas, and according to all websites it was delayed to 17:50 PTD.

As you can see:

Scheduled
17:27 PDT
Estimated
17:50 PDT

Website with given information - beta.flightstats.com/flight-tra … /916956297.

But the result that I got always says that arrival is gonna be at 17:27 PDT regardless, when I know that it’s wrong.

So how do I work with delayed flights? FlightInfoExStruct didn’t provide me with anything that would indicate that the delay happened, and having this information is of utmost importance for me.

And, actually, because of that, the code thinks that this flight has arrived, therefore the element 0 is the current one, so for this flight information I have to look for the previous flight in this way:
FlightInfoExStruct fi = client.FlightInfoEx(“AA2262”, 10, 0);
var fiStruct = fi.flights[1];

But when the flight hasn’t been delayed, then I can look for information like that:

FlightInfoExStruct fi = client.FlightInfoEx(“flight number”, 1, 0);
var fiStruct = fi.flights[0];

Thank you.


FlightInfoEx: Incorrect departure time
#2

When querying FlightInfoEx you’ll always need to request multiple flights and then search the results for the one you require (don’t ask for just 1 and assume the first one is the one you are looking for).

A couple of points on the delay.

  1. The estimatedarrivaltime and actualarrivaltime in FlightInfoEx are the landing times. Gate times are not included (and the 17:50 arrival time was the estimated gate arrival time).
  2. The original (or filed) arrival time can be found by converting the filed_ete to seconds and adding that to the filed_departuretime. Then you can compare the computed arrivaltime with the estimatedarrivaltime to determine delay.

#3

Regarding your second point - maybe I don’t understand something, but it gives me exactly the same results =(
filed_departuretime - 16:40 CDT (in reality it was delayed by 22 minutes - 17:02 CD). If I add converted filed_ete, then I get 17:07 PDT. The difference between estimatedarrivaltime and the sum is 10 minutes (which is something that I already know).

filed_departuretime - 1499290800;
filed_ete - 02:27:00.

Even now, if I check for NK193 that is supposed to come to Vegas, and has been delayed by one hour, I get the results from my code that it was supposed to land at 10:58 PDT, when in reality it landed at 12:00 PDT. The link - beta.flightstats.com/flight-tra … /917508789

So is there any way to somehow get the gate time? Point is that if I don’t have the correct gate arrival time for delayed flights, then I might end up in a situation, when I dispatch a person to the airport one or two hours earlier, which would cause many problems. The code works perfectly for flights that are on time or cancelled, though.

Am I doing something wrong?

Thank you.


#4

So here is the data from FlightInfoEx for that flight:


{
        "faFlightID": "NKS193-1498886785-airline-0432",
        "ident": "NKS193",
        "aircrafttype": "A320",
        "filed_ete": "02:58:00",
        "filed_time": 1498886785,
        "filed_departuretime": 1499093700,
        "filed_airspeed_kts": 460,
        "filed_airspeed_mach": "",
        "filed_altitude": 340,
        "route": "BNDTO5 CRGER ELP J86 PGS TYSSN4",
        "actualdeparturetime": 1499098976,
        "estimatedarrivaltime": 1499108289,
        "actualarrivaltime": 1499108289,
        "diverted": "",
        "origin": "KIAH",
        "destination": "KLAS",
        "originName": "Houston Bush Int'ctl",
        "originCity": "Houston, TX",
        "destinationName": "McCarran Intl",
        "destinationCity": "Las Vegas, NV"
      }

The filed_departuretime (1499093700) is 9:55am CDT. The actualdeparturetime is (1499098976) 11:22am CDT. Also the estimatedarrivaltime and actualarrivaltime is (1499108289) is 11:58am PDT. The filed_arrivaltime can be calculated as filed_departuretime (1499093700) + filed_ete in seconds (10680) = 1499104380. This is 10:53am PDT. Comparing actualarrivaltime to our calculated filed_arrivaltime we see that the flight is about an hour behind schedule.

Also the times should line up with the takeoff and landing times on the flightaware site (your link was to a flightstats page). flightaware.com/live/flight/NKS … /KIAH/KLAS


#5

Ok, I see what’s going on.
For whatever reasons, we somehow get different data in the result set.
http://imgur.com/xcO48uh
So it can contribute to the problem that I experience.
For example, I get filed_departuretime = 1499266500 and filed_ete = 02:43:00. Actualdeparturetime = 0. Any ideas why?

I am going to dive more into it and see what I did wrong.

Thank you.

P.S. The image is not displayed here (I dont know why), but you can right-click it and then “open image” and you will be able to see it on imgur.


#6

Yeah it’s a case of looking at the wrong flight in the FlightInfoEx results. The flight with filed_departuretime of 1499266500 and filed_ete “02:43:00” is the flight that is scheduled for Wednesday morning (the faFlightID for that flight is “NKS193-1499059581-airline-0081”. Today’s flight has an faFlightID of “NKS193-1498886785-airline-0432”. If you know the filed_departuretime for the flight in question (say from querying AirlineFlightSchedules) then you could pass in an ident@departuretime to better ensure you get the flight you are looking for. So far example to find the flight from earlier this morning you could pass in an ident parameter of “NK193@1499093700”. Then you are just returned one result. But you need to know the filed_departuretime in advance to do that. Otherwise you’ll need to iterate over the results of FlightInfoEx and ensure that the filed_departuretime for the flight matches the one you are looking for (ie is on the same day and around the time you expect).


#7

Oh my God, that was so stupid of me.

Thank you very much, you helped me greatly.

I will go through everything in the meantime and will try to figure things out on my own.
If anything, I will post my questions here.

Thank you so much again!


#8

Hi there,
I’ve gone over a few threads where you ask users to retrieve an array of data from “FlightInfoEx” and then find the flight of interest.

I’ve attached the JSON formatted response from “FlightInfoEx”.

  • The data below for UA84 has 5 flights, of which the flight that is in transit (departed on 3rd July with ‘faFlightID’: ‘UAL84-1498886786-airline-0118’

  • This flight has ‘actualdeparturetime’ of ‘1499115534’ (16:58 EST)

  • However, your flight tracker for UA84 shows the departure time as “4:40 pm”, which corresponds to the “filed_departuretime”

So:

  • Should I be looking at ‘actualdeparturetime’ or ‘filed_departuretime’?

  • Last night when tracking AC85, your site shows the flight as delayed. However, ‘filed_departuretime’ did not reflect this delay and since the flight had not departed, the ‘actualdeparturetime’ was 0. How did you know about the delay? What field should I be using?



{ faFlightID: 'UAL84-1499059583-airline-0168',
  ident: 'UAL84',
  aircrafttype: 'B77L',
  filed_ete: '10:25:00',
  filed_time: 1499059583,
  filed_departuretime: 1499287200,
  filed_airspeed_kts: 483,
  filed_airspeed_mach: '',
  filed_altitude: 0,
  route: '',
  actualdeparturetime: 0,
  estimatedarrivaltime: 1499324700,
  actualarrivaltime: 0,
  diverted: '',
  origin: 'KEWR',
  destination: 'LLBG',
  originName: 'Newark Liberty Intl',
  originCity: 'Newark, NJ',
  destinationName: 'Ben Gurion Int\'l',
  destinationCity: 'Tel Aviv' }
~~~~~~~~~~~~~~~~

{ faFlightID: 'UAL84-1498973154-airline-0024',
  ident: 'UAL84',
  aircrafttype: 'B77L',
  filed_ete: '12:22:00',
  filed_time: 1498973154,
  filed_departuretime: 1499200800,
  filed_airspeed_kts: 500,
  filed_airspeed_mach: '',
  filed_altitude: 330,
  route: 'ELVAE COL DIXIE PREPI UNYAD OWENZ POPPN ISLES VITOL PORTI 4700N/05000W 4800N/04000W 4900N/03000W 4700N/02000W PASAS VES LASKU UM190 BLV UM601 BCN UN725 ORKUM UM603 ELSAG ALG BEROL RUTOM UM601 MIL UN134 ASPIS UN134 ERIMO N134 SOLIN GODED1',
  actualdeparturetime: 0,
  estimatedarrivaltime: 1499246438,
  actualarrivaltime: 0,
  diverted: '',
  origin: 'KEWR',
  destination: 'LLBG',
  originName: 'Newark Liberty Intl',
  originCity: 'Newark, NJ',
  destinationName: 'Ben Gurion Int\'l',
  destinationCity: 'Tel Aviv' }
~~~~~~~~~~~~~~~~

{ faFlightID: 'UAL84-1498886786-airline-0118',
  ident: 'UAL84',
  aircrafttype: 'B772',
  filed_ete: '09:39:00',
  filed_time: 1498886786,
  filed_departuretime: 1499114400,
  filed_airspeed_kts: 480,
  filed_airspeed_mach: '',
  filed_altitude: 350,
  route: 'MERIT HFD PUT EBONY N439A TUDEP 5200N/05000W 5400N/04000W 5400N/03000W 5400N/02000W DOGAL BEXET BOYNE LAMSO GMH UL603 TESGA OSBIT UL984 RASPU UZ660 ENITA Z660 ETVIS Z37 GIMBO SASAL BABIT NISVA N131 RODIP UN131 IDILO UN131 KULAR UT39 TOMBI UM855 DASNI UR19 LCA UB17 EMEDA UB17 VELOX UW13 SOLIN GODED1',
  actualdeparturetime: 1499115534,
  estimatedarrivaltime: 1499150940,
  actualarrivaltime: 0,
  diverted: '',
  origin: 'KEWR',
  destination: 'LLBG',
  originName: 'Newark Liberty Intl',
  originCity: 'Newark, NJ',
  destinationName: 'Ben Gurion Int\'l',
  destinationCity: 'Tel Aviv' }
~~~~~~~~~~~~~~~~

{ faFlightID: 'UAL84-1498800397-airline-0157',
  ident: 'UAL84',
  aircrafttype: 'B772',
  filed_ete: '09:26:00',
  filed_time: 1498800397,
  filed_departuretime: 1499028000,
  filed_airspeed_kts: 490,
  filed_airspeed_mach: '',
  filed_altitude: 330,
  route: 'GREKI JUDDS MARTN TOPPS N499A RIKAL NATV RESNO NATV NETKI NIBOG REMSI L603 BELOX BUKUT L603 LAMSO GMH UL603 OLETU GOMIG MAGAM MEDUX UM867 KOGAT ERANA UL737 TSL UN130 MES UL609 APLON UL609 LEDRA UL609 SOLIN GODED1',
  actualdeparturetime: 1499032238,
  estimatedarrivaltime: 1499066614,
  actualarrivaltime: 1499066614,
  diverted: '',
  origin: 'KEWR',
  destination: 'LLBG',
  originName: 'Newark Liberty Intl',
  originCity: 'Newark, NJ',
  destinationName: 'Ben Gurion Int\'l',
  destinationCity: 'Tel Aviv' }
~~~~~~~~~~~~~~~~

{ faFlightID: 'UAL84-1498713963-airline-0269',
  ident: 'UAL84',
  aircrafttype: 'B772',
  filed_ete: '09:24:00',
  filed_time: 1498713963,
  filed_departuretime: 1498941600,
  filed_airspeed_kts: 500,
  filed_airspeed_mach: '',
  filed_altitude: 330,
  route: 'MERIT HFD PUT WITCH ALLEX N323A ELSIR NATW GISTI BAKUR KONAN UL607 KOK UM150 KOMOB UM150 PITES BABEG KUMOM VEKEN SABAD MEDUX UM867 KOGAT ERANA UL737 TSL UN130 MES UL609 APLON UL609 LEDRA UL609 SOLIN GODED1',
  actualdeparturetime: 1498944283,
  estimatedarrivaltime: 1498978680,
  actualarrivaltime: 1498978380,
  diverted: '',
  origin: 'KEWR',
  destination: 'LLBG',
  originName: 'Newark Liberty Intl',
  originCity: 'Newark, NJ',
  destinationName: 'Ben Gurion Int\'l',
  destinationCity: 'Tel Aviv' }
~~~~~~~~~~~~~~~~



#9

Any advice please?
I’m really stuck at this point.


#10

You’ll want to look at actualdeparturetime to see how delayed the flight was (compare filed_departuretime with actualdeparturetime). filed_departuretime will remain constant and is not changed by any delays.

As we don’t have an estimateddeparturetime in FlightXML2 FlightInfoEx, you’ll have to compare estimatedarrivaltime and (filed_departuretime + filed_ete) to determine delay. FlightXML3 includes the estimateddeparturetime when that is available shortly you could use that instead.