Aviation APIs by AirLabs

Learn how our aviation apis enables travel technology companies and startups to serve their customers, develop innovative software and grow.


We collect data from thousands of sources, cleanse, aggregate and organize it into comprehensive collections that enable developers to create innovative products and deliver the perfect user experience.

The AirLabs Data API is designed to provide an easy way to get real-time global flight positioning data, flight schedules, and an impressive set of airlines, routes, airports, and other relevant aviation-related information.

Requests to the REST API are made using HTTP requests, and the responses are provided in a lightweight JSON, XML or CSV format.

The API documentation below can be used for any major programming language and provides general guidelines for integration and explanations of API endpoints, query parameters, and response objects.

If any questions remain unanswered for you, just ask the AirLabs support team for assistance.


API Key & Authentication

Once you create an AirLabs account, you can get a unique API key on your account dashboard.
To connect to the API, simply add your api_key parameter to any API endpoint URL.


                https://airlabs.co/api/v9/ping?api_key={{params.api_key}}
              

API Versions

Latest version of the API is v9. Please always use the latest version with every API call.


                https://airlabs.co/api/v9/ping
              

We strongly encourage our longtime customers to upgrade to the current version of the API.
Which is qualitatively different from the older versions.
However, you can access the previous versions here.


API Endpoint

Each data type has a personal ENDPOINT.


                https://airlabs.co/api/v9/ENDPOINT
              

Data Formats

The standard format of the API response is JSON. To get the response in XML or CSV format, you need to add an .xml or .csv


                https://airlabs.co/api/v9/ping.json
              

API Usage Examples

Rapidly build production-ready integrations using popular programming languages.

Using the AirLabs developer platform means less maintenance on legacy systems and more attention to the user experience.


                      curl https://airlabs.co/api/v9/ping \
                        -d api_key="{{params.api_key}}"
                    

                    const request = require("request");
                    const api_key = "{{params.api_key}}";
                    const api_base = "https://airlabs.co/api/v9/";

                    function apiCall(method, params, cb) {
                      params.api_key = api_key;
                      request.post({url: `${api_base}${method}`, form: params}, cb);
                    }

                    apiCall('ping', {param1: 'value1'}, (err, res) => {
                      console.log(res);
                    });
                  

                    $api_key = "{{params.api_key}}";
                    $api_base = "https://airlabs.co/api/v9/";

                    function apiCall($method, $params) {
                      $params->api_key = $api_key;
                      $c = curl_init(sprintf('%s%s?%s', $api_base, $method, http_build_query($params)));
                      curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
                      $res = json_decode(curl_exec($c), true);
                      curl_close($c);
                      return $res;
                    }

                    echo apiCall('ping', ["param1" => "value1"]);
                  

                    require 'net/http'
                    require 'json'

                    def apiCall(method, params)
                      api_key = "{{params.api_key}}"
                      api_base = "http://airlabs.co/api/v9/";
                      uri = URI("#{api_base}#{method}")
                      params.merge!(api_key: api_key)
                      uri.query = URI.encode_www_form(params)
                      return JSON.parse(Net::HTTP.get(uri))
                    end

                    puts JSON.pretty_generate(apiCall('ping', {:param1 => "value1"}))
                  

                    import requests
                    import json

                    params = {
                      'api_key': '{{params.api_key}}',
                      'params1': 'value1'
                    }
                    method = 'ping'
                    api_base = 'http://airlabs.co/api/v9/'
                    api_result = requests.get(api_base+method, params)
                    api_response = api_result.json()

                    print(json.dumps(api_response, indent=4, sort_keys=True))
                  

                    HttpRequest request = HttpRequest.newBuilder()
                      .uri(URI.create("http://airlabs.co/api/v9/ping?api_key={{params.api_key}}"))
                      .method("GET", HttpRequest.BodyPublishers.noBody())
                      .build();

                    HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());

                    System.out.println(response.body());
                  

                    package main

                    import (
                        "fmt"
                        "net/http"
                        "io/ioutil"
                    )

                    func main() {
                        url := "http://airlabs.co/api/v9/ping?api_key={{params.api_key}}"
                        req, _ := http.NewRequest("GET", url, nil)
                        res, _ := http.DefaultClient.Do(req)
                        defer res.Body.Close()
                        body, _ := ioutil.ReadAll(res.Body)
                        fmt.Println(res)
                        fmt.Println(string(body))
                    }
                  

                    var client = new RestClient("http://airlabs.co/api/v9/ping?api_key={{params.api_key}}");

                    var request = new RestRequest(Method.GET);

                    IRestResponse response = client.Execute(request);
                  

Common Errors

If your query to the AirLabs Data API fails, the API will return a response containing an error code and message objects indicating the type of error encountered.


              {"error":{"message":"Missing api_key","code":"wrong_params"}}
              


Code Description
unknown_api_key Provided API Key is invalid.
expired_api_key The provided API key has expired.
unknown_method Provided method is not supported.
wrong_params Some parameters is wrong.
not_found Requested data was not found.
minute_limit_exceeded The number of requests per minute has been exceeded.
hour_limit_exceeded The number of requests per hour has been exceeded.
month_limit_exceeded The number of requests per month has been exceeded.
internal_error An internal error occurred.

       Github    Reddit

See also

Airports Database API
World Cities Database
Airlines Database API
Real-time Flights API
Airport Schedules API
Name Suggestion Service
NearBy Geo Service
Aircraft Fleets Database API
Global Routes Database
Countries Database
Timezones List
Taxes List


Questions? Contact us.