I have a question of realtime aircraft info

EnrouteStruct r = df.Enroute(“ICN”, 3, “enroute”, 0);

    foreach (EnrouteFlightStruct e in r.enroute)
    {
                
       System.Console.WriteLine(e.ident);
       InFlightAircraftStruct ar = df.InFlightInfo(e.ident);

      System.Console.WriteLine(ar.timestamp);
       System.Console.WriteLine(ar.longitude);
    }
}

I accept three enroute aircraft info with inflightinfo method;
but ar.timestamp and ar.longitude equal 0;
then… How can I detect aircraft of flying or stop status?

Hi,
Not all Enroute flights are in the air, some are just scheduled flights. The idea is that they all have an estimated arrival time.
Some Enroute messages have actualdeparturetime = 0 either because FlightAware does not have enough information to know the precise departure time or they are just scheduled.
You could discard the messages with actualdeparturetime 0 to get the flights that are known to be in air for sure.

You could also use the Search call with inAir 0(must be on ground) or 1 and a ICAO destination code.
example:


https://flightxml.flightaware.com/json/FlightXML2/Search?query=-destination%20KIAH%20-inAir%200&howMany=2