New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

apilayer-aviationstack

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apilayer-aviationstack

Aviationstack API SDK

  • 1.0.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
0
Weekly downloads
 
Created
Source

aviationstack-sdk

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.

Installation

You can install this SDK using npm:

npm install apilayer-aviationstack

Usage

This SDK supports both CommonJS (require) and ES Modules (import).

CommonJS (require)

const Aviationstack = require("apilayer-aviationstack");

const aviation = new Aviationstack("YOUR_API_KEY");

aviation
    .flights()
    .then((response) => console.log(response))
    .catch((error) => console.error(error));

ES Modules (import)

import Aviationstack from "apilayer-aviationstack";

const aviation = new Aviationstack("YOUR_API_KEY");

aviation
    .flights()
    .then((response) => console.log(response))
    .catch((error) => console.error(error));

API Endpoints

constructor(apiKey: string)

Initializes the Aviationstack client with your API key.

const aviation = new Aviationstack("YOUR_API_KEY");

flights(params?: object)

Retrieves real-time flight information.

aviation.flights({ airline_name: "Lufthansa" }).then((response) => console.log(response));

routes(params?: object)

Gets information about specific routes.

aviation.routes({ dep_iata: "JFK", arr_iata: "LAX" }).then((response) => console.log(response));

airports(params?: object)

Returns a list of airports.

aviation.airports({ country_name: "United States" }).then((response) => console.log(response));

airlines(params?: object)

Fetches airline details.

aviation.airlines({ airline_name: "Delta" }).then((response) => console.log(response));

aircraftTypes(params?: object)

Gets information about different aircraft types.

aviation.aircraftTypes().then((response) => console.log(response));

taxes(params?: object)

Returns information about applicable taxes.

aviation.taxes({ country_name: "Germany" }).then((response) => console.log(response));

cities(params?: object)

Gets information about cities.

aviation.cities({ country_name: "United Kingdom" }).then((response) => console.log(response));

countries(params?: object)

Returns a list of countries.

aviation.countries().then((response) => console.log(response));

flightsFuture(iataCode: string, type: string, date: string, params?: object)

Gets information about future flights. Required parameters: iataCode, type, and date.

aviation.flightsFuture("JFK", "departure", "2023-10-23").then((response) => console.log(response));

timetable(iataCode: string, date: string, params?: object)

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));

Note

For more detailed information about Aviationstack API, make sure to check out our Developer Documentation.

License

This package is licensed under the MIT License.

FAQs

Package last updated on 24 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc