GitHub based airports API service
Tags: github, database, api, node
Published: 2020-04-21 08:08:07

Hello developers and enthusiasts! :heart_eyes:

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

:point_right: Check it out here: [epranka/airports-db](https://github.com/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:

:point_right: `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](https://raw.githubusercontent.com/epranka/airports-db/master/icao/KJFK.json)

**How it works? :thinking:**

The main idea of this API is that every airport has its own JSON file placed in [icao](https://github.com/epranka/airports-db/tree/master/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 :grin:

:star: [Follow on Twitter](https://twitter.com/epranka)
:star: [Star on GitHub](https://github.com/epranka/airports-db)
:star: [Let's connected on LinkedIn](https://linkedin.com/in/epranka)

Have ideas on how to improve it? Feel free to share it on the [GitHub Issues](https://github.com/epranka/airports-db/issues).

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

The example response of KJFK airport:

```json
{
  "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"
 ...
```