Discrepancies in flight data
Hey there Jean, I emailed you about the issue too but I’ll post here as well. So I notice some discrepancies between your data vs Flightradar24. For example between airports A and B there could be 5 flights but your data may only show 4 flights. Another scenario is when there is a flight from A to B the flight shows up in the arrivals info for B but does not show up in departures info for A.
Really nice API. Appreciate all the hard work
Hi @daniel-yang66!
I tried to reproduce the problem but it seems the same to the website. By the way, all data collected by this project come from the website, then it is supposed both of them have the same result...
Which airport did you track? Did you request the flights only once or more times?
Maybe it is an unexpected behavior of the website. I'll keep checking it further. Could you try reproducing the problem again and tell me here the airports and the radius of the area you are tracking? If the problem comes back, tell me if you can solve it by increasing the radius of the tracking area.
Thank you in advance for the report!
Thanks for responding Jean. Take for example SFO to PEK. There is a United flight UA888 everyday. But it fails to appear as live when I use the get airport details method. The flight may be there sometimes but it is marked as not live. Note the 2 pictures below where the discrepancy is. The flight is live in the flight radar app but not seen when I use your api to display it on my dashboard.
The vast majority of the time, your data is correct but it is quite random where the discrepancies occur. Like one day the sfo to pek route is fine but another example would be LAX to NRT where discrepancies occur.
See below for 4 flights live from SFO to NRT while only one shows up on my map. They seem to be labeled as not live in your json response when I call the get airport details method and go to departures
Could you share your code here? How are you getting the flights?
I was running some tests at that airport (by the way, sorry for the delay in responding, I've been really busy in the past few weeks), and I think I've understood the issue. I believe there's some confusion here.
I think that "live" on the website is different from the "live" returned in the flight status in the code. It indicates that the flight hasn't started yet. As you can see in the image below, after a certain time, the status changed from False to True. The get_flights() method usually doesn't return flights that haven't started or have already ended.
See this other example:
The flight UAL901 was labeled as LIVE, but the status -> live attribute was indicating the flight hasn't started. Just wait sometime until the attribute become True.
Oh okay I see what you are saying. So the 'live' in your API indicates 'start/ no start'. How is that determined? Engines running? Aircraft ADS-B turned on? Thank you fore responding and understanding my question
What if an aircraft is in mid-air? Shouldn't that also be labelled as 'live'? Because I notice sometimes that aircraft in mid-air are labelled as not live
Sorry, but I really don't know. This is just a raw information returned from flightradar24's server. I guess that status is determined when pilot set the transponder, but I am not sure.
But if the aircraft is in air, it's supposed to be labelled as live. Could you show me some example of an aircraft in mid-air labelled as not live?
UAL888
It is currently in the air on flightradar24. And regarding the definition of 'live' no worries.
My dashboard which uses your API is here: https://github.com/daniel-yang66/flight-analytics.
If you want to see my code logic, go to line 222 in the app.py file. Also, shameless plug but feel free to feature this dashboard on your api page if you feel like it
UAL888 status currently
Um... I really don't know what's going on. Most likely a bug in the platform.
Anyway, a solution to this problem would be for you to check if the flight is live by attempting to retrieve it using the get_flights method, passing either the airline code or its registration number.
If it's not returned by get_flights, then it's certainly not live. If it is returned by the method then it's certainly live.
Okay, sounds good. That solution will work but it will be more costly in terms of performance. Not a huge deal but left me know if you discover the root issue some time. Thanks for your effort
Hey there Jean, Got a question. So is there a way to see all flights in one api call? I am currently using the pages argument but I want to reduce the api calls if possible. An airport can have like 12 pages of departures so that means the api will be called 12 times to see each page. I just don't want to overwhelm the api or something while reducing page load times.
Unfortunately, no...
I'm closing this issue for now, because the problem of the issue is out of our control. But when the situation changes or I get any update about what is happening, I'll open it again, bringing more information.