DEV Community

Cover image for GitHub based airports API service
Edvinas Pranka
Edvinas Pranka

Posted on

GitHub based airports API service

Hello developers and enthusiasts! 😍

Recently I created the API service directly in GitHub. Maybe it was interesting to you, or give you some amazing idea.

👉 Check it out here: epranka/airports-db

This is a JSON database of airports which contains about 56k airports with their runways, communication frequencies, navaids, countries, and regions information. The database is not 100% accurate because can have older data, so do not use it for a real flight or very sensitive applications. But it works well to get basic information about the airport.

The API service has one endpoint to get the airport information by its ICAO code.

You can request data by the following URL:

👉 https://raw.githubusercontent.com/epranka/airports-db/master/icao/<enter your ICAO>.json

For example, to get information about the John F Kennedy International Airport:

https://raw.githubusercontent.com/epranka/airports-db/master/icao/KJFK.json

How it works? 🤔

The main idea of this API is that every airport has its own JSON file placed in icao directory. And when you request the airport info by its ICAO code, you simply request the airport JSON file in the repository directory. So now it has about 56k airport files. Please don't tell the GitHub administrators about that 😁

Follow on Twitter
Star on GitHub
Let's connected on LinkedIn

Have ideas on how to improve it? Feel free to share it on the GitHub Issues.

If you have any questions, feel free to ask in the comments below or contact me directly. Any feedback is appreciated 😊

The example response of KJFK airport:

{
  "id": "3622",
  "ident": "KJFK",
  "type": "large_airport",
  "name": "John F Kennedy International Airport",
  "latitude_deg": "40.63980103",
  "longitude_deg": "-73.77890015",
  "elevation_ft": "13",
  "continent": "NA",
  "iso_country": "US",
  "iso_region": "US-NY",
  "municipality": "New York",
  "scheduled_service": "yes",
  "gps_code": "KJFK",
  "iata_code": "JFK",
  "local_code": "JFK",
  "home_link": "http://www.panynj.gov/CommutingTravel/airports/html/kennedy.html",
  "wikipedia_link": "https://en.wikipedia.org/wiki/John_F._Kennedy_International_Airport",
  "keywords": "Manhattan, New York City, NYC, Idlewild",
  "runways": [
    {
      "id": "244968",
      "airport_ref": "3622",
      "airport_ident": "KJFK",
      "length_ft": "12079",
      "width_ft": "200",
      "surface": "Concrete - Grooved",
      "lighted": "1",
      "closed": "0",
      "le_ident": "04L",
      "le_latitude_deg": "40.622",
      "le_longitude_deg": "-73.7856",
      "le_elevation_ft": "12",
      "le_heading_degT": "31",
      "le_displaced_threshold_ft": "",
      "he_ident": "22R",
      "he_latitude_deg": "40.6488",
      "he_longitude_deg": "-73.7647",
      "he_elevation_ft": "13",
      "he_heading_degT": "211",
      "he_displaced_threshold_ft": "2696"
 ...
Enter fullscreen mode Exit fullscreen mode

Top comments (0)