The world has been witnessing the rise of digitization over the last decade in various industries and the aviation industry is no exception. Numerous startups and applications have emerged to revolutionize the way people travel, find and book cheap flights, tracking flights in real-time, and have access to information such as flight schedules and delays just using their smartphones. As per one research, the market size of the airline industry from 2018 to 2012 was valued at 359.3 billion U.S dollars. And despite taking a huge blow during the coronavirus pandemic, it is still estimated to reach 471.8 billion u.s dollars by the end of 2021.
Furthermore, developing an application for the travel and aviation industry often requires deep integration with multiple systems in order to fetch a variety of information about airports, flights, and aircraft. There are a handful of services that provides all such information under one roof.
AeroDataBox API is one such API that allows application developers and researchers to have access to aviation data and flight API. It provides some unique features that are rarely offered anywhere else, like aircraft image recognition by registration, airport and flight delays, airport destination statistics, take-off and landing runway detection, etc.
In the following section, we will explore the API and its usage in detail.
Note: if you are new to the APIs, you may go through this article at first to get acquitted with Web APIs.
What is the AeroDataBox API?
AeroDataBox provides a set of Rest APIs for startups and developers who are aiming to build small-scale travel or aviation applications.
The API provides complete aviation data which can be beneficial in the following scenarios.
- Getting complete information about an aircraft using its registration or 24-bit ICOA code.
- Display a list of flights, their schedule, and real-time departure and arrival information.
- Get complete flight information such as ATC Call-sign, departure date, and flight delay.
- Get airport information by IATA/ICAO code, runways, nearest location, free-text search, local time, delay statistics, daily routes statistics, distance, and flight time between airports.
The AeroDataBox API also provides aircraft image recognition capabilities that are currently in beta but could be tested as well. The pricing model is flexible and offers a basic tier that is free but imposes a hard limit of 700 requests per month in various tiers. Additionally, It has the paid plans that have the higher request quota limit e.g from 15,500 to 155,000 requests per month in various tiers.
The API further categorized the endpoints into tiers. For instance, Tier-1 contains all the basic endpoints to fetch aircraft and airport information. Tier-2, on the other hand, contains all the needed endpoints to provide advanced functionalities like searching airport by location, get flight departure dates and status, and finding out the distance between two airports. Tier-3 provides delay statistics and routes for airports and flights.
Note: Detailed pricing and tier information can be viewed using this page.
How does the AeroDataBox API Work?
The AeroDataBox API adheres to REST API design specifications and standards and provides various endpoints that allow developers to access aviation and flight data over the web.
The overall flow can be summarized in the following steps:
- The client uses the SDK to execute any of the endpoints using the HTTP GET method.
- Once the request is received by the server, it is processed and the requested data is fetched using its internal database and external sources.
- The server then formats the data in JSON format and sends the data back to the client.
Below is the high-level diagram of the above-mentioned steps.
The Target Audience of AeroDataBox API
The AeroDataBox API is meant for aviation enthusiasts, developers, and researchers who are aiming to build a small-scale travel or aviation application. Although it supports up to 155k requests per month, it advises against using it for customer-critical products having higher traffic.
Unlike other vendors, the AeroDataBox API provides endpoints that are easy-to-use and do not have complex parameters and response structures – making it ideal for those who are just getting started with flight data and aviation systems.
How to Connect to AeroDataBox API Tutorial – Step by Step
In this section, we will demonstrate how AeroDataBox API can be integrated using the RapidAPI platform.
Step-1: Signup for an Account on RapidAPI.
You can create an account on RapidAPI using this link. Alternatively, if you already have an account you can simply log in and navigate to API Marketplace. Using the RapidAPI platform, you can manage all your third-party APIs from one place using one API key. It also allows you to generate SDK for your favorite programming language.
Step-2: Search the API Marketplace.
As you complete your registration you will be redirected to the dashboard. Navigate to “API Marketplace” and search for “AeroDataBox API” as shown in the below image:
You may then select the API from the results list. It will redirect you to the AeroDataBox API’s homepage.
Step-3: Subscribe to the API
Before we move to the final step and test the API we need to choose the right plan and subscribe to it. Navigate to the ‘Pricing’ tab and chose the plan that matches your requirements.
For this tutorial, we will subscribe to the ‘Basic’ plan.
Finally, we can test all the endpoints that are provided by the API by navigating to the Endpoints tab.
Let’s execute the endpoint ‘Search Airport by Free Text” by providing the required parameter “London Heathrow”. After clicking on the “Test Endpoint” button, we can see the API has successfully returned the information for the given airport.
You may notice that the RapidAPI console has generated required parameters like API Key and Host information automatically.
Note: In case of any failure and service unavailability the AeroDataBox API may return one of the following responses:
- 400 Bad Request – Client sent an invalid request (missing required parameters).
- 401 Unauthorized – Failed to authenticate with the API server.
- 403 Forbidden – The client authenticated but didn’t have permission to access the required resource.
- 404 Not Found – The requested resource (endpoint) doesn’t exist.
- 500 Internal Server Error – A generic error occurred on the API server.
- 503 Service Unavailable – The API service is not available.
In some cases, the API response may contain an empty JSON array as shown below.
Explanation of AeroDataBox API Endpoints
The AeroDataBox API has grouped the endpoints into four categories. Below is the hierarchical diagram of all the endpoints.
Let’s have a detailed look at the above endpoints.
Aircrafts API
This group contains all the endpoints related to aircraft information.
Aircraft by reg
This endpoint returns complete information about the aircraft like model, model code, first flight date, registration date, number of engines, aircraft age, serial number IATA and hex ICAO codes. It accepts the following parameters which are required:
- searchBy: It’s a mandatory parameter of type enum. Users can tweak this parameter based on their search type. For example, the aircraft information can be searched by either ICAO24 or by reg (registration code).
- searchParam: it’s also a mandatory parameter of type string. It allows users to search for any code of the type (specified in searchBy parameter)
It returns the JSON array, containing all the information about the aircraft as shown below.
2.Aircraft image recognition (BETA)
This endpoint is in beta and allows the user to upload the image containing aircraft. The image type can be JPEG, PNG or BMP. It doesn’t require any other parameter and returns the information about the aircraft based on the provided image.
3.Aircraft image by registration (BETA)
This endpoint is also in beta. It allows users to see the image of an aircraft. It uses Flickr to search images externally and returns only those images which are licensed for commercial usage. It has the following required parameters.
- Reg: This is the required parameter of the type string. It specific the registration of the aircraft (full, stripped, and any case formats).
Below is the example response from this endpoint.
The above response contains the JSON object with image URL, author information, description, license type, and HTML attributes.
[The below image is obtained from the URL returned by the API]
Airports API
AeroDataBox API has grouped all the endpoints related to airports in this category.
3. Search Airports by location
This endpoint allows the user to fetch the list of airports found within a specified radius around specified locations. It accepts the following required parameters:
- Lat: latitude location coordinates in decimal format.
- Lon: longitude location coordinates in decimal format.
- Limit. This specifies the maximum number of airports to be returned by the API.
- radiusKm: This specifies the radius of the search in kilometers. The given values can be from 0 to 1000 km.
The above image illustrates the example response which includes the JSON array containing a list of airports. Each object in the array has the following fields:
- Icao: ICAO code for the airport
- Iata: IATA code for the airport
- Name: full name of the airport
- shortName: short name of the airport
- municipality Name: The name of the municipality e.g London.
- Location: This includes the location coordinates of the airport.
5. Airport by IATA/ICAO code
This endpoint allows users to get complete information about an airport using the IATA or ICAO codes. It takes the following parameters:
- codeType: This is a mandatory parameter of type ENUM and can have the value e.g iata or icao.
- Code: This parameter can contain any airport code. However, if the specified code type is icao it requires a 4-digit ICAO code of the airport e.g KLAX. Similarly, if the type is iata then it expects a 3-digit IATA code of the airport e.g LAX.
The response contains a JSON object containing detailed information about the airport including the website, timezone, and location.
6. Distance/ Flight time to another airport by IATA/ICAO codes
This endpoint can be used to calculate distance or flight time between two airports.
It takes the following parameters which are required:
- codeFrom: IATA or ICAO code for the first airport
- codeTo: IATA or ICAO code for the second airport.
- codeType: This parameter is of enum type and can be either iata or icao.
Let’s execute this endpoint to calculate the distance from LAX ( Los Angeles) to Newyork (JFK) airports.
The API successfully returned the JSON response as shown below:
We can see from the above image that the response contains a JSON object with properties like greaterCircleDistance which shows the calculated distance in various units and the approximate flight time.
7. Airport runways by ICAO code
This endpoint helps users to get information about runways at the specified airports. It accepts the following parameter:
- Icao: a 4-digit ICAO code of the airport e.g KLAX
It returns the JSON array containing a list of runways containing properties such as name, length, width, isClosed, location, surface, hasLightning etc. The below image illustrates the JSON response when the endpoint was executed for the airport KLAX.
8. Airport routes and daily flights by ICAO code
This endpoint provides a list of routes and daily flights departing from an airport. It has only one required parameter – the ICAO code.
It provides the JSON array containing information about routes. Each route object has fields such as destination array, average daily flights, and list of airline operators.
9. Airport local time by ICAO code
Using this endpoint user can get the local time at the airport using the ICAO code. It returns both UTC time and local time for the given airport.
Below is the API response when the endpoint was executed for KLAX airport.
10. Search Airports by Free Text
This is a very powerful endpoint as it allows users to fetch the list of airports with ICAO or IATA code matching the search query. It has the following parameters:
- q – this parameter is mandatory and can take any string of at least 3 characters
- Limit: this is an optional parameter and allows the user to specify the maximum number of airports to be returned
- withFlightInfoOnly: This is another optional parameter of type boolean. If set to true it will only return airports that have flight data.
Executing this endpoint for the search text ‘Los Angeles’ produced the following response.
11. Airport delay statistics by ICAO Code
This endpoint assists users to get statistical information about delays of arrival and departure of the airport within the last 2 hours. It takes only one required parameter – ICAO code.
The JSON response contains an object having separate properties for arrival and departure delay information as illustrated in the following image.
Flights API
This category contains all the needed endpoints to fetch various information about flights such as status, departure dates, arrivals, and delay statistics.
12. Flight Status
This endpoint enables users to get information about the status of the nearest flight or about the flight departing or arriving on the specified day.
It accepts the following parameters:
- searchBy: This parameter specifies the criteria to search by and accepts input such as number, callsign, registration, icao24
- searchParamter: This is a required parameter of type string and can take any values based on the type specified in searchBy parameter.
- withAircraftImage: This is an optional parameter of boolean type. It can be set to ‘true’ if the result should include an aircraft image.
- withLocation: Another optional parameter of boolean type and is used to specify if the result should include real-time positional data such as location, speed, altitude etc.
- dateLocal: The user can specify if the result needs to be filtered using the local date of departure of arrival.
It returns the JSON array containing information such as flight model and registration, callsign, departure or arrival information, positional data, commercial or cargo flight status, and current status of the flight – e.g arrived/departed/canceled etc.
The below image illustrates a successful response from the server.
13. Flight departure dates
This endpoint allows users to retrieve departure dates for any given flight. It accepts the following parameters:
- searchBy: This parameter specifies the criteria to search by and accepts input such as number, callsign, registration, icao24
- searchParamter: This is a required parameter of type string and can take any values based on the type specified in searchBy parameter.
- fromLocal: This is an optional parameter and specifies the beginning of the search range.
- toLocal: This is an optional parameter and specifies the end of the search range.
The API response contains a JSON object with the list of departure dates as illustrated in the image below.
14. Departure and Arrivals (FIDS) by airport ICAO code
This endpoint provides live updates and actual arrival/departure times for the given airport. It uses the following parameters:
- fromLocal: This is a required parameter and specifies the beginning of the search range.
- toLocal: This is a required parameter and specifies the end of the search range.
- Icao: It specifies the 4-digit ICAO-code of the airport e.g KLAX.
- withLeg: This is an optional parameter of boolean type and if set to ‘true’, it will include information from the opposite airport in this flight e.g airport of origin for arriving and destination for departing flights.
- Direction: An optional parameter of type ENUM whic specifies the direction of flights: such as arrival, departure or both (which is the default)
- withCancelled: This optional ENUM specifies if the results should also include the canceled flights.
- withCodeShared: This optional parameter will force the result set to include flights with all code-shared statuses, otherwise such flights will be excluded.
This endpoint returns the JSON array containing information such as aircraft model, airline, callsign, departure, and arrival information along with flight statuses. Below is the sample response which was returned when the endpoint was executed for KLAX airport.
15. Flight delay statistics by flight number
This endpoint simply returns the delay statistics for the given flight. It expects only one parameter ‘number’.
Invoking this endpoint for flight number KL1395 produced the following response from the server.
Healthchecks and Status API
One of the major benefits of using AeroDataBox API is that it also provides endpoints to check the API health of airport data feed services. It contains the following endpoints.
16. Airports data feed service status by ICAO code
Users can invoke this endpoint to check the current status of airport data feed services such as live flight updates, flight schedules, etc. It has one required parameter ‘icao’ which expects a 4-digit code of the airport.
Below is the sample response for the KLAX airport.
17. Airports supporting data feed service
This is a pretty handy endpoint as it returns the collection of airports supporting specified airport data feed services such as flight schedules, flight live updates, and Adsb Updates.
It accepts the following required parameter:
- Service: the name of airport data feed service.
The response contains a JSON array of ICAO codes of all the airports that support the specified data feed as illustrated in the below image.
How to Use Airport Info API with Python
Please make sure that you have installed the Python application. The Code snippet can be generated using several client libraries available for python like http.client, Unirest and the default http.client.
The below example executes the Airport local time by ICAO code api for KLAX airport.
import http.client conn = http.client.HTTPSConnection("aerodatabox.p.rapidapi.com") headers = { 'x-rapidapi-host': "aerodatabox.p.rapidapi.com", 'x-rapidapi-key': "ce19d0164fmsh3d383efc0e85ce5p16dcb1jsnb1a4a3c79541" } conn.request("GET", "/airports/icao/KLAX/time/local", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
How to Use Airport Info API with PHP
Before running the sample code shared below, please make sure that you have installed PHP. Then, you may follow this guide on how to install this correctly.
The below code snippet also executes the ‘Airport local time by ICAO code’ API for KLAX airport. The code snippet is generated using the cURL library.
<?php $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_URL => "https://aerodatabox.p.rapidapi.com/airports/icao/KLAX/time/local", CURLOPT_RETURNTRANSFER => true, CURLOPT_FOLLOWLOCATION => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "x-rapidapi-host: aerodatabox.p.rapidapi.com", "x-rapidapi-key: ce19d0164fmsh3d383efc0e85ce5p16dcb1jsnb1a4a3c79541" ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
How to Use Airport Info API with Ruby
The below code snippet illustrate how to consume the ‘Airport local time by ICAO code’ API using Ruby.
require 'uri' require 'net/http' require 'openssl' url = URI("https://aerodatabox.p.rapidapi.com/airports/icao/KLAX/time/local") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(url) request["x-rapidapi-host"] = 'aerodatabox.p.rapidapi.com' request["x-rapidapi-key"] = 'ce19d0164fmsh3d383efc0e85ce5p16dcb1jsnb1a4a3c79541' response = http.request(request) puts response.read_body
How to Use Airport Info API with Javascript
Please make sure that you have set up the JavaScript environment. Then, you can download text editors such as Atoms, Visual Studio Code, NotePad++, etc.
The following code snippet illustrates how to invoke Airport local time endpoint using the fetch method.
fetch("https://aerodatabox.p.rapidapi.com/airports/icao/KLAX/time/local", { "method": "GET", "headers": { "x-rapidapi-host": "aerodatabox.p.rapidapi.com", "x-rapidapi-key": "ce19d0164fmsh3d383efc0e85ce5p16dcb1jsnb1a4a3c79541" } }) .then(response => { console.log(response); }) .catch(err => { console.error(err); });
The API calls were successful as shown below.
Benefits
The AeroDataBox API provides a variety of aviation data under one roof. It provides some unique features that are rarely found in other API vendors such as light flight tracking, image recognition, flight delays, airport destination statics, etc.
Not many API vendors provide the health checks endpoints which are critical for fail-safe integration. But it is not the case with AeroDataBox API as it provides multiple endpoints for health checks and statuses.
Alternatives to AeroDataBox API
Below are some alternatives to AeroDataBox API.
- Flight Data API – This is a freemium API that provides live global flight data using various endpoints.
- Flight Delay Prediction API: This is also a freemium AI-based API that uses historical flight delay data to predict if a given flight will be delayed.
- IATA and ICAO API: It’s a powerful aviation API that includes flight tracking, real-time and historical airport schedules, airline routes, and much more.
- ADSBexchange.com API: This is a paid API that provides live air traffic and aircraft positional data via ADS-B / MLAT / UAT.
Summary
In this article, we have explored in-depth about AeroDataBox API and explained all of its endpoints and their integration using various programming languages such as Python, Ruby, PHP, and JavaScript.
Leave a Reply