Introducing Aviyair’s Current Airport Schedules API
Tags: api, airportdata, airportschedules, airportapi
Published: 2023-11-06 08:07:00

Hello, developers of dev.to! Today, we wanted to you to meet [Aviyair’s Current Airport Schedules API](https://aviyair.com/current-airport-schedules-api/) which is an optimal data tool to fetch real-time timetable data of airports worldwide. With its constant updates and detailed coverage, you will find this API good enough to invest your time in 🤓

In this article, we will show you all the basics like example 200 OK output, object descriptions, request codes and what other APIs you can combine this one with. You will find useful links at the bottom such as the full documentation and where to get your **API key**.

----

### Table of Contents
<ol>
  <li><a href="#what-is-the-current-airport-schedules-api-about">What is the Current Airport Schedules API About</a></li>
  <li><a href="#url-methods-and-parameters">URL Methods and Parameters</a></li>
  <li><a href="#example-python-request-code-and-200-ok-output-with-descriptions">Example Python Request Code and 200 OK Output with Descriptions</a></li>
  <li><a href="#generating-an-api-key-and-requesting-support">Generating an API Key and Requesting Support</a></li>
</ol>


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

----

## What is the Current Airport Schedules API About

The Current Airport Schedules API is a **REST API**, which means it’s simple, scalable and highly adaptable. Using HTTP requests via the GET method, the API delivers data in **JSON**. As you know, JSON is a lightweight, flexible and easy-to-read data format that is widely used with REST APIs for its speed, accessibility and making way to build powerful web applications. 

The API delivers current airport schedules data and updates constantly, allowing you to display virtual, real-time airport timetables on your website or app. The real-time updates include the flight status, current delay and estimated departure and arrival times among many other essential info. Especially the real-time flight delay data and the status plays a big role in many travel and aviation-related apps where it is essential for the service provider to keep track of the last-minute changes in their customers’ flights.

> **By integrating the API, you can build push notifications for flight cancellations, delays, gate and terminal information or display a virtual map of airport traffic, all updated in real-time.**

Now let’s see how to fetch data, what the delivered current airport schedules data looks like and break down the objects in the response.

----

## URL Methods and Parameters

**Server:** `https://data.aviyair.com/data/v1/`
**Endpoint:** /liveschedule?
**Obligatory parameters:** airport_iata and type
**Optional parameters:** status, departure_iata, departure_icao, departure_terminal, departure_delay, departure_sch_time, departure_est_time, departure_act_time, departure_est_runway, departure_act_runway, arrival_iata, arrival_icao, arrival_terminal, arrival_delay, arrival_sch_time, arrival_est_time, arrival_act_time, arrival_est_runway, arrival_act_runway, airline_name, airline_iata, airline_icao, flight_number, flight_iata and flight_icao
**Method:** GET

### Example URLs

<table>
  <thead>
    <tr>
      <th>URL Example</th>
      <th>Method</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>https://data.aviyair.com/data/v1/liveschedule?key=APIKEY&amp;airport_iata=DEL&amp;type=departure</td>
      <td>GET</td>
      <td>The real-time schedule of DEL’s departures</td>
    </tr>
    <tr>
      <td> https://data.aviyair.com/data/v1/liveschedule?key=APIKEY&amp;airport_iata=DEL&amp;type=departure&amp;status=cancelled</td>
      <td>GET</td>
      <td>All currently canceled flights departing from DEL. The status can also be set as active, started, en-route, landed and unknown</td>
    </tr>
    </tr>
    <tr>
      <td> https://data.aviyair.com/data/v1/liveschedule?key=APIKEY&amp;airport_iata=DEL&amp;type=arrival&amp;airline_iata=SG&amp;flight_number=54</td>
      <td>GET</td>
      <td>Current schedule info of SpiceJet’s flight SG54</td>
    </tr>
  </tbody>
</table>

----

## Example Python Request Code and 200 OK Output with Descriptions

You can use the below code for Python to request current airport schedule data in JSON format. If the call is unsuccessful for any reason, this will not consume calls from your API call limit. 

```python
import requests

url = "https://data.aviyair.com/data/v1/liveschedule"
params = {
    "key": "[API_KEY]",
    "airport_iata": "GRU",
    "status": "cancelled"
}

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

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

-----

### Successful Current Airport Timetable Data Output 

```
{
  "status": {
    "message": "Success"
  },
  "results": {
    "airline": {
      "iataCode": "ID",
      "icaoCode": "BTK",
      "name": "Batik Air"
    },
    "arrival": {
      "actualRunway": "2023-03-15T14:23:00.000",
      "actualTime": "2023-03-15T14:23:00.000",
      "baggage": null,
      "delay": null,
      "estimatedRunway": "2023-03-15T14:23:00.000",
      "estimatedTime": "2023-03-15T14:21:00.000",
      "gate": null,
      "iataCode": "MKZ",
      "icaoCode": "WMKM",
      "scheduledTime": "2023-03-15T14:50:00.000",
      "terminal": null
    },
    "codeshared": null,
    "departure": {
      "actualRunway": "2023-03-15T12:49:00.000",
      "actualTime": "2023-03-15T12:49:00.000",
      "baggage": null,
      "delay": "4",
      "estimatedRunway": "2023-03-15T12:49:00.000",
      "estimatedTime": null,
      "gate": null,
      "iataCode": "PKU",
      "icaoCode": "WIBB",
      "scheduledTime": "2023-03-15T12:45:00.000",
      "terminal": null
    },
    "flight": {
      "iataNumber": "ID311",
      "icaoNumber": "BTK311",
      "number": "311"
    },
    "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>The overall status of the API response</td>
    </tr>
    <tr>
      <td>status.message</td>
      <td>The status message indicating if the request was successful</td>
    </tr>
    <tr>
      <td>airline</td>
      <td>Information about the airline</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</td>
      <td>Information about the flight's arrival</td>
    </tr>
    <tr>
      <td>arrival.actualRunway</td>
      <td>The actual runway arrival time</td>
    </tr>
    <tr>
      <td>arrival.actualTime</td>
      <td>The actual arrival time</td>
    </tr>
    <tr>
      <td>arrival.baggage</td>
      <td>The baggage claim information (if available)</td>
    </tr>
    <tr>
      <td>arrival.delay</td>
      <td>The arrival delay (in minutes)</td>
    </tr>
    <tr>
      <td>arrival.estimatedRunway</td>
      <td>The estimated runway arrival time</td>
    </tr>
    <tr>
      <td>arrival.estimatedTime</td>
      <td>The estimated arrival time</td>
    </tr>
    <tr>
      <td>arrival.gate</td>
      <td>The arrival gate information (if available)</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>The scheduled arrival time</td>
    </tr>
    <tr>
      <td>arrival.terminal</td>
      <td>The arrival terminal information (if available)</td>
    </tr>
    <tr>
      <td>codeshared</td>
      <td>Information about codeshare agreements (if applicable)</td>
    </tr>
    <tr>
      <td>departure</td>
      <td>Information about the flight's departure</td>
    </tr>
    <tr>
      <td>departure.actualRunway</td>
      <td>The actual runway departure time</td>
    </tr>
    <tr>
      <td>departure.actualTime</td>
      <td>The actual departure time</td>
    </tr>
    <tr>
      <td>departure.baggage</td>
<td>The baggage check-in information (if available)</td>
    </tr>
    <tr>
      <td>departure.delay</td>
      <td>The departure delay (in minutes)</td>
    </tr>
    <tr>
      <td>departure.estimatedRunway</td>
      <td>The estimated runway departure time</td>
    </tr>
    <tr>
      <td>departure.estimatedTime</td>
      <td>The estimated departure time</td>
    </tr>
    <tr>
      <td>departure.gate</td>
      <td>The departure gate information (if available)</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>The scheduled departure time</td>
    </tr>
    <tr>
      <td>departure.terminal</td>
      <td>The departure terminal information (if available)</td>
    </tr>
    <tr>
      <td>flight</td>
      <td>Information about the flight itself)</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's current status (e.g., "landed")</td>
    </tr>
    <tr>
      <td>type</td>
      <td>The flight type (e.g., "arrival")</td>
    </tr>
  </tbody>
</table>

----

> **Tip:** Some objects may appear null in the current airport schedules data output if a value (number) is not assigned IRL. For example, some airports may have one gate or one terminal and in this case, a number may not have been assigned to them.

------

### Documentation

Visit the full documentation for both the Current Airport Timetables API and others below.

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

----

## Generating an API Key and Requesting Support

In summary, the Current Airport Timetables API is a REST API that delivers real-time airport schedule data with constant real-time updates. The JSON output includes necessary details like **real-time flight status** (with cancellations) and **delay, departure and arrival airports, flight number and airline details, scheduled/estimated/actual departure and arrival times with terminal, gate and baggage.**

The API access takes one minute and [**we will provide support**](https://aviyair.com/contact-aviyair/)  before and after you sign up, every step of the way. It is a good choice as a data tool to integration into powerful projects. It has global coverage for airports.

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

----- 

✅  Cancel your subscription anytime. No commitments.
✅  You will not get charged more if you reach your API call limit. No hidden fees.
✅  Upgrade your plan anytime if you need more calls.

----

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