How to Calculate Flight Delays with an API

In this article, we will explain “How to Calculate Flight Delays with an API” which is a subject that triggers the interest of flight compensation claim agencies, flight insurance companies, airlines, travel agencies among many others in the aviation sector.

Flight delays are subject to compensation on behalf of passengers. Considering there are literally thousands of flights that delay every day by tens of different airlines, flight delay data is hard to collect and maintain on your own. What we offer is the Aviation Edge Flight Delay API which collects, aggregates, and stores flight delay data for you, and returns you whenever you request, based on the parameters you specify.

Flight Delay API – How Does It Work Exactly?

The Flight Delay API basically works as a historical flight schedule API. It stores the real-time airport schedule data globally and expands every day so that you can view these as historical data later on, whenever you want. How to calculate flight delays with an API depends on the ability of the data to return delay data in a way that you can correspond this to other details of the flight.

The details for each flight in the response include:

  • Flight number,
  • Airline details,
  • Departure and arrival airports,
  • Scheduled and actual times,
  • Last recorded flight status,
  • Delays (if any),

making the API a good, all-in-one source for flight delay data.

So, what about filters? I will need to request the exact flight I need. The Flight Delay API normally returns one schedule at a time (either the departure or the arrival schedule of 1 airport). However, it is possible to use certain filters rather than getting the whole schedule and picking over the flights you are interested in among all.

This is the main input for the whole schedule, with the minimum number of parameters requested. In other words, every parameter in this input is obligatory:

http://aviation-edge.com/v2/public/flightsHistory?key=[API_KEY]&code=JFK&type=departure&date_from=YYYY-MM-DD

What you can do is add the following parameters in this input to filter the data. Please note that the filters are limited to these and not every value in the response can be used as a filter:

  • &date_to= end of the date range
  • &dep_iataCode= departure airport if the main input is an arrival schedule
  • &arr_iataCode= arrival airport if the main input is a departure schedule
  • &airline_iata= airline filter
  • &flight_num= flight number filter
  • &status= last recorded status (delay is not a status but specified for every flight. This filter is particularly useful if you are looking for canceled flights)

Flight Delay Prediction API

In order to calculate the average delay rate of an airline or a specific route, you would need aggregated flight delay data which our Flight Delay Prediction API can get you.

The API allows requesting delay data based on a date or date range in the past. This way, you can determine a certain period in time and collect all the times the flight was delayed and for how long it was delayed. You can use this to create statistics to approximately estimate the delays of this flight in the future and build a database about this.

For example, you can request the below input 12 times, each covering a period of 30 days:

http://aviation-edge.com/v2/public/flightsHistory?key=[API_KEY]&code=JFK&type=departure&date_from=YYYY-MM-DD&date_to=YYYY-MM-DD&flight_number=1234&airline_iata=AB

At the end of 12 calls, you will get how many times flight “AB1234” operated, how many times it was delayed, and for how long it was delayed within a year.

*** Please note that the API basically requests the complete airport schedule and you are filtering the complete schedule. As a result, the 30-day period may be shorter down to 3-5 days for some airports with large traffic, such as JFK. In this case, you may simply make more calls covering shorter periods with the Flight Delay Prediction API.

Calculate Flight Delays with an API – Get Started Now!

Sounds interesting enough? Getting started is just as easy! Access to the API comes with an API subscription. Different plans are available for your requirements. Simply choose the best option for you below and create your API subscription in a minute. Your API key will be automatically sent to your email address in a fully active way. Start requesting data with your key right away!

Want to learn more? Visit the product page here!

Have any questions? Contact us!

Related APIs

Flight Tracker API

Aviation Edge Flight Tracker API provides detailed data on live, airborne flights. The data is aggregated from…

Flight Schedules API

The Schedules API service provides the flight schedules and timetables of all airports and airlines around the world…

Airline Routes API

The Airline Routes API provides the data about the routes between all the airports an airline operates on. The service…

Flight Delay API

The Flight Delay API service provides historical flight schedule and timetables data of all airports and airlines around the world. …

Aviation Database

Our databases are categorized as airport database, aircraft database, airline database, city database, country database, aviation taxes… 

Get the Free API now!

Get our free API here or by clicking the button below. Fill in the basic form and test the power of our API with the free version. Consult our Premium page for our offers.