Hostelworld City Autocomplete API Documentation Turn a name into Hostelworld ids. Returns cities, regions, popular places and properties that match the text, each with a numeric id, a display name and a type. Use the id of a city result as city_id in the search endpoint. A query without matches is a successful, billable response with an empty results list.
Run this endpoint
Endpoint
Parameters
Start with the required fields, then add optional filters only when your use case needs them.
Runnable path
1 required parameter needed before sending a request.
string
Required
Text to look up, 2 to 100 characters. Example: berlin.
coffee shops
Response Schema
Example response fields are illustrative; inspect the JSON before integrating.
Example response fields
Scan these fields before integrating.
data
meta
success
{
"data": {
"results": [
{
"id": 26,
"name": "Berlin, Germany",
"type": "city"
},
{
"id": 11283,
"name": "Berlin, New Hampshire, USA",
"type": "city"
},
{
"id": 11286,
"city": {
"id": 26,
"name": "Berlin",
"country": "Germany"
},
"name": "EastSeven Berlin Hostel, Berlin, Germany",
"type": "property"
}
]
},
"meta": {
"billable": true,
"endpoint_family": "autocomplete"
},
"success": true
}
Errors
Handle these documented responses before retrying or showing customer-facing failures.
Validation Error
A required query parameter is missing or invalid. This response is not billable.
{
"errors": {
"query": [
"The query field is required."
]
},
"message": "The request validation failed"
}Invalid Source Response
Hostelworld answered with a shape that no longer matches the documented contract. This response is not billable.
{
"meta": {
"billable": false,
"retryable": true,
"endpoint_family": "autocomplete"
},
"error": {
"code": "PARSER_DRIFT",
"message": "The Hostelworld response could not be read. Please retry later."
},
"success": false
}Service Unavailable
The upstream service is temporarily unavailable. Please retry shortly.
{
"meta": {
"billable": false,
"retryable": true,
"endpoint_family": "autocomplete"
},
"error": {
"code": "UPSTREAM_UNAVAILABLE",
"message": "The Hostelworld API is temporarily unavailable. Please retry."
},
"success": false
}Generate Code with AI
Copy a ready-made prompt with all the endpoint details, parameters, and example responses. Paste it into ChatGPT, Claude, or any AI assistant to instantly generate working code.
Try It Live
Test this endpoint in our interactive playground with real data.