Hello,
My script scrapes the timestamps of the last completed flight of a given registration using:
/history/aircraft/{registration}/last_flight
However on some occasions i noticed the script returns the timestamps of the upcoming flight instead of the last completed flight. Since the “upcoming flight” is not completed or not even started i get “actual_X” timestamps as Nonetype sometimes.
Example:
Json output at the same time above ss was taken:
{
"flights": [
{
"ident": "AVA5",
"ident_icao": "AVA5",
"ident_iata": "AV5",
"actual_runway_off": null,
"actual_runway_on": null,
"fa_flight_id": "AVA5-1746856134-airline-1479p",
"operator": "AVA",
"operator_icao": "AVA",
"operator_iata": "AV",
"flight_number": "5",
"registration": "N446AV",
"atc_ident": null,
"inbound_fa_flight_id": "AVA8-1746770123-airline-2117p",
"codeshares": [
"GLO5831",
"AVA5",
"TAP7309",
"UAL6656"
],
"codeshares_iata": [
"G35831",
"AV5",
"TP7309",
"UA6656"
],
"blocked": false,
"diverted": false,
"cancelled": false,
"position_only": false,
"origin": {
"code": "KMIA",
"code_icao": "KMIA",
"code_iata": "MIA",
"code_lid": "MIA",
"timezone": "America/New_York",
"name": "Miami Intl",
"city": "Miami",
"airport_info_url": "/airports/KMIA"
},
"destination": {
"code": "SKBO",
"code_icao": "SKBO",
"code_iata": "BOG",
"code_lid": null,
"timezone": "America/Bogota",
"name": "El Dorado Int'l",
"city": "Bogota",
"airport_info_url": "/airports/SKBO"
},
"departure_delay": 2400,
"arrival_delay": 3060,
"filed_ete": 12060,
"foresight_predictions_available": null,
"scheduled_out": "2025-05-12T11:55:00Z",
"estimated_out": "2025-05-12T12:35:00Z",
"actual_out": null,
"scheduled_off": "2025-05-12T12:05:00Z",
"estimated_off": "2025-05-12T12:45:00Z",
"actual_off": null,
"scheduled_on": "2025-05-12T15:26:00Z",
"estimated_on": "2025-05-12T16:06:00Z",
"actual_on": null,
"scheduled_in": "2025-05-12T15:25:00Z",
"estimated_in": "2025-05-12T16:16:00Z",
"actual_in": null,
"progress_percent": 0,
"status": "Scheduled / Delayed",
"aircraft_type": "A320",
"route_distance": 1515,
"filed_airspeed": 459,
"filed_altitude": 350,
"route": "NNOCE2 URSUS UP406 AKPEK UQ121 ISVAT ISVA4E",
"baggage_claim": "3",
"seats_cabin_business": null,
"seats_cabin_coach": null,
"seats_cabin_first": null,
"gate_origin": "J16",
"gate_destination": null,
"terminal_origin": null,
"terminal_destination": "1",
"type": "Airline"
}
]
}
As you can see the output is for the scheduled flight. Is this the correct logic here? Shouldn’t i be getting the json body of the actual completed flight instead of the upcoming one?
Thank you.