FlightRadarAPI icon indicating copy to clipboard operation
FlightRadarAPI copied to clipboard

Discrepancies in flight data

Open daniel-yang66 opened this issue 2 years ago • 4 comments

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

daniel-yang66 avatar Apr 17 '24 07:04 daniel-yang66

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!

JeanExtreme002 avatar Apr 19 '24 02:04 JeanExtreme002

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. D814DC75-B45E-4B04-AAE2-DCEFC36E9248 C3477C48-805B-40B5-9852-4363654E4911

daniel-yang66 avatar Apr 19 '24 05:04 daniel-yang66

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.

daniel-yang66 avatar Apr 19 '24 06:04 daniel-yang66

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 1DB25431-E8A1-45CA-8CB4-446887CB0825 617D592B-44C6-4A47-8AA3-C396801CD243

daniel-yang66 avatar Apr 20 '24 01:04 daniel-yang66

Could you share your code here? How are you getting the flights?

JeanExtreme002 avatar Apr 29 '24 17:04 JeanExtreme002

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.

image

JeanExtreme002 avatar Apr 29 '24 19:04 JeanExtreme002

See this other example:

image

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.

JeanExtreme002 avatar Apr 29 '24 19:04 JeanExtreme002

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

daniel-yang66 avatar Apr 29 '24 20:04 daniel-yang66

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

daniel-yang66 avatar Apr 29 '24 20:04 daniel-yang66

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?

JeanExtreme002 avatar Apr 29 '24 22:04 JeanExtreme002

Screenshot (246) UAL888

daniel-yang66 avatar Apr 29 '24 22:04 daniel-yang66

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

daniel-yang66 avatar Apr 29 '24 22:04 daniel-yang66

Screenshot (247) UAL888 status currently

daniel-yang66 avatar Apr 29 '24 23:04 daniel-yang66

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.

JeanExtreme002 avatar Apr 30 '24 01:04 JeanExtreme002

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

daniel-yang66 avatar Apr 30 '24 02:04 daniel-yang66

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.

daniel-yang66 avatar May 01 '24 21:05 daniel-yang66

Unfortunately, no...

JeanExtreme002 avatar May 02 '24 03:05 JeanExtreme002

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.

JeanExtreme002 avatar May 03 '24 03:05 JeanExtreme002