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
- Errors
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. |
Errors specific to Autocomplete (5 codes). Common gateway and authentication errors apply to all endpoints and are listed once in the central reference.
🔎
Validation— fix the request and retry
| Group | Code | Message | Description |
|---|---|---|---|
| Validation | 904128 | Inventory validation error. | Returned when the request payload fails schema validation or required fields are missing. Correct the request parameters and send the request again. |
| Validation | 904200 | Flight service validation error: {0} | Returned during flight operations when validation on the remote flight provider side fails. Correct the request parameters and send the request again. |
Rate limit— slow down and retry later
| Group | Code | Message | Description |
|---|---|---|---|
| Rate limit | 901010 | You have exceeded the limit of requests sent per unit time. You can send {1} requests in {0} seconds. | Returned when the rate limit configured for your sales channel / IP is exceeded. Slow down your request rate and retry after the specified window. |
System— retry with backoff; contact support if persistent
| Group | Code | Message | Description |
|---|---|---|---|
| System | 904003 | Unexpected error occured. | Returned when an unexpected system error occurs while processing the flight request. Retry after a short wait; if the issue persists, contact Etscore support. |
| System | 904201 | Flight service system error: {0} | Returned when an internal system error occurs within the remote flight provider service. Retry with backoff; contact support if persistent. |
Common errors not shown here. Gateway, authentication and header errors apply to every endpoint. → See the central Error Codes reference.