Apidog Docs
πŸ‡ΊπŸ‡Έ English
  • πŸ‡ΊπŸ‡Έ English
  • πŸ‡―πŸ‡΅ ζ—₯本θͺž
HomeLearning CenterSupport CenterAPI References
HomeLearning CenterSupport CenterAPI References
Discord Community
Slack Community
X / Twitter
πŸ‡ΊπŸ‡Έ English
  • πŸ‡ΊπŸ‡Έ English
  • πŸ‡―πŸ‡΅ ζ—₯本θͺž
  1. Learning Center
  • Back to home
  • Dynamic values Modules
  • Airline
  • Animal
  • Color
  • Commerce
  • Company
  • Database
  • Datatype
  • Date
  • Finance
  • Food
  • Git
  • Hacker
  • Helpers
  • Image
  • Internet
  • Location
  • Lorem
  • Music
  • Number
  • Person
  • Phone
  • Science
  • String
  • System
  • Vehicle
  • Word
  1. Learning Center

Airline

Module to generate airline and airport related data.
Overview
Several methods in this module return objects rather than strings. For example, you can use {{$airline.airportIataCode}} to pick out the specific property you need.
For a random airport, use {{$airline.airportName}} and {{$airline.airportIataCode}}.
For a random airline, use {{$airline.airlineName}} and {{$airline.airlineIataCode}}.
For a dummy booking, a passenger will generally book a flight on a specific {{$airline.flightNumber}}, {{$airline.airplaneName}}, be allocated a {{$airline.seat}} and {{$airline.recordLocator}}.
Related Modules
To generate sample passenger data, you can use the methods of the person module.

aircraftType#

Returns a random aircraft type.
Returns: 'narrowbody' | 'regional' | 'widebody'
Examples

airline#

The original faker.airline.airline() method has been refined into two more precise variables:
{{$airline.airlineName}}: Generates an airline name.
{{$airline.airlineIataCode}}: Generates an airline IATA code.
Generates a random airline.
Returns: Airline
Examples

airplane#

The original faker.airline.airplane() method has been refined into two more precise variables:
{{$airline.airplaneName}}: Generates an airplane name.
{{$airline.airplaneIataTypeCode}}: Generates an airplane IATA code.
Generates a random airplane.
Returns: airplane
Examples

airport#

The original faker.airline.airport() method has been refined into two more precise variables:
{{$airline.airportName}}: Generates an airport name.
{{$airline.airportIataCode}}: Generates an airport IATA code.
Generates a random airport.
Returns: Airport
Examples

flightNumber#

Returns a random flight number. Flight numbers are always 1 to 4 digits long. Sometimes they are used without leading zeros (e.g.: American Airlines flight 425) and sometimes with leading zeros, often with the airline code prepended (e.g.: AA0425).
To generate a flight number prepended with an airline code, combine this function with the airline() function and use template literals:
Parameters
NameTypeDefaultDescription
addLeadingZerosbooleanfalseWhether to pad the flight number up to 4 digits with leading zeros.
lengthnumber{ min: number; max: number; }{ min: 1, max: 4 }
Returns: string
Examples

recordLocator#

Generates a random record locator. Record locators are used by airlines to identify reservations. They're also known as booking reference numbers, locator codes, confirmation codes, or reservation codes.
Parameters
NameTypeDefaultDescription
allowNumericsbooleanfalseWhether to allow numeric characters.
allowVisuallySimilarCharactersbooleanfalseWhether to allow visually similar characters such as '1' and 'I'.
Returns: string
Examples

seat#

Generates a random seat.
Parameters
NameTypeDefaultDescription
aircraftType'narrowbody' | 'regional' | 'widebody'narrowbodyThe aircraft type. Can be one of narrowbody, regional, widebody.
Returns: string
Examples
Next
Animal
Built with