npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

openflights-data

v1.0.6

Published

REST microservice for openflights airports and airlines data

Downloads

4

Readme

openflights-data

REST microservice for openflights airports and airlines data

Get airport and airline data via REST API.

Run Example

npm install
cd example && npm install && npm run build && cd ..
npm start

Open http://localhost:3003

screenshot

Usage with express server

const {router} = require('openflights-data')
const app = require('express')()

app.use('/', router())
app.listen(3000)

Just access data.

const {loadData} = require('openflights-data')

loadData(config).then(data => console.log(data))

API

Get airport by IATA Code

Returns GeoJSON Feature

GET /airports/iata/:code
// e.g.
GET /airports/iata/aaa

{
  type: 'Feature',
  geometry: {
    type: 'Point',
    coordinates: [-145.50999450683594, -17.35260009765625]
  },
  properties: {
    id: '1973',
    name: 'Anaa Airport',   // name of airport
    city: 'Anaa',           // city name
    iata: 'AAA',
    icao: 'NTGA',
    alt: 10,                // altitude in ft
    tz: 'Pacific/Tahiti',   // timezone
    country: 'PF',          // ISO-3166 Country Code
    type: 'airport'         // type: airport, airbase, heliport, seaplane,
                            //       airfield, bus, port, station
  }
}

Get airport by ICAO Code

Returns GeoJSON Feature

GET /airports/icao/:code

Search airport by name

Returns GeoJSON FeatureCollection

GET /airports/search/:search
// e.g.
GET /airports/search/leonardo+da

{
  type: 'FeatureCollection',
  features: [
    {
      type: 'Feature',
      geometry: {
        type: 'Point',
        coordinates: [12.2388889, 41.8002778]
      },
      properties: {
        id: '1555',
        name: 'Leonardo da Vinci–Fiumicino Airport',
        city: 'Rome',
        iata: 'FCO',
        icao: 'LIRF',
        alt: 13,
        tz: 'Europe/Rome',
        country: 'IT',
        type: 'airport'
      }
    }
  ]
}

Get airports by bounding box

Returns GeoJSON FeatureCollection

GET /airports/bbox/:north,:west/:south,:east
// example get all airports within lat 49, lng 8 and lat 48, lng 7
GET /airports/bbox/49,8/48,7

// filter by country, type, iata, icao
GET /airports/bbox/:north,:west/:south,:east?country=C1,C2&type=t1,t2&iata=1&icao=1
// example get all swiss airfields
GET /airports/bbox/47.54,6.38/45.73,10.77?country=CH&type=airfield

Get airline by IATA code

Returns airline object

GET /airlines/iata/:code
// e.g.
GET /airlines/iata/4u
{
  id: '2548',
  name: 'Germanwings',
  iata: '4U',
  icao: 'GWI',
  callsign: 'GERMAN WINGS',
  active: true,
  country: 'DE'
}

Get airline by ICAO code

GET /airlines/icao/:code

Get airline by callsign

GET /airlines/callsign/:callsign

Search airline by name

Returns Array of airline objects

GET /airlines/search/:search

Data

Data is obtained from openflights under ODBL-1.0 and downloaded as postinstall task.

If you like to improve the data please open an issue here.

License

Unlicense https://unlicense.org