Giter Site home page Giter Site logo

aashishvanand / airport-data-js Goto Github PK

View Code? Open in Web Editor NEW
7.0 1.0 1.0 13.01 MB

A comprehensive javascript library providing easy retrieval of airport data based on IATA, ICAO, city codes, country codes, and continents.

Home Page: https://airport-data-js.aashishvanand.me/

License: Other

JavaScript 100.00%
airport airport-data airport-database airports aviation data database flight-radar flightaware flightradar24

airport-data-js's Introduction

airport-data-js

A comprehensive library providing easy retrieval of airport data based on IATA, ICAO, city codes, country codes, and continents. Ideal for developers building applications related to aviation, travel, and geography.

Features

  • Retrieve airport data using IATA code.
  • Retrieve airport data using ICAO code.
  • Fetch data using city codes.
  • Fetch data using country codes.
  • Retrieve data based on continents.
  • Built-in error handling for invalid input formats.
  • Efficiently packaged with minimized and gzipped data.
  • Comprehensive Data Access: Retrieve airport data using IATA code, ICAO code, city codes, country codes, and continents.
  • Unique Link Integration: The first library to provide direct links to FlightRadar24, Radarbox, and FlightAware for each airport, giving users immediate access to live flight tracking and airport data.
  • 9143 Aiports in total.

Updates from 1.0.4 to 1.0.6

  • Added 500+ aiports
  • Fixed cities
  • Added Wikipedia links

Installation

You can install airport-data-js using npm:

npm install airport-data-js

For detailed instructions on how to use this library in different environments, please refer to the following links:

Usage

Here's how you can use the library:

const airportData = require('airport-data-js');

// Retrieve airport data using IATA code
const airportByIATA = airportData.getAirportByIata("AAA");
console.log(airportByIATA);

// Retrieve airport data using ICAO code
const airportByICAO = airportData.getAirportByIcao("NTGA");
console.log(airportByICAO);

// Fetch data using city codes
const airportByCityCode = airportData.getAirportByCityCode("NYC");
console.log(airportByCityCode);

// Fetch data using country codes
const airportByCountryCode = airportData.getAirportByCountryCode("US");
console.log(airportByCountryCode);

// Retrieve data based on continents
const airportByContinent = airportData.getAirportByContinent("AS");
console.log(airportByContinent);

Example Data Fields

For Chennai International Airport:

Field Name Data
IATA MAA
ICAO VOMM
Time Zone Asia/Kolkata
City Code MAA
Country Code IN
Name Chennai International Airport
Latitude 12.99
Longitude 80.1693
Altitude (in feet) 52
State Tamil Nadu
City Chennai
County Kancheepuram
State Code Tamil Nadu
Airport Type large_airport
Continent AS
State Abbreviation IN-TN
International TRUE
Wikipedia Link Wikipedia
Official Website Chennai Airport
Location ID 12513629
Phone Number 044-2340551
Runway Length (in meters) 10050
Flightradar24 Flightradar24
Radarbox Radarbox
Flightaware Link Flightaware

Singapore Changi Airport:

Field Name Data
IATA SIN
ICAO WSSS
Time Zone Asia/Singapore
City Code SIN
Country Code SG
Name Singapore Changi Airport
Latitude 1.35019
Longitude 103.994
Altitude (in feet) 22
State Singapore
City Singapore
County Singapore
State Code South East
Airport Type large_airport
Continent AS
State Abbreviation SG-04
International TRUE
Wikipedia Link Wikipedia
Official Website Changi Airport
Location ID 12517525
Phone Number (65) 6542 1122
Runway Length (in meters) 13200
Flightradar24 Flightradar24
Radarbox Radarbox
Flightaware Flightaware

Running the Project Locally

  1. Clone the repository:
git clone https://github.com/aashishvanand/airport-data-js.git
  1. Change into the cloned directory:
cd airport-data-js
  1. Install the necessary dependencies:
npm install
  1. To bundle the source code using Webpack:
npm run build
  1. To run tests:
npm test

Troubleshooting

  1. Issue: "Module not found: Error: Can't resolve 'babel-loader'". Solution: Ensure that you have installed all the necessary dependencies. If the issue persists, reinstall the library.

  2. Issue: "Error: Automatic publicPath is not supported in this browser". Solution: Ensure that you're using the library in a supported environment (Node.js or a modern browser).

If you encounter other issues, consider raising an issue on the GitHub repository.

License

This project is licensed under the Creative Commons Attribution 4.0 International (CC BY 4.0) - see the LICENSE file for details.

Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page.

airport-data-js's People

Contributors

aashishvanand avatar dependabot[bot] avatar syonfox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

syonfox

airport-data-js's Issues

Data inconsistency

Hey there @aashishvanand ! I looked into the airport data and noticed a few inconsistencies that I thought you might want to know about:

  1. I found around 5 entries that don't have the country code in the 2-digit ISO format. Don't worry though, you can easily search for them using regex "country_code"\s*:\s*"[^"]*airport[^"]*" in VS Code.
  2. I also noticed that there are 23 entries without a city name.
    image
  3. Finally, there are 87 entries without a country name assigned. I hope this information helps you out!
    image

let me know if you'd update or I might help

Wrong country for OSL

Hey, just tried this and the first airport i tried returned wrong data

image

OSL is in NO, but NO is Norway, not Nannestad. Nannestad is a municipality which contains Teigebyen, which is a village of 3k people.

A similar thing for CPH which is in Denmark...
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.