# FLIGHT-TRACK

## AirLabs documentation

{% embed url="<https://airlabs.co/docs/flights>" %}

## Usage

1\. Making an HTTP request via a web browser or API platform etc.[ ](https://www.postman.com/)[Postman](https://www.postman.com/).

2\. The following parameters are accepted:

<table data-header-hidden><thead><tr><th width="170.33333333333331">Name</th><th>Description</th><th>Format</th></tr></thead><tbody><tr><td>flag</td><td>ISO 2 country code</td><td>E.g. MY</td></tr><tr><td>airline_iata</td><td>Airline IATA code</td><td>E.g. MH</td></tr><tr><td>flight_iata</td><td>Flight IATA code-number</td><td>E.g. MH102</td></tr><tr><td>dep_iata</td><td>Departure Airport IATA code</td><td>E.g. KUL</td></tr><tr><td>arr_iata</td><td>Arrival Airport IATA code</td><td>E.g. DAC</td></tr><tr><td>status</td><td>Current flight status</td><td>E.g. scheduled/en-route/landed</td></tr><tr><td>download</td><td>To download the JSON output</td><td>Empty or any value is fine</td></tr></tbody></table>

3. Depending on the parameters, the script will construct a URL to fetch information from the AirLabs API accordingly.

## **Parameter Guidelines**

* `flag` **parameter:**
  * The script will retrieve all flight data that belongs to the selected country.
* `airline_iata` **parameter:**
  * The script will retrieve all flight data that are relating to the airline code (IATA).
* `flight_iata` **parameter:**
  * The script will retrieve all flight data that are relating to the flight code-number (IATA).
* `dep_iata` **parameter:**
  * The script will retrieve all flight data where the flights depart from the airport which is specified using its airport code (IATA).
* `arr_iata` **parameter**
  * The script will retrieve all flight data where the flights arrive at the airport which is specified using its airport code (IATA).
* `status` **parameter**
  * The script will retrieve all flight data according to the status that is specified.
* `download` **parameter**
  * The JSON output will be automatically downloaded from the web browser. See the download sample at [here](#download).

## References

### List of country codes (IATA)

{% embed url="<https://www.iban.com/country-codes>" %}

### List of airline codes (IATA)

{% embed url="<https://azcargo.cz/en/services/support/iata-airline-codes/>" %}

### List of airport codes (IATA)

{% embed url="<https://en.wikipedia.org/wiki/List_of_airports_by_IATA_airport_code:_A>" %}

## Demo

{% embed url="<https://api.kosontechnology.com/flight-track.php?flag=MY&status=landed>" %}
Retrieves all flight data in Malaysia where the flights has landed.
{% endembed %}

{% embed url="<https://api.kosontechnology.com/flight-track.php?dep_iata=HKG&flag=HK&status=en-route>" %}
Retrieves all flight data in Hong Kong where the flights departed from Hong Kong and are currently flying
{% endembed %}

## Download

{% embed url="<https://api.kosontechnology.com/flight-track.php?download=&flag=MY&status=landed>" %}
