API Reference

Airlines

Airlines are used to identify the air travel companies selling and operating flights

iata_code
string
nullable

The two-character IATA code for the airline. This may be null for non-IATA carriers.

Example: "BA"
id
string

Duffel's unique identifier for the airline

Example: "aln_00001876aqC8c5umZmrRds"
name
string

The name of the airline

Example: "British Airways"

Retrieves an airline by its ID

Endpoint

GEThttps://api.duffel.com/air/airlines/{id}

URL parameters

id
string
required

Duffel's unique identifier for the airline

Example: "aln_00001876aqC8c5umZmrRds"

Request example

curl -X GET --compressed "https://api.duffel.com/air/airlines/{id}" \
-H "Accept-Encoding: gzip" \
-H "Accept: application/json" \
-H "Duffel-Version: beta" \
-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>"

Response example

{
"data": {
"name": "British Airways",
"id": "aln_00001876aqC8c5umZmrRds",
"iata_code": "BA"
}
}

Retrieves a paginated list of all airlines. The results may be returned in any order.

Endpoint

GEThttps://api.duffel.com/air/airlines

Query Parameters

after
string

A cursor pointing to the previous page of records. For more information on how to paginate through records, see the Pagination section.

Example: "g2wAAAACbQAAABBBZXJvbWlzdC1LaGFya2l2bQAAAB="
before
string

A cursor pointing to the next page of records. For more information on how to paginate through records, see the Pagination section.

Example: "g2wAAAACbQAAABBBZXJvbWlzdC1LaGFya2l2bQAAAB="
limit
integer

The maximum number of records to return per page. Defaults to 50. May be set to any integer between 1 and 200. For more information on how to paginate through records, see the Pagination section.

Example: 1

Request example

curl -X GET --compressed "https://api.duffel.com/air/airlines" \
-H "Accept-Encoding: gzip" \
-H "Accept: application/json" \
-H "Duffel-Version: beta" \
-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>"

Response example

{
"meta": {
"limit": 50,
"after": "g2wAAAACbQAAABBBZXJvbWlzdC1LaGFya2l2bQAAAB="
},
"data": [
{
"name": "British Airways",
"id": "aln_00001876aqC8c5umZmrRds",
"iata_code": "BA"
}
]
}