A simple SDK for the Aviationstack API, which provides real-time and historical aviation data, including flight status, routes, airports, airlines, aircraft types, and more.
You can install this SDK using npm:
npm install apilayer-aviationstack
This SDK supports both CommonJS (require
) and ES Modules (import
).
const Aviationstack = require("apilayer-aviationstack");
const aviation = new Aviationstack("YOUR_API_KEY");
aviation
.flights()
.then((response) => console.log(response))
.catch((error) => console.error(error));
import Aviationstack from "apilayer-aviationstack";
const aviation = new Aviationstack("YOUR_API_KEY");
aviation
.flights()
.then((response) => console.log(response))
.catch((error) => console.error(error));
Initializes the Aviationstack
client with your API key.
const aviation = new Aviationstack("YOUR_API_KEY");
Retrieves real-time flight information.
aviation.flights({ airline_name: "Lufthansa" }).then((response) => console.log(response));
Gets information about specific routes.
aviation.routes({ dep_iata: "JFK", arr_iata: "LAX" }).then((response) => console.log(response));
Returns a list of airports.
aviation.airports({ country_name: "United States" }).then((response) => console.log(response));
Fetches airline details.
aviation.airlines({ airline_name: "Delta" }).then((response) => console.log(response));
Gets information about different aircraft types.
aviation.aircraftTypes().then((response) => console.log(response));
Returns information about applicable taxes.
aviation.taxes({ country_name: "Germany" }).then((response) => console.log(response));
Gets information about cities.
aviation.cities({ country_name: "United Kingdom" }).then((response) => console.log(response));
Returns a list of countries.
aviation.countries().then((response) => console.log(response));
Gets information about future flights. Required parameters: iataCode, type, and date.
aviation.flightsFuture("JFK", "departure", "2023-10-23").then((response) => console.log(response));
Gets the flight timetable for a specific airport on a given date. Required parameters: iataCode and date.
aviation.timetable("LAX", "2023-10-23").then((response) => console.log(response));
For more detailed information about Aviationstack API, make sure to check out our Developer Documentation.
This package is licensed under the MIT License.