Historical Flight Delay API for Flight Delay Monitoring
Tags: api, flightdelayapi, historicalflightdata, flightapi
Published: 2023-07-10 08:38:00

Today, we want you to meet Aviyair’s Historical Flight Delay API to get all the details you need with historical flight delay information. With its versatile use case opportunities such as

-	Calculating the average flight delay and cancellation rate of an airport, airline or a certain flight or route,
-	Providing data-driven solutions to passengers and airlines about flight delay and cancellation claims,
-	Displaying real-time and historical flight delays to optimize and personalize travel and hospitality services,
-	Airline competition analysis,
-	Airport operation enhancement

…and much more, this **JSON REST API** can be just the data source. In this article, you can find the basics to learn more about the data and useful links like full documentation and getting the API key to start building today. TL;DR? Find the API key link below and test the API right away! 🛫


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tu5wmrk00usoj6b3izi1.jpeg)

<ol>
  <li><a href="#api-structure-and-languages-supported">API Structure and Languages Supported</a></li>
  <li><a href="#historical-flight-delay-api-200-ok-output">Historical Flight Delay API 200 OK Output</a></li>
  <li><a href="#getting-your-api-key">Getting Your API Key</a></li>
  <li><a href="#api-methods-and-parameters">API Methods and Parameters</a></li>
  <li><a href="#top-3-historical-flight-delay-api-use-cases">Top 3 Historical Flight Delay API Use Cases</a></li>
  <li><a href="#conclusion-and-API-key-link">Conclusion and API Key Link</a></li>
</ol>

----

## API Structure and Languages Supported

The Historical Flight Delay API uses **REST** structure which is a widely-adopted architectural style that has gained popularity due to its simplicity and ease of integration. Thanks to this structure’s ability to cache responses effectively, your product’s performance will be well-optimized and reduce the load on both client and the server. It’s a win-win for all! Another good use of the API’s structure is that it allows working with any major programming language like Python, PHP, Ruby, Swift, JavaScript, Go, and others, so it addresses developers of all backgrounds.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/770pbuzrja3xhfv67l7t.jpeg)

----

## Past Flight Delay API 200 OK Output

Before investing in, we’re sure you’d like to view an example output for the Past Flight Delay API first. You will find below a 200 OK successful response example for a single flight. Note that you can fetch the complete schedule for that date or just a single flight in one API call, but we’ve reduced the example to one flight so it’s easier on the eyes. 

The example is followed by a breakdown of each object in the output and their descriptions. If the detail you are looking for is not here, let us know and we’ll help you. For example, if you are aiming to display aircraft details along with the historical flight delay data, our other APIs could work nicely. The main advantage of this is that you’ll get to access everything with a single API key and data provider!

### API Output

```
{
  "status": {
    "message": "Success"
  },
  "results": {
    "status": {
      "message": "Success"
    },
    "results": {
      "airline": {
        "iataCode": "AF",
        "icaoCode": "AFR",
        "name": "Air France"
      },
      "arrival": {
        "actualRunway": "2022-08-11T11:48:00.000",
        "actualTime": "2022-08-11T11:48:00.000",
        "baggage": "05",
        "delay": null,
        "estimatedRunway": "2022-08-11T11:48:00.000",
        "estimatedTime": "2022-08-11T11:43:00.000",
        "gate": "2",
        "iataCode": "ORY",
        "icaoCode": "LFPO",
        "scheduledTime": "2022-08-11T12:00:00.000",
        "terminal": "2"
      },
      "departure": {
        "actualRunway": "2022-08-11T10:35:00.000",
        "actualTime": "2022-08-11T10:35:00.000",
        "baggage": "4",
        "delay": "6",
        "estimatedRunway": "2022-08-11T10:35:00.000",
        "estimatedTime": "2022-08-11T10:30:00.000",
        "gate": "2C",
        "iataCode": "NCE",
        "icaoCode": "LFMN",
        "scheduledTime": "2022-08-11T10:30:00.000",
        "terminal": "2"
      },
      "flight": {
        "iataNumber": "AF6209",
        "icaoNumber": "AFR6209",
        "number": "6209"
      },
      "status": "landed",
      "type": "arrival"
    }
  }
}
```


<table>
  <thead>
    <tr>
      <th>Object</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>status.message</td>
      <td>Status of the API request</td>
    </tr>
    <tr>
      <td>airline.iataCode</td>
      <td>The IATA code of the airline</td>
    </tr>
    <tr>
      <td>airline.icaoCode</td>
      <td>The ICAO code of the airline</td>
    </tr>
    <tr>
      <td>airline.name</td>
      <td>The name of the airline</td>
    </tr>
    <tr>
      <td>arrival.actualRunway</td>
      <td>Actual runway arrival time</td>
    </tr>
    <tr>
      <td>arrival.actualTime</td>
      <td>Actual arrival time</td>
    </tr>
    <tr>
      <td>arrival.baggage</td>
      <td>Baggage claim number</td>
    </tr>
    <tr>
      <td>arrival.delay</td>
      <td>Arrival delay in minutes</td>
    </tr>
    <tr>
      <td>arrival.estimatedRunway</td>
      <td>Estimated runway arrival time</td>
    </tr>
    <tr>
      <td>arrival.estimatedTime</td>
      <td>Estimated arrival time</td>
    </tr>
    <tr>
      <td>arrival.gate</td>
      <td>Arrival gate number</td>
    </tr>
    <tr>
      <td>arrival.iataCode</td>
      <td>The IATA code of the arrival airport</td>
    </tr>
    <tr>
      <td>arrival.icaoCode</td>
      <td>The ICAO code of the arrival airport</td>
    </tr>
    <tr>
      <td>arrival.scheduledTime</td>
      <td>Scheduled arrival time</td>
    </tr>
    <tr>
      <td>arrival.terminal</td>
      <td>Arrival terminal number</td>
    </tr>
    <tr>
      <td>departure.actualRunway</td>
      <td>Actual runway departure time</td>
    </tr>
    <tr>
      <td>departure.actualTime</td>
      <td>Actual departure time</td>
    </tr>
    <tr>
      <td>departure.baggage</td>
      <td>Baggage claim number at departure airport</td>
    </tr>
    <tr>
      <td>departure.delay</td>
      <td>Departure delay in minutes</td>
    </tr>
    <tr>
      <td>departure.estimatedRunway</td>
      <td>Estimated runway departure time</td>
    </tr>
    <tr>
      <td>departure.estimatedTime</td>
      <td>Estimated departure time</td>
    </tr>
    <tr>
      <td>departure.gate</td>
      <td>Departure gate number</td>
    </tr>
    <tr>
      <td>departure.iataCode</td>
      <td>The IATA code of the departure airport</td>
    </tr>
    <tr>
      <td>departure.icaoCode</td>
      <td>The ICAO code of the departure airport</td>
    </tr>
    <tr>
      <td>departure.scheduledTime</td>
      <td>Scheduled departure time</td>
    </tr>
    <tr>
      <td>departure.terminal</td>
      <td>Departure terminal number</td>
    </tr>
    <tr>
      <td>flight.iataNumber</td>
      <td>The IATA flight number</td>
    </tr>
    <tr>
      <td>flight.icaoNumber</td>
      <td>The ICAO flight number</td>
    </tr>
    <tr>
      <td>flight.number</td>
      <td>The flight number</td>
    </tr>
    <tr>
      <td>status</td>
      <td>The flight status</td>
    </tr>
    <tr>
      <td>type</td>
      <td>The type of flight data (arrival or departure)</td>
    </tr>
  </tbody>
</table>
----

Visit the full documentation below for everything.

{% embed https://aviyair.com/documentation/ %}

----


## Getting Your API Key

Getting your API key for the past flight delay data takes one minute only. Simply create an account on the below button and receive the unique API key to your email. Your access will renew every month automatically unless you cancel it to make sure your data flow is uninterrupted but it is possible to cancel any time before the renewal every month.

You can also start with a basic plan and upgrade later if you need more API calls along the way.

No hidden fees or unauthorized charges if you exceed your limit.

----

## API Methods and Parameters

The Past Flight Delay API routes rely on the GET method. By using only the obligatory parameters of the API key, airport IATA code and the schedule type, you will fetch the complete schedule of that date, with the total delay information included for each flight in the output.

✅ Delay is calculated in minutes.

✅ You can use filters to get a specific flight or airline.

✅ You can request consecutive historical dates at once.

<table>
  <thead>
    <tr>
      <th>Route</th>
      <th>Method</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>https://data.aviyair.com/data/v1/historicalschedule?key=APIKEY&amp;airport_iata=CGK&amp;type=departure&amp;date_from=2023-01-01</td>
      <td>GET</td>
      <td>Departure schedule of CGK on 2023-01-01 with delays for every flight</td>
    </tr>
    <tr>
      <td> https://data.aviyair.com/data/v1/historicalschedule?key=APIKEY&amp;airport_iata=CGK&amp;type=departure&amp;date_from=2023-01-01&amp;airline_iata=QZ</td>
      <td>GET</td>
      <td>Departure schedule of CGK on 2023-01-01 with delays for every flight of Indonesia AirAsia</td>
    </tr>
    <tr>
      <td> https://data.aviyair.com/data/v1/historicalschedule?key=APIKEY&amp;airport_iata=CGK&amp;type=departure&amp;date_from=2023-01-01&amp;airline_iata=QZ&amp;flight_number=265</td>
      <td>GET</td>
      <td>Delay data and other details for flight QZ265 on 2023-01-01</td>
    </tr>
  </tbody>
</table>

If you prefer ICAO codes instead, you can use these. For example, “airport_icao=”, “airline_icao=”, etc., are available. The full list of parameters is in the documentation.

Useful Tip: Aviyair’s historical flight delay data has GLOBAL coverage, meaning you can get all international airports worldwide and provide your services to a multinational clientele.

----

## Top 3 Historical Flight Delay API Use Cases

The historical flight delay and flight cancellation API has versatile use-case potential with its details for historical output for global flights. Here are the top 3 use cases of our clients for inspiration:

-	Flight delay and cancellation claims: The past flight delay and cancellation data is a good source for businesses that provide data-driven answers to passenger claims. 
-	Analyse average delay and cancellation rates: The historical data is useful to calculate the average delay and cancellation rates for airlines, airports or a specific route.
-	Optimize airport operations: The data also allows analyzing if there is a cumulation in delay for a certain terminal of an airport. With this data, airports can optimize and diversify their operations and manpower more logically.

**Tip:** Interested in increasing the online visibility of your solutions powered by Aviyair’s data? Send us an email about this and let’s talk about opportunities! 

----

## Conclusion and API Key Link

With this, we have talked about Aviyair’s Past Flight Delay and Cancellation API and how it can be a useful data source with its global, historical data. We mentioned that the data includes details such as airline, airport, scheduled/estimated/actual departure and arrival times, flight status, terminal, gate, baggage, delay and more. 

Access to the Historical Flight Delay and Cancellation API below is very easy and takes 1 minute. With their background in aviation, Aviyair team is here to help if you have any questions or request support. [**Contact Aviyair anytime.**](https://aviyair.com/contact-aviyair/)

{% embed https://aviyair.com/pricing-subscription-plans/ %}

**Tip:** If you need less or more API calls than our fixed plans, we can get you a custom offer.