GET/v1/flights/airports

Search airports

Searches airport metadata by free text or nearby coordinates for autocomplete and location-based flight search flows.

Share
GET/v1/flights/airports

API console

Try it

Send a real request to the sandbox API and inspect the response.

Credentials

Log in to pick from your saved API keys instead of pasting them.

Query parameters

4 fields

Search text

Free-text query to match against airport names, cities, or IATA codes.

Latitude

Latitude of the center point for a radius-based airport search.

Longitude

Longitude of the center point for a radius-based airport search.

Radius (km)

Search radius in kilometers around the provided coordinates.

cURL request

cURL
bash
curl -X GET 'https://api.sandbox.travelandz.com/v1/flights/airports?queryString=Madrid' \
  -H 'Authorization: Bearer YOUR_SECRET_KEY' \
  -H 'X-Travelandz-Id: YOUR_PUBLIC_KEY:YOUR_PROFILE_CODE'

Add your credentials to send a request.

Response

Click "Try it!" to send a request and see the response here.

Searches airport metadata by free text or nearby coordinates for autocomplete and location-based flight search flows.

Endpoint

MethodPathAuth
GET/v1/flights/airportsRequired API key
Required headers:
HeaderDescription
AuthorizationBearer <secret_key>. The secret is shown only once when the credential is created.
X-Travelandz-Id<public_key>:<profile_code>. The profile_code is the dp_-prefixed Developer Profile code shown in your dashboard. This binds the request to a profile and credential.
Content-TypeUse application/json for requests with a body.

Request Params Schema

lat
numberNo
Required when queryString is not provided
lng
numberNo
Required when queryString is not provided
radius
numberNo
Required when queryString is not provided
queryString
stringNo
Alternative to coordinates

Request Body

No request body is required.

Success Response

Returns matching airports and location metadata.

Response Body Schema

airports
arrayYes
airports[]name
stringYes
airports[]city_name
stringYes
airports[]time_zone
stringYes
airports[]longitude
numberYes
airports[]latitude
numberYes
airports[]iata_country_code
stringYes
airports[]iata_code
stringYes
airports[]iata_city_code
stringYes
airports[]type
stringYes
airports[]airportName
stringYes
airports[]distanceFromPoint
numberNo
liveMode
booleanYes
True when the request is served by the live Travelandz environment. This value comes from Travelandz, not the provider payload.

Operational Notes

queryString can be used for text search. When using geographic search, send lat, lng and optional radius; radius defaults to 30 kilometers.

Query examples

Text search: ?queryString=Barcelona

Coordinate search: ?lng=2.080877&lat=41.297273&radius=50

Example

bash
bash
curl "https://api.sandbox.travelandz.com/v1/flights/airports?queryString=Madrid" \
  -H "Authorization: Bearer $TRAVELANDZ_SECRET_KEY" \
  -H "X-Travelandz-Id: $TRAVELANDZ_PUBLIC_KEY:$TRAVELANDZ_PROFILE_CODE"

Responses

CodeDescription
200Airports retrieved successfully.
400Bad request – invalid payload.
401Unauthorized – invalid or missing credentials.
403Forbidden – invalid credentials.
500Internal server error

200 Response Body

Media type: application/json

json
json
{
  "airports": [
    {
      "name": "Barcelona",
      "city_name": "Barcelona",
      "time_zone": "Europe/Madrid",
      "longitude": 2.080877,
      "latitude": 41.297273,
      "iata_country_code": "ES",
      "iata_code": "BCN",
      "iata_city_code": "BCN",
      "type": "airport",
      "airportName": "Barcelona-El Prat Josep Tarradellas Airport"
    },
    {
      "name": "Barcelona",
      "city_name": "Barcelona",
      "time_zone": "America/Caracas",
      "longitude": -64.684271,
      "latitude": 10.103767,
      "iata_country_code": "VE",
      "iata_code": "BLA",
      "iata_city_code": "BLA",
      "type": "airport",
      "airportName": "General Jose Antonio Anzoategui International Airport"
    }
  ],
  "liveMode": false
}