GET/v1/flights/airports
Buscar aeropuertos
Busca metadata de aeropuertos por texto libre o coordenadas cercanas para autocompletados y flujos de búsqueda por ubicación.
Busca metadata de aeropuertos por texto libre o coordenadas cercanas para autocompletados y flujos de búsqueda por ubicación.
Endpoint
| Método | Ruta | Auth |
|---|---|---|
GET | /v1/flights/airports | API key requerida |
| Header | Descripción |
|---|---|
Authorization | Bearer <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-Type | Use application/json for requests with a body. |
Esquema de parámetros de la petición
| Propiedad | Tipo | Detalles | Requerido | Notas |
|---|---|---|---|---|
lat | number | No | Required when queryString is not provided | |
lng | number | No | Required when queryString is not provided | |
radius | number | No | Required when queryString is not provided | |
queryString | string | No | Alternative to coordinates |
Respuesta exitosa
Devuelve matching airports and location metadata.
Esquema del cuerpo de la respuesta
| Propiedad | Tipo | Detalles | Requerido | Notas |
|---|---|---|---|---|
array | Sí | - | ||
name | string | Sí | - | |
city_name | string | Sí | - | |
time_zone | string | Sí | - | |
longitude | number | Sí | - | |
latitude | number | Sí | - | |
iata_country_code | string | Sí | - | |
iata_code | string | Sí | - | |
iata_city_code | string | Sí | - | |
type | string | Sí | - | |
airportName | string | Sí | - | |
distanceFromPoint | number | No | - | |
Notas operativas
queryString can be used for text search. When using geographic search, send lat, lng and optional radius; radius defaults to 30 kilometers.
Ejemplo
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"