Skip to content

Latest commit

 

History

History
116 lines (71 loc) · 2.6 KB

airports.md

File metadata and controls

116 lines (71 loc) · 2.6 KB

Airports API

Source code: source/airports/

getActive()

Retrieves a list of all active airports.

Returns: Promise<Airport[]>

import { airports } from '@2bad/ryanair'

const airports = await airports.getActive()

getActiveV3()

Retrieves a list of all active airports.

Returns: Promise<AirportV3[]>

import { airports } from '@2bad/ryanair'

const airports = await airports.getActiveV3()

getClosest()

Returns information about the closest airport based on the user's IP address.

Returns: Promise<AirportShort>

import { airports } from '@2bad/ryanair'

const airport = await airports.getClosest()

getDestinations(code: IataCode)

Returns a list of available destinations from an airport.

  • code: IataCode - The IATA code of the airport.

Returns: Promise<Destination[]>

import { airports } from '@2bad/ryanair'

const destinations = await airports.getDestinations('BER')

getInfo(code: IataCode)

Returns information about an airport.

code: IataCode - The IATA code of the airport.

Returns: Promise<Airport>

import { airports } from '@2bad/ryanair'

const info = await airports.getInfo('BER')

getNearby()

Returns information about the nearby airports based on the user's IP address.

Returns: Promise<AirportShort[]>

import { airports } from '@2bad/ryanair'

const airports = await airports.getNearby()

getSchedules()

Returns a list of available flight schedules departing from an airport.

Returns: Promise<Schedules>

import { airports } from '@2bad/ryanair'

const schedules = await airports.getSchedules()

findRoutes(from: IataCode, to: IataCode)

Finds available routes between two airports.

from: IataCode - The departure airport IATA code. to: IataCode - The arrival airport IATA code.

Returns: Promise<IataCode[][]>

import { airports } from '@2bad/ryanair'

const routes = await airports.findRoutes('BER', 'GDN') // [["BER", "AGP", "GDN"], [ "BER", "ALC", "GDN",], ...]