Fantastic Flight API with aviationstack

By (Sponsor)  on  

I didn't fly until I was 25 years of age -- I was hopeless in knowing I had to be there early, the process of security, and the whole gate structure. Now that I've flown dozens of times for Mozilla, I feel much more comfortable with the process of flying, but feel less comfortable about expectations of delays and knowing information about the airlines and flights.

I've often thought about creating my own flight info site, as oftentimes I want to track my own flights and remember paths I've taken in the past. Enter aviationstack, and API which provides detailed current and historical flight information.

Quick Hits

  • Free to sign up and get an API key
  • Provides expansive information about flights, airports, airplanes, airlines, and their locations
  • Reliable, performant, easy to use API
  • Provides JSONP support
  • Brought to you by apilayer, creators of currencylayer, mailboxlayer, userstack, etc.

Using aviationstack

Once you have your free API key, you can start hitting the API to gather information you'd like.

You could start by getting airline information via the API:

# Get all airlines

# Search for a specific airline

  "pagination": {
    "offset": 0,
    "limit": 100,
    "count": 11,
    "total": 11
  "data": [
      "fleet_average_age": "12.3",
      "callsign": "SOUTHWEST",
      "hub_code": "DAL",
      "iata_code": "WN",
      "icao_code": "SWA",
      "country_iso2": "UM",
      "date_founded": "1967",
      "iata_prefix_accounting": "526",
      "airline_name": "Southwest Airlines Co.",
      "country_name": "United States Minor Outlying Islands",
      "fleet_size": "712",
      "status": "active",
      "type": "scheduled"

You can use the cities endpoint to retrieve airlines out of your city of choice:

# Get all airlines that operate out of Madison

Probably the most useful to users is the flights endpoint which provides real-time flight information:

# Get info about flight 5914 from SFO to MSN on January 5, 2020

            "airport":"San Francisco International",
            "airport":"Dane County Regional",
            "name":"United Airlines",

The amount of detail you get is awesome -- delays, aircraft information, speed, position, and more. Also note that you can provide a date in the past to get historical flight information.

Other endpoints include: countries, cities, airline routes, aircraft types, aircraft taxes (!) and more!

There are so many uses for an API like this. A few ideas which would be fun for me:

  • Keeping track of my team's flight status, so I know when everyone has arrived
  • Creating a graphical, interactive chart of all the flights I've taken and places I've traveled to so I can share it with family and look back at awesome memories
  • Coding up a personal rating system per flight so I can remember which airlines were on time, served good food, and had the best entertainment

aviationstack is an awesome API to jump into. I expected to see a lots of information but there was even more than I had hoped for! I also appreciate how easy it was to use, and how it made me think about the different uses cases that I could enjoy!


  1. Ramachandran

    Is it possible to get the historic data of flights more than 1 year old?

    Thank you for the response.

Wrap your code in <pre class="{language}"></pre> tags, link to a GitHub gist, JSFiddle fiddle, or CodePen pen to embed!