Skip to content

Airlines

The Airlines resource provides fake airline data with names, codes, logos, websites, and country associations.

MethodEndpointDescription
GET/v1/airlinesList all airlines
GET/v1/airlines/:idGet a specific airline
GET/v1/airlines/:id/flightsGet airline's flights
{
"id": 1,
"name": "SkyWing Airlines",
"code": "SWA",
"slug": "skywing-airlines",
"logo": "https://example.com/logos/skywing.png",
"website": "https://skywing.example.com",
"countryId": 1,
"createdAt": "2026-01-15T10:30:00.000Z",
"updatedAt": "2026-01-15T10:30:00.000Z"
}
Field Type Description
id number Unique identifier
name string Airline name
code string Airline code (e.g. SWA)
slug string URL-friendly unique slug
logo string Logo image URL
website string Airline website URL
countryId number ID of the country
createdAt string ISO 8601 timestamp
updatedAt string ISO 8601 timestamp
Terminal window
curl https://api.phantomjson.app/v1/airlines
Parameter Type Default Description
page number 1 Page number
limit number 20 Items per page (max: 100)
sort string Sort field and direction
q string Search query
fields string Fields to return
code string Filter by airline code
countryId number Filter by country ID
{
"data": [
{
"id": 1,
"name": "SkyWing Airlines",
"code": "SWA",
"slug": "skywing-airlines",
"countryId": 1
}
],
"meta": {
"total": 30,
"page": 1,
"limit": 20,
"totalPages": 2
}
}
Terminal window
curl https://api.phantomjson.app/v1/airlines/1
{
"data": {
"id": 1,
"name": "SkyWing Airlines",
"code": "SWA",
"slug": "skywing-airlines",
"logo": "https://example.com/logos/skywing.png",
"website": "https://skywing.example.com",
"countryId": 1
}
}
Terminal window
curl https://api.phantomjson.app/v1/airlines/1/flights
{
"data": [
{
"id": 1,
"airlineId": 1,
"flightNumber": "SWA101",
"departureAirportId": 1,
"arrivalAirportId": 2,
"status": "scheduled"
}
],
"meta": {
"total": 25,
"page": 1,
"limit": 20,
"totalPages": 2
}
}
Terminal window
curl "https://api.phantomjson.app/v1/airlines?q=sky"
Terminal window
curl "https://api.phantomjson.app/v1/airlines?code=SWA"
Terminal window
curl "https://api.phantomjson.app/v1/airlines?countryId=1"
Terminal window
# A-Z
curl "https://api.phantomjson.app/v1/airlines?sort=name:asc"
# Z-A
curl "https://api.phantomjson.app/v1/airlines?sort=name:desc"
Terminal window
curl "https://api.phantomjson.app/v1/airlines?fields=id,name,code,countryId"
  • Country — Each airline may belong to a country (countryId)
  • Flights — Each airline has many flights (access via /v1/airlines/:id/flights)