How to Search for Resort Destinations
Before searching for available resort properties, you need a region code that identifies the destination. The autocomplete endpoint lets you search for destinations by keyword and returns matching cities, states, countries, and individual resorts along with their region codes.
Endpoint
GET {{apihost}}/resorts/api/v2/search?key={searchterm}
Required Headers
| Header | Value | Required |
|---|---|---|
x-api-key | Your API key | Yes |
x-correlation-id | Unique correlation identifier | Yes |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
key | string | Yes | The search keyword (e.g., "hawaii", "cancun", "maldives") |
Example Request
GET {{api_host}}/resorts/api/v2/search?key=hawaii
Example Response
{
"status": 200,
"data": [
{
"name": "Hawaii",
"full_name": "Hawaii, United States",
"city": "",
"state": "Hawaii",
"country": "United States",
"region": "aGF3YWlp",
"type": "state",
"popularity": 95,
"location": {
"lat": 19.8968,
"lon": -155.5828
}
},
{
"name": "Maui",
"full_name": "Maui, Hawaii, United States",
"city": "Maui",
"state": "Hawaii",
"country": "United States",
"region": "bWF1aQ==",
"type": "city",
"popularity": 88,
"location": {
"lat": 20.7984,
"lon": -156.3319
}
}
]
}Response Fields
| Field | Type | Description |
|---|---|---|
name | string | Short display name of the destination |
full_name | string | Full display name including parent geography |
city | string | City name, if applicable |
state | string | State or province name, if applicable |
country | string | Country name |
region | string | Base64-encoded region code. Required for the property search endpoint. |
type | string | One of "resort", "city", "state", or "country" |
popularity | number | Relative popularity score for ranking results |
location.lat | number | Latitude of the destination |
location.lon | number | Longitude of the destination |
Understanding the Region Code
The region field contains a Base64-encoded identifier that the Resorts API uses internally to scope property searches. You do not need to decode this value — pass it directly as the {xeniregioncode} path parameter when calling the property search endpoint.
Understanding Result Types
The type field tells you the geographic scope of each result:
resort— A specific resort property. Searching with this region code returns that single property.city— A city-level destination. Returns all resorts in that city.state— A state or province. Returns all resorts across the state.country— A country-level destination. Returns all resorts in the country.
Choose the appropriate scope based on your use case. For a broad search, use a state or country result. For a targeted search, use a city or specific resort.
Error Responses
400 — Missing Search Key
Returned when the key query parameter is missing or empty.
{
"message": "Missing required parameter: key",
"status": 400
}404 — No Results Found
Returned when no destinations match the search term.
{
"message": "No results found",
"status": 404
}Best Practices
- Implement typeahead — Call this endpoint as the user types to provide real-time destination suggestions. A debounce of 300ms is recommended.
- Display the
full_name— Show users the full name (e.g., "Maui, Hawaii, United States") for clarity, especially when multiple results share the same short name. - Store the
regionandlocation— You will need both the region code (for the search path parameter) and the latitude/longitude coordinates (for the search request body) in the next step. - Use
popularityfor sorting — Order autocomplete suggestions by thepopularityfield to surface the most relevant destinations first.