Aviyair Historical Airline Schedules API Explanation
Tags: api, airlineapi, aviation, airlines
Published: 2023-09-25 09:00:00

[**Aviyair’s Historical Airline Schedules API**](https://aviyair.com/historical-airline-schedules-api-by-aviyair/) is a good find to fetch past schedules of airlines, globally. This useful API not only offers complete data but many other awesome features like support from a team experienced in aviation and travel, access to many other related APIs, a kick-ass SLA and more.

Below, we will mention the API’s routes, parameters, methods, request code and output examples with useful details. If you are the type of developer who likes to dive in head-on, find the documentation and API key links at the bottom to test the API yourself, blindfolded. 🤓


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

----

### Table of Contents
<ol>
  <li><a href="#historical-airline-schedules-api-structure-general-info">Historical Airline Schedules API General Info</a></li>
  <li><a href="#url-examples-with-api-methods-and-parameters">URL Examples with API Methods and Parameters</a></li>
  <li><a href="#example-request-code-and-output">Example Request Code and Output</a></li>
  <li><a href="#conclusion-and-getting-your-api-key">Conclusion and Getting Your API Key</a></li>
</ol>

----

## Historical Airline Schedules API Structure General Info

Here are a few initial things to know about the past airline schedules data before investing your time and how it can benefit you.

🔎 It is a **REST** API which will make the integration phase relatively easy for you. This is because REST is known for its high adaptability, optimization and success in caching responses effectively. It also allows you to work with pretty much any programming language easily without having to learn a whole bunch of brand-new methods and techniques.

🔎 The delivery format is **JSON** which is widely adaptable and easy to work on directly or convert. It is the format that everybody likes.

🔎 The API was developed by a team that’s experienced in the industry. If you are working on a solution for a travel or aviation platform, support that comes from people who have worked with a ton of businesses in the industry will be a plus.

🔎 You will have flexibility with the costs. On top of the support and access to good historical airline schedules data, Aviyair also helps developers save on costs by applying great discounts for the first 2 weeks. We understand the importance of testing, and by testing we don’t mean just a few API calls but the start of the whole integration. We are also open to discussing custom plans you can afford, based on your unique requirements.


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

----

## URL Examples with API Methods and Parameters

All routes of the Past Airline Schedules API use the GET method. The **“&airport_iata=”**, **“&type=”** and **“&date_from=”** parameters are obligatory in the URL.

- Add _"&date_to="_ to specify a date range. Remember that the date range cannot be too far but you can request different ranges and different days under different API calls simultaneously.
- Add _"&airline_iata="_ to specify the airline.
- Add _"&flight_num="_ to track the record of a single flight.

<table>
  <thead>
    <tr>
      <th>URL Example</th>
      <th>Method</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>https://data.aviyair.com/data/v1/historicalschedule?key=APIKEY&amp;airport_iata=DEL&amp;type=departure&amp;date_from=2023-04-17&amp;airline_iata=SG</td>
      <td>GET</td>
      <td>All flights of SpiceJet departing from DEL on 2023-04-17</td>
    </tr>
    <tr>
      <td> https://data.aviyair.com/data/v1/historicalschedule?key=APIKEY&amp;airport_iata=DEL&amp;type=arrival&amp;date_from=2023-04-17&amp;date_to=2023-04-19&amp;airline_iata=SG </td>
      <td>GET</td>
      <td> All flights of SpiceJet arriving at DEL between 2023-04-17 and 2023-04-19 (3 days included)</td>
    </tr>
    </tr>
    <tr>
      <td> https://data.aviyair.com/data/v1/historicalschedule?key=APIKEY&amp;airport_iata=DEL&amp;type=arrival&amp;date_from=2023-05-03&amp;airline_iata=SG&amp;flight_number=54</td>
      <td>GET</td>
      <td>Schedule data of SpiceJet’s flight SG54 on 2023-05-03</td>
    </tr>
  </tbody>
</table>

----

## Example Request Code and Output

Use the simple code for Python below to request data from the Past Airline Schedules API. Unsuccessful calls will not hurt your API call limit. 


```python
import requests

url = "https://data.aviyair.com/data/v1/historicalschedule?"
params = {
    "apiKey": "APIKEY",
    "airport_iata": "JFK",
    "type": "departure",
    "date_from": "2022-08-01",
    "date_to": "2022-08-10",
    "airline_iata": "AA",
}

response = requests.get(url, params=params)

if response.status_code == 200:
    data = response.json()
    print(data)
else:
    print("Error:", response.status_code)
```

-----

Check out what the historical airline schedules data looks like for every flight of the airline in the response.

```
{
  "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"
    }
  }
}
```
-----

### Object Table and Descriptions

<table>
  <thead>
    <tr>
      <th>Object</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>status</td>
      <td>Status of the API request</td>
    </tr>
    <tr>
      <td>airline.iataCode</td>
      <td>The airline IATA code</td>
    </tr>
    <tr>
      <td>airline.icaoCode</td>
      <td>The airline ICAO code</td>
    </tr>
    <tr>
      <td>airline.name</td>
      <td>The name of the airline</td>
    </tr>
    <tr>
      <td>arrival.actualRunway</td>
      <td>Actual runway time at arrival</td>
    </tr>
    <tr>
      <td>arrival.actualTime</td>
      <td>Actual arrival time</td>
    </tr>
    <tr>
      <td>arrival.baggage</td>
      <td>Baggage belt number</td>
    </tr>
    <tr>
      <td>delay</td>
      <td>Flight delay measured 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</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>Departure airport IATA code</td>
    </tr>
    <tr>
      <td>departure.icaoCode</td>
      <td>Departure airport ICAO code</td>
    </tr>
    <tr>
      <td>departure.scheduledTime</td>
      <td>Scheduled departure time</td>
    </tr>
    <tr>
      <td>departure.terminal</td>
      <td>Departure terminal</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>Latest recorded flight status</td>
    </tr>
    <tr>
      <td>type</td>
      <td>The type of flight data (arrival or departure)</td>
    </tr>
  </tbody>
</table>

----

See the full documentation below.

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

----

## Conclusion and Getting Your API Key

The Historical Airline Schedules Data is pretty much a one-in-all solution to integrate into travel and aviation projects. 

- It provides **airline codes/names, flight numbers, flight status and delay, gate, baggage belt, terminal, scheduled and actual departure and arrival times and much more** with a single API. Analyze airline and route performance, display past airline schedules and build personalized and optimized solutions that rely on data. 

- Thanks to the **global coverage** of the Historical Airline Schedule API, your solutions will answer every market.

- You can [**contact Aviyair anytime.**](https://aviyair.com/contact-aviyair/) for your questions and support requests.

Get your API key today!
{% embed https://aviyair.com/pricing-subscription-plans/ %}

----- 

> Tips to keep in mind:
>  
> ✅ You can cancel your subscription anytime. The access comes as a subscription, only to ensure that your data flow is flawless and uninterrupted. We don’t ask for any commitments.
> ✅ There are no hidden or extra fees. We will not charge you extra if you accidentally reach your past airline timetables API limit. The API will simply give you a warning so you can go and easily upgrade your plan on your dashboard.

----

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