Getting Started with the Xeni Activities APIHow to Book an ActivityHow to Browse Activity Tags and CategoriesHow to Cancel an Activity BookingHow to Check Activity AvailabilityHow to Get Activity DetailsHow to Retrieve Activity Booking DetailsHow to Search for Activities with FiltersHow to Search for Activity DestinationsCar Rental API - Getting StartedCar Rental API - Understanding Response FieldsHow to Book a Car RentalHow to Get Rental Car Details and Equipment Add-OnsHow to Retrieve or Cancel a Car Rental BookingHow to Search for Available Rental CarsHow to Search for Pickup LocationsHow to Use Car Rental Search FiltersDeals API Best Practices for IntegrationDeals API Frequently Asked QuestionsGetting Started with the Xeni Deals APIDeals API Request Parameters and Headers ReferenceDeals API Supported Currencies and LocalizationHow to Display Deals in Your ApplicationHow to Fetch Hotel Deals by LocationFlights API Error Codes and TroubleshootingGetting Started with the Xeni Flights APIHow to Book a FlightHow to Check Flight Availability and PricingHow to Confirm or Cancel a Flight BookingHow to Retrieve Fare Rules for a FlightHow to Retrieve Flight Booking DetailsHow to Search for Airports Using AutocompleteHow to Search for FlightsHow to Use Flight Search Filters, Sorting, and PaginationHow to Check Room Availability and PricingHow to Filter Vacation Rental ResultsHow to Get Resort Property Details, Amenities, and AccessibilityHow to Hold and Confirm a Resort BookingHow to Release a Resort HoldHow to Retrieve Resort Booking DetailsHow to Search for Available ResortsHow to Search for Resort DestinationsHow to Search for Vacation Rental LocationsHow to Search for Vacation RentalsHow to Use Resort Search Filters and SortingGetting Started with the Xeni Resorts APIResorts API: Understanding Booking Statuses and PoliciesGetting Started with the Vacation Rentals APIVacation Rentals Frequently Asked QuestionsVacation Rentals Supported Property TypesUnderstanding Async Search for Vacation RentalsAuthentication & API SignaturesBooking Hotels — Direct API & SSO CheckoutError Handling, Rate Limits & Best PracticesGetting Started with the Xeni Hotels APIManaging Bookings: Status, Retrieval & CancellationPricing Confirmation & Token LifecycleRetrieving Hotel Details & Room AvailabilitySearching for Hotels: Locations, Filters & PaginationSearching for HotelsSession Management & Correlation IDsAPI authentication and getting your API keys

Understanding Async Search for Vacation Rentals

Last updated: 2026-03-03

Understanding Async Search for Vacation Rentals

The Vacation Rentals API supports two search modes: synchronous and asynchronous. Async mode returns partial results quickly while suppliers continue to respond, giving users a faster initial experience.

Sync vs. Async Mode

FeatureSync (isasync: false)Async (isasync: true)
Initial response timeSlower (waits for all suppliers)Faster (returns available results immediately)
Response completenessAll results in one responsePartial results, building over time
Polling requiredNoYes
Status field"success""in_progress" then "success"
Best forBackground processing, batch queriesReal-time user-facing search UIs

How Sync Mode Works

With is_async: false (the default), the API waits for all suppliers to return results before responding.

JSON
{
  "is_async": false
}

Important: When using sync mode, if the response returns status: "in_progress", this means the request timed out before all suppliers finished. In this case, you should re-poll the endpoint with the same x-correlation-id to retrieve the complete results.

Sync Mode Flow

1. POST /hotels/api/v2/properties/vacation-rentals
   → is_async: false
   ← { status: "success", data: { total: 142, hotels: [...] } }

Done — all results returned.

How Async Mode Works

With is_async: true, the API returns whatever results are available immediately. You poll the same endpoint to get updated results as more suppliers respond.

JSON
{
  "is_async": true
}

Async Mode Flow

1. POST /hotels/api/v2/properties/vacation-rentals
   → isasync: true, x-correlation-id: corrabc123
   ← { status: "in_progress", data: { total: 45, hotels: [...] } }

Partial results — show these to the user.

  1. POST /hotels/api/v2/properties/vacation-rentals
→ Same body, same x-correlation-id: corr_abc123
← { status: "in_progress", data: { total: 98, hotels: [...] } }

More results — update the UI.

  1. POST /hotels/api/v2/properties/vacation-rentals
→ Same body, same x-correlation-id: corr_abc123
← { status: "success", data: { total: 142, hotels: [...] } }

All results returned — stop polling.

Polling Implementation

When using async mode, implement a polling loop that:

  1. Sends the search request.
  2. Checks the status field in the response.
  3. If "in_progress", waits briefly then re-sends the same request with the same correlation ID.
  4. If "success", stops polling — all results are in.

JavaScript Example

JAVASCRIPT
async function searchVacationRentals(correlationId, searchBody) {
  const url = 'https://uat.travelapi.ai/hotels/api/v2/properties/vacation-rentals?currency=USD&page=1&limit=50&amenities=true';

let status = 'in_progress';
let results = null;

while (status === 'in_progress') {
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-correlation-id': correlationId
},
body: JSON.stringify(searchBody)
});

results = await response.json();
status = results.status;

if (status === 'in_progress') {
// Display partial results to the user
displayResults(results.data.hotels);

// Wait 2-3 seconds before polling again
await new Promise(resolve => setTimeout(resolve, 2500));
}
}

// Final results
displayResults(results.data.hotels);
return results;
}

Python Example

PYTHON
import requests
import time

def searchvacationrentals(correlationid, searchbody):
url = 'https://uat.travelapi.ai/hotels/api/v2/properties/vacation-rentals'
params = {'currency': 'USD', 'page': 1, 'limit': 50, 'amenities': 'true'}
headers = {
'Content-Type': 'application/json',
'x-correlation-id': correlation_id
}

status = 'in_progress'
results = None

while status == 'in_progress':
response = requests.post(url, params=params, headers=headers, json=search_body)
results = response.json()
status = results['status']

if status == 'in_progress':
print(f"Partial results: {results['data']['total']} properties found so far")
time.sleep(2.5)

print(f"Complete: {results['data']['total']} total properties")
return results

Polling Best Practices

PracticeRecommendation
Poll intervalWait 2-3 seconds between requests
Maximum pollsSet a limit (e.g., 10 attempts) to avoid infinite loops
Display partial resultsShow available results to the user while polling continues
Loading indicatorDisplay a progress indicator while status is "in_progress"
Correlation IDAlways reuse the same x-correlation-id from the autocomplete response

Choosing the Right Mode

Use CaseRecommended Mode
User-facing search pageAsync — show results as they arrive
API-to-API integrationSync — simpler implementation, one request
Mobile app with loading spinnerAsync — faster perceived performance
Batch processing or data exportSync — wait for complete results
Price comparison across many destinationsSync — need full data for comparison

Handling Edge Cases

No Results Found

If no vacation rentals match the search criteria, the response returns a 404 status code. This can happen in both sync and async modes.

Timeout in Sync Mode

If the sync request times out and returns status: "in_progress", treat it like an async response and poll for the remaining results using the same correlation ID.

Stale Correlation ID

Correlation IDs are linked to a specific autocomplete request. If you need to search a new location, call autocomplete again to get a fresh correlation ID. Do not reuse correlation IDs across different location searches.

Next Steps

Review the full list of supported vacation rental property types and what each type offers.

Was this article helpful?