VATSIM Traffic

Updated Apr 09 2021

Return list of aircrafts that currently perform flight from or to specified airport ICAO.

Output fields:

  • info: this key contain value found which represents number of found aircrafts with given parameters
  • result: will contain all found aircrafts and their details

Usage

Endpoint: /traffic

Request method: GET

Headers:

Header parameterDescription
X-API-Key Your unique API key
icao REGEX-string that will be applied to filter departure/arrival airports. Case-sensitive.
Refer to manual to get familiar with Python regular expressions.
You can also test your expression here.

Example request:

Python

    import requests

    url = "https://api.vacc-ua.org/api/traffic"

    headers = {
        'X-API-Key': "123456",
        'icao': "^UK[A-Z]{2}$",
        'Cache-Control': "no-cache"
    }

    response = requests.request("GET", url, headers=headers)
    print(response.text)

PHP

    <?php

    $curl = curl_init();

    curl_setopt_array($curl, array(
        CURLOPT_PORT => "443",
        CURLOPT_URL => "https://api.vacc-ua.org/api/traffic",
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_ENCODING => "",
        CURLOPT_MAXREDIRS => 10,
        CURLOPT_TIMEOUT => 30,
        CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
        CURLOPT_CUSTOMREQUEST => "GET",
        CURLOPT_HTTPHEADER => array(
            "Cache-Control: no-cache",
            "X-API-Key: 123456",
            "icao: ^UK[A-Z]{2}$"
        ),
    ));

    $response = curl_exec($curl);
    $err = curl_error($curl);

    curl_close($curl);

    if ($err) {
        echo "cURL Error #:" . $err;
    } else {
        echo $response;
    }