Autocomplete
POST
/api/v1/generic-api-service/flight/autocomplete
The autocomplete endpoint takes an airport code or free-text query and returns matching airport details. It is typically used to power search-box autocomplete, resolving a user's input into structured airport information.
- cURL
- Request
- Response
- Request Details
- Response Details
curl --location 'https://test-api.etscore.com/api/v1/generic-api-service/flight/autocomplete' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '{
"query": "IST"
}'
{
"query": "IST"
}
{
"success": true,
"airports": [
0: {
"iataCode": "IST",
"name": "Istanbul",
"cityName": "Istanbul",
"cityCode": "IST",
"countryCode": "TR",
"countryName": "Turkey",
"allInCity": true
},
1: {
"iataCode": "IST",
"name": "Istanbul Airport",
"cityName": "Istanbul",
"cityCode": "IST",
"countryCode": "TR",
"countryName": "Turkey",
"allInCity": false
},
2: {
"iataCode": "SAW",
"name": "Sabiha Gokcen International Airport",
"cityName": "Istanbul",
"cityCode": "IST",
"countryCode": "TR",
"countryName": "Turkey",
"allInCity": false
}
]
}
| Name | Type | Required | Description |
|---|---|---|---|
| query | string | Yes | The search term used to look up airports. It can be an IATA code (e.g. IST) or a partial city/airport name. |
| Name | Type | Required | Description |
|---|---|---|---|
| success | boolean | Yes | Indicates whether the request was processed successfully. |
| airports | object-array | Yes | A list of airports matching the query. |
| airports/iataCode | string | Yes | The IATA code of the airport (e.g. IST, SAW). |
| airports/name | string | Yes | The display name of the airport or city. |
| airports/cityName | string | Yes | The name of the city the airport belongs to. |
| airports/cityCode | string | Yes | The IATA city code the airport belongs to. |
| airports/countryCode | string | Yes | The ISO country code of the airport (e.g. TR). |
| airports/countryName | string | Yes | The full country name of the airport. |
| airports/allInCity | boolean | Yes | If true, represents all airports within the city (a city-level 'All Airports' option) rather than a single physical airport. |