-
Notifications
You must be signed in to change notification settings - Fork 8
Cannot pull in live data from API for the flights #5
Comments
Luke, 'live' is null when there is no live data for the flight (not being cute) This makes sense because look at the "flight_status" variable - its "scheduled" which means the aircraft hasn't taken off, it just has a flight plan filed, definitely isn't airborne. If you're only looking for live data then filter your API request to 'flight_status' : 'active' to only get flights that are currently in the air which have a better chance of containing 'live' data which will look something like this instead of null: Hope this helps! I've been knee deep in this API for a class so getting fairly familiar with it, let me know if you have other questions! -jinxyCat14 |
Hi jinxyCat14, If the lack of real-time data is understandable, then why is the data of aircraft also null, I need this data.So I'm trying to figure this out. Looking forward to your reply. Jaryn |
Good question, the other fields that are null are all sections that may not be populated yet. A flight that is only scheduled obviously doesn’t have any ‘actual’ data - it only exists inside the computer system. The null fields will become filled with data when the flight becomes ‘active’. |
Did you ever figure this out? @lukemenziesAA |
I am getting same for flight_status=active, {
|
@JonasJ96 @lukemenziesAA |
@alihamza-14 haven't touched the API in over a year but just ran another API pull. Best I can guess is that the majority of 'active' flights that do not have "live" information. I only have the free version so can't get you better stats but only 5 of the 100 flights had updated 'live' info with a lat/long the rest were null. Of those 5 with live data only 4 were in the air with one on the ground. Hopefully that helps? |
Hi,
I am trying to pull in live data from the API for the flights but it keeps returning a null response in the live section of the json.
I am using the following command
https://api.aviationstack.com/v1/flights?access_key=*access_kay*&limit=10&offset=0
I am using a basic plan? I get the following response
{
"pagination": {
"limit": 10,
"offset": 0,
"count": 10,
"total": 9594200
},
"data": [ ...
{
"flight_date": "2022-05-18",
"flight_status": "scheduled",
"departure": {
"airport": "Kingsford Smith",
"timezone": "Australia/Sydney",
"iata": "SYD",
"icao": "YSSY",
"terminal": null,
"gate": null,
"delay": null,
"scheduled": "2022-05-18T03:15:00+00:00",
"estimated": "2022-05-18T03:15:00+00:00",
"actual": null,
"estimated_runway": null,
"actual_runway": null
},
"arrival": {
"airport": "Adelaide International Airport",
"timezone": "Australia/Adelaide",
"iata": "ADL",
"icao": "YPAD",
"terminal": null,
"gate": null,
"baggage": null,
"delay": null,
"scheduled": "2022-05-18T05:00:00+00:00",
"estimated": "2022-05-18T05:00:00+00:00",
"actual": null,
"estimated_runway": null,
"actual_runway": null
},
"airline": {
"name": "Qantas",
"iata": "QF",
"icao": "QFA"
},
"flight": {
"number": "7448",
"iata": "QF7448",
"icao": "QFA7448",
"codeshared": null
},
"aircraft": null,
"live": null
}
]
}
If someone can give some insight into what is going wrong, I would be most grateful.
Thanks
Luke
The text was updated successfully, but these errors were encountered: