I’ve Recently Discovered This Historical Flight Delay API

Rima MannRima Mann
4 min read

I’m currently working on an app where one feature of it will be the users to track historical flight delays and cancellations. For this, I started out by looking for the best possible historical flight delay API. Since I don’t expect the project to return any income right away, my two priorities were that the API is affordable and I have a real person to contact for my questions. Hence, I’ve found Aviyair's API and it’s all going well so far. In case you are interested in similar data, here are my two cents on it so you don’t have to start looking from scratch 🤓


First Few Things to Know About This Historical Flight Delay API

🤖 Disclaimer: Since I am a beginner in app development, I am not looking for anything too complicated and I’m sorry in advance if this article does not overflow with useful codes. However, I can say that for this historical flight delay API to have the REST structure has been of great help. REST probably has the widest adoption of all and you can find tons of tutorials and libraries online which has been useful.

For this project, I’m using the historical flight delay API to deliver my client JSON responses. I haven’t checked if the API supports other formats such as CSV but if you are interested in other formats, it doesn’t hurt to contact them to request this.

1) Now, here’s what the data looked like when I requested historical schedule data of LAX on March 14th this year. I obviously will not share my API key here but I’ve used this URL to see the raw data first:

  • https://data.aviyair.com/data/v1/flightdelay?key=apikey&airport_iata=LAX&type=arrival&date_from=2023-03-14

  • Output for British Airways flight BA4757 codeshared by American Airlines flight AA297:

{
"type": "departure",
"status": "active",
"departure": {
"iataCode": "lax",
"icaoCode": "klax",
"terminal": "5",
"gate": "51b",
"delay": 33,
"scheduledTime": "2023-03-13T17:00:00.000",
"estimatedTime": "2023-03-13T17:33:00.000",
"actualTime": "2023-03-13T17:32:00.000",
"estimatedRunway": "2023-03-13T17:32:00.000",
"actualRunway": "2023-03-13T17:32:00.000"
},
"arrival": {
"iataCode": "hnl",
"icaoCode": "phnl",
"terminal": "2",
"baggage": "21",
"gate": "c3",
"scheduledTime": "2023-03-13T20:04:00.000",
"estimatedTime": "2023-03-13T19:52:00.000"
},
"airline": {
"name": "british airways",
"iataCode": "ba",
"icaoCode": "baw"
},
"flight": {
"number": "4757",
"iataNumber": "ba4757",
"icaoNumber": "baw4757"
},
"codeshared": {
"airline": {
"name": "american airlines",
"iataCode": "aa",
"icaoCode": "aal"
},
"flight": {
"number": "297",
"iataNumber": "aa297",
"icaoNumber": "aal297"
}
}
}

Delay data is there for all flights in the output, so your app can display relevant delay data for all flights of that schedule in bulk or a specific flight even, depending on which parameters you use to filter the complete historical flight delay data.


Getting Historical Flight "Cancellation" Data

Flight cancellation data is just as important as the historical flight delay data for this project because it focuses on the final status of flights. A flight could have been canceled at an earlier date or on the flight’s date after being delayed for a certain time. Luckily, you can tell this final status by the past flight delay API.

2) Since it is possible to filter flights by the final status, I’ve next fetched all canceled flights in the same schedule by using this URL:

  • https://data.aviyair.com/data/v1/flightdelay?key=apikey&airport_iata=LAX&type=arrival&date_from=2023-03-14&status=cancelled

  • Output for the canceled Qatar Airways flight QR2951 codeshared by Alaska Airlines flight AS3358. The historical flight cancellation data output showed me that this flight was canceled after being delayed for a total of 22 minutes.

{
"type": "departure",
"status": "cancelled",
"departure": {
"iataCode": "lax",
"icaoCode": "klax",
"terminal": "6",
"gate": "67",
"delay": 22,
"scheduledTime": "2023-03-13T17:30:00.000",
"estimatedTime": "2023-03-13T17:52:00.000"
},
"arrival": {
"iataCode": "sjc",
"icaoCode": "ksjc",
"terminal": "b",
"gate": "21",
"scheduledTime": "2023-03-13T18:51:00.000"
},
"airline": {
"name": "qatar airways",
"iataCode": "qr",
"icaoCode": "qtr"
},
"flight": {
"number": "2951",
"iataNumber": "qr2951",
"icaoNumber": "qtr2951"
},
"codeshared": {
"airline": {
"name": "alaska airlines",
"iataCode": "as",
"icaoCode": "asa"
},
"flight": {
"number": "3358",
"iataNumber": "as3358",
"icaoNumber": "asa3358"
}
}
}

Final Thoughts and Getting an API Key

Overall, I found Aviyair’s past flight delay data to be useful and pretty much exactly what I am looking for 👍🏼 The feature I am looking the use the API for aims to display past flight delay and cancellation data which this API delivers. Since the output includes other relevant data like flight numbers, airline, codeshared details, gate, terminal, status, baggage, etc., it should be useful for any past flight data-related projects.

📌 I’d give the past flight delay API a 9/10 and worth investing in.

📌 Another advantage of it has been that I was able to get quick answers to my questions through their email support because hallelujah, finally a data provider replies to me without making me wait for a week with no real answers. Can use this link to get an API key yourself.

📌 Apparently, I can access all their APIs with my key, so to make sure my subscription does not to waste I will test others and try to build some more similar but different features. Stay tuned for upcoming API reviews!


Feel free to comment with your thoughts! I'm looking forward to discovering new APIs with the community!


0
Subscribe to my newsletter

Read articles from Rima Mann directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Rima Mann
Rima Mann

I've been an aviation enthusiast for as long as I can remember. Working on improving my skills in programming with a focus on app development. Mostly sharing good data finds here. Dad of 2 🤓