Agoda API endpoint
Resolves a free-text city or airport name into IATA airport codes for flight search, with each city's direct and nearby airports.
/agoda/flights/search-locationsQuery parameters:
keyword (required) — free-text city or airport name, e.g. Bangkok.Notable response behavior:
keyword returns 400 before any upstream request
is made.200 with an empty suggestions list,
not an error.city_code is only present when the location has its own distinct
city-wide booking code (e.g. Bangkok's is BKK, matching its single main
airport). Locations with no distinct city-wide code (e.g. a city served
by one airport with a different code from the city name) have an empty
city_code — use one of airports[].code instead.airports lists airports directly serving the location; nearby_airports
lists nearby alternates (each with a distance_km), only populated for
some entries.| Field | Filled in, of 10 checked | Values in the sample |
|---|---|---|
| name | 10 | “Bangkok” and 9 other values |
| city_code | 1 | |
| country_code | 10 | |
| country_name | 10 | “Thailand” and 6 other values |
| state_name | 10 | “Bangkok Province” and 8 other values |
| airports | 2 | median 1 entry |
| nearby_airports | 9 | median 2 entries |
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| keyword | string | Yes | Free-text city or airport name | Bangkok | |
| x-api-key (header) | string | Yes | API key required |
curl -X GET "https://api.crawlora.net/api/v1/agoda/flights/search-locations?keyword=Bangkok" \ -H "x-api-key: $CRAWLORA_API_KEY"
{
"code": 200,
"msg": "OK",
"data": {
"keyword": "Bangkok",
"count": 1,
"suggestions": [
{
"name": "Bangkok",
"city_code": "BKK",
"country_code": "TH",
"country_name": "Thailand",
"state_name": "Bangkok Province",
"airports": [
{
"code": "BKK",
"name": "Suvarnabhumi Airport",
"lat": 13.681108,
"lng": 100.747283
}
]
}
]
}
}Request schema
No body schema
Response schema
#/definitions/agoda.flightLocationSearchResponseDoc
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| code | integer | No | 200 | |||
| data | agoda.FlightLocationSearchResponse | No | ||||
| data.count | integer | No | 1 | |||
| data.keyword | string | No | Bangkok | |||
| data.suggestions | array | No | ||||
| data.suggestions[].airports | array | No | ||||
| data.suggestions[].airports[].code | string | No | BKK | |||
| data.suggestions[].airports[].distance_km | integer | No | 73 | |||
| data.suggestions[].airports[].lat | number | No | 13.681108 | |||
| data.suggestions[].airports[].lng | number | No | 100.747283 | |||
| data.suggestions[].airports[].name | string | No | Suvarnabhumi Airport | |||
| data.suggestions[].city_code | string | No | BKK | CityCode is Agoda's own multi-airport city-level search code, only present when the city has a distinct bookable code of its own (e.g. Bangkok's is "BKK", matching its single main airport). Empty when the location has no distinct city-wide code -- use one of Airports[].Code instead (e.g. Phuket has no city code, only its airport's "HKT"). | ||
| data.suggestions[].country_code | string | No | TH | |||
| data.suggestions[].country_name | string | No | Thailand | |||
| data.suggestions[].name | string | No | Bangkok | |||
| data.suggestions[].nearby_airports | array | No | ||||
| data.suggestions[].nearby_airports[].code | string | No | BKK | |||
| data.suggestions[].nearby_airports[].distance_km | integer | No | 73 | |||
| data.suggestions[].nearby_airports[].lat | number | No | 13.681108 | |||
| data.suggestions[].nearby_airports[].lng | number | No | 100.747283 | |||
| data.suggestions[].nearby_airports[].name | string | No | Suvarnabhumi Airport | |||
| data.suggestions[].state_name | string | No | Bangkok Province | |||
| msg | string | No | OK |
| Status | Description | Schema |
|---|---|---|
| 400 | Bad Request | #/definitions/app.Response |
| 500 | Internal Server Error | #/definitions/app.Response |
| 503 | Service Unavailable | #/definitions/app.Response |
Use environment variables for secrets and keep Crawlora API keys server-side.
curl -X GET "https://api.crawlora.net/api/v1/agoda/flights/search-locations?keyword=Bangkok" \
-H "x-api-key: $CRAWLORA_API_KEY"