How to Search for Vacation Rental Locations
Before searching for vacation rental properties, you need to find a destination using the autocomplete endpoint. This returns location data (coordinates, place ID) and a correlation ID that is required for the property search step.
Autocomplete Endpoint
The vacation rentals API uses the same autocomplete endpoint as hotels and resorts.
Request
GET /hotels/api/v2/autocomplete?key=miami
| Parameter | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Search keyword — a city name, region, state, or landmark |
Optional Headers
| Header | Required | Description |
|---|---|---|
Accept-Language | No | Language code for localized results (e.g., "ar" for Arabic, "es" for Spanish) |
Response
{
"data": [
{
"id": "place_abc123",
"country": "US",
"full_name": "Miami, Florida, United States",
"location": {
"lat": 25.7617,
"long": -80.1918
},
"name": "Miami",
"state": "Florida",
"type": "city"
},
{
"id": "place_def456",
"country": "US",
"full_name": "Miami Beach, Florida, United States",
"location": {
"lat": 25.7907,
"long": -80.13
},
"name": "Miami Beach",
"state": "Florida",
"type": "city"
}
]
}Response Fields
| Field | Type | Description |
|---|---|---|
data | array | List of matching locations |
data[].id | string | Unique place identifier (used as placeid in search) |
data[].country | string | Two-letter country code |
data[].fullname | string | Full display name of the location |
data[].location.lat | number | Latitude coordinate |
data[].location.long | number | Longitude coordinate |
data[].name | string | Short name of the location |
data[].state | string | State or province name |
data[].type | string | Location type: "city", "state", or "multicity" |
Location Types
| Type | Description | Example |
|---|---|---|
city | A specific city | Miami, Paris, Tokyo |
state | A state, province, or region | Florida, Bavaria, Tuscany |
multicity | A broader area spanning multiple cities | Greater Miami Area |
Capturing the Correlation ID
The x-correlation-id is returned as a response header (not in the response body). You must capture this value and include it in the subsequent vacation rental search request.
Example (JavaScript)
const response = await fetch(
'https://uat.travelapi.ai/hotels/api/v2/autocomplete?key=lake+tahoe',
{ headers: { 'Authorization': 'Bearer YOUR_TOKEN' } }
);
const correlationId = response.headers.get('x-correlation-id');
const data = await response.json();
// Use correlationId and data for the next search step
console.log('Correlation ID:', correlationId);
console.log('First result:', data.data[0]);
Example (Python)
import requests
response = requests.get(
'https://uat.travelapi.ai/hotels/api/v2/autocomplete',
params={'key': 'lake tahoe'},
headers={'Authorization': 'Bearer YOUR_TOKEN'}
)
correlation_id = response.headers.get('x-correlation-id')
data = response.json()
print(f"Correlation ID: {correlation_id}")
print(f"First result: {data['data'][0]}")
Multi-Language Support
To receive location names in a specific language, pass the Accept-Language header with a supported language code:
GET /hotels/api/v2/autocomplete?key=paris
Accept-Language: ar
This returns location names localized to the requested language where translations are available.
Values Needed for Search
From the autocomplete response, extract the following values for use in the vacation rental search:
| Value | Source | Used As |
|---|---|---|
| Correlation ID | x-correlation-id response header | x-correlation-id request header in search |
| Latitude | data[].location.lat | lat in search body |
| Longitude | data[].location.long | long in search body |
| Place ID | data[].id | place_id in search body |
Next Steps
With a location selected and a correlation ID captured, you are ready to search for available vacation rental properties.