Skip to main content

Get airlines

curl -X GET "http://localhost:3000/v1/airlines?search=United" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
GET
/v1/airlines
Get airlines. Has over 800 records, only has commercial airlines.

Query parameters

The full (or a part of) name, IATA code, or ICAO code. Case insensitive.Examples: United, UA, UAL, or American

Response

Returns an array of airline objects.
id
string
Unique airline identifier
name
string
Airline nameExample: United Airlines
icao
string
ICAO airline code (3 letters)Example: UAL
iata
string
IATA airline code (2 letters)Example: UA
image
string
Airline logo image URLExample: https://cdn.aero.com/airlines/UA.png

Response example

[
  {
    "id": "airline_123",
    "name": "United Airlines",
    "icao": "UAL",
    "iata": "UA",
    "image": "https://cdn.aero.com/airlines/UA.png"
  },
  {
    "id": "airline_456",
    "name": "United Parcel Service",
    "icao": "UPS",
    "iata": "5X",
    "image": "https://cdn.aero.com/airlines/5X.png"
  }
]

Error responses

500
object
Internal server error
{
  "message": "Internal server error"
}

Search examples

Search by airline name

curl -X GET "http://localhost:3000/v1/airlines?search=Delta" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
Returns Delta Air Lines and any other airlines with “Delta” in the name.

Search by IATA code

curl -X GET "http://localhost:3000/v1/airlines?search=AA" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
Returns American Airlines.

Search by ICAO code

curl -X GET "http://localhost:3000/v1/airlines?search=AAL" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
Returns American Airlines.

Search by partial name

curl -X GET "http://localhost:3000/v1/airlines?search=South" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
Returns Southwest Airlines, South African Airways, and other airlines with “South” in the name.

Major airline codes

Here are some common airline codes for reference:
AirlineIATAICAO
American AirlinesAAAAL
Delta Air LinesDLDAL
United AirlinesUAUAL
Southwest AirlinesWNSWA
JetBlue AirwaysB6JBU
Alaska AirlinesASASA

Best practices

  • Use the search parameter to filter airlines and avoid retrieving all 800+ records
  • Search is case-insensitive, so “united”, “UNITED”, and “United” will all return the same results
  • You can search by partial names (e.g., “Air” will return all airlines with “Air” in the name)
  • For the most accurate results, use IATA or ICAO codes when you know them
  • The image field may not be available for all airlines

Use cases

Airline autocomplete

Use this endpoint to power an autocomplete search for airline selection:
const searchAirlines = async (query) => {
  const response = await fetch(
    `http://localhost:3000/v1/airlines?search=${encodeURIComponent(query)}`,
    {
      headers: { 'Authorization': 'Bearer YOUR_JWT_TOKEN' }
    }
  );
  return await response.json();
};

// User types "amer"
const results = await searchAirlines('amer');
// Returns: American Airlines, US Airways, etc.

Display airline information

Retrieve and display airline details including logo:
const getAirlineByCode = async (iataCode) => {
  const response = await fetch(
    `http://localhost:3000/v1/airlines?search=${iataCode}`,
    {
      headers: { 'Authorization': 'Bearer YOUR_JWT_TOKEN' }
    }
  );
  const airlines = await response.json();
  return airlines.find(a => a.iata === iataCode);
};

const airline = await getAirlineByCode('UA');
console.log(airline.name); // "United Airlines"
console.log(airline.image); // Logo URL

Build docs developers (and LLMs) love