Deals API Request Parameters and Headers Reference
This article provides a detailed reference for every query parameter and HTTP header accepted by the Deals API endpoint. Understanding each field helps you construct precise requests and get the most relevant results.
Query Parameters
lat (required)
- Type: float
- Example:
34.0522
-90.0 (South Pole) to 90.0 (North Pole). The API uses this coordinate, along with long, to determine which hotel deals to return based on proximity.
Use at least four decimal places for accurate results. Four decimal places provide precision to approximately 11 meters, which is more than sufficient for deal searches.
lat=48.8566 ← Paris, France
lat=35.6762 ← Tokyo, Japan
lat=-33.8688 ← Sydney, Australia
long (required)
- Type: float
- Example:
-118.2437
-180.0 (west) to 180.0 (east).
long=2.3522 ← Paris, France
long=139.6503 ← Tokyo, Japan
long=151.2093 ← Sydney, Australia
currency (required)
- Type: string
- Example:
USD
| Code | Currency |
|---|---|
USD | US Dollar |
EUR | Euro |
GBP | British Pound Sterling |
CAD | Canadian Dollar |
AUD | Australian Dollar |
MXN | Mexican Peso |
JPY | Japanese Yen |
BRL | Brazilian Real |
top_destination (optional)
- Type: boolean
- Default:
false - Example:
true
true, the API returns deals for popular travel destinations near the provided coordinates rather than strictly the closest properties. This is useful for building "Top Destinations" or "Trending Deals" sections where you want to highlight well-known locations rather than the nearest available hotel.
When omitted or set to false, the API returns deals based purely on proximity to the given coordinates.
# Proximity-based deals (default)
?lat=40.7128&long=-74.0060¤cy=USD
Top destination deals
?lat=40.7128&long=-74.0060¤cy=USD&top_destination=true
HTTP Headers
accept (required)
- Value:
application/json
application/json.
accept-language (recommended)
- Value: Language tag (e.g.,
en,es,fr,de) - Default behavior:
enif omitted
accept-language: en ← English
accept-language: es ← Spanish
accept-language: fr ← French
accept-language: de ← German
accept-language: pt-BR ← Brazilian Portuguese
origin (recommended)
- Value: Your application's origin URL
- Example:
https://yourdomain.com
referer (recommended)
- Value: The full URL of the page making the request
- Example:
https://yourdomain.com/deals
origin, this aids in request tracking and analytics.
timezone (recommended)
- Value: IANA timezone identifier
- Example:
America/Los_Angeles
Common timezone values:
| Timezone | Region |
|---|---|
America/NewYork | US Eastern |
America/Chicago | US Central |
America/Denver | US Mountain |
America/LosAngeles | US Pacific |
Europe/London | United Kingdom |
Europe/Paris | Central Europe |
Asia/Tokyo | Japan |
Australia/Sydney | Eastern Australia |
You can detect the user's timezone programmatically in JavaScript:
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
// e.g., "America/Los_Angeles"
x-correlation-id (required)
- Value: UUID v4
- Example:
550e8400-e29b-41d4-a716-446655440000
const correlationId = crypto.randomUUID();
If you need to contact Xeni support about a specific request, provide the x-correlation-id value so the team can trace it through the system.
x-session-id (required)
- Value: UUID v4
- Example:
6fa459ea-ee8a-3ca4-894e-db77e160355e
x-correlation-id which changes per request, x-session-id should remain the same throughout a single user session.
This helps the API optimize results and allows Xeni to track user journeys for analytics purposes.
// Generate once per session and reuse
if (!sessionStorage.getItem('xeniSessionId')) {
sessionStorage.setItem('xeniSessionId', crypto.randomUUID());
}
const sessionId = sessionStorage.getItem('xeniSessionId');
Complete Request Example
Putting all parameters and headers together:
curl -X GET "https://travelapi.ai/hotels/api/v2/deals?lat=51.5074&long=-0.1278¤cy=GBP&top_destination=true" \
-H "accept: application/json" \
-H "accept-language: en" \
-H "origin: https://myapp.com" \
-H "referer: https://myapp.com/travel-deals" \
-H "timezone: Europe/London" \
-H "x-correlation-id: d290f1ee-6c54-4b01-90e6-d701748f0851" \
-H "x-session-id: 7c9e6679-7425-40de-944b-e07fc1f90ae7"