HTS APIs
Every endpoint, schema and error code, rendered from the published OpenAPI files, in the order you integrate them.
/api/lodging/v1/geo/querySearchGet lodgings by geographic location
Query lodgings within a specified geographic area using location criteria. Supports initial searches and follow-up requests using a stateful pagination token.
Paging Stability & Crawling Guarantees
To ensure reliable asynchronous crawling and interactive performance, this endpoint provides the following guarantees:
- Snapshot of Parameters: Once an
initialrequest is made, the search area and criteria are encoded into thecursor. Subsequent requests using that cursor will reuse the same search parameters, even though the underlying inventory may change between calls (for example, new properties becoming available or existing ones being removed). - Stateless Sequential Access: Cursors are designed for sequential forward-only traversal. You do not need to resend original filters or coordinates in a
follow_uprequest, as they are encoded within the token. - Best-Effort Non-Repetition: The service attempts not to repeat results already retrieved in previous pages of the same cursor session when the underlying result set and
page_sizeare stable. However, if inventory or ranking changes between calls, some items may be skipped or reappear; clients SHOULD de-duplicate usinglodging_idand MUST NOT rely on strict history immutability.
Typical Crawling Pattern
- Initial Search: Define your area (BBox, Circle, IATA, or Polygon) and set a
page_size(max 200 for efficient crawling). - Process and Paginate: Extract
lodging_idsfrom the response. Ifnext_cursoris present, use it immediately for the next request. - Token Management: Cursors are short-lived and typically remain valid for up to 24 hours (not guaranteed). For large-scale crawls, design your worker threads to process the pagination chain promptly and be resilient to earlier token expiration.
- Handle Rate Limits: Implement exponential backoff if you receive a
429 Too Many Requestsresponse. Monitor standardX-RateLimitheaders to tune your crawling speed.
Performance Guardrails
- Max Results: A single query chain is capped at 10,000 total results. Areas returning more results should be subdivided into smaller geographic clusters.
- Geometric Limits: Circles are capped at 500km radius; Bounding Boxes are capped at 10 square degrees.
Request body application/json · required
Geographic query criteria - either initial selection with location and filters, or follow-up selection with pagination token
A polymorphic container for geographic query requests.
This object uses the type field as a discriminator to switch between:
initial: Used for starting a new search with a geographic selector (BBox, Circle, etc.).follow_up: Used for paginating through existing results using acursor.
type:initial (geo_request_initial) geo_request_initial
request_idA client-generated V4 UUID to track the lifecycle of the request.
123e4567-e89b-12d3-a456-426614174000typeMust be set to initial.
This field identifies the request as a new search query and determines the schema of the remaining fields.
initial · Example initialselectorThe geographic selector.
Best Practices for Efficiency:
- Interactive Use: For sub-second response times, utilize Circles < 50km or Bounding Boxes < 1 square degree.
- Asynchronous Crawling: Larger areas (up to system limits) should be used with
page_size>= 100 to minimize the number of round-trips.
Show fields
The geographic selector.
Best Practices for Efficiency:
- Interactive Use: For sub-second response times, utilize Circles < 50km or Bounding Boxes < 1 square degree.
- Asynchronous Crawling: Larger areas (up to system limits) should be used with
page_size>= 100 to minimize the number of round-trips.
type:iata (iata_code) iata_code
typeMust be set to iata.
This field identifies the selector as an airport code and determines the schema requirements.
iata · Example iataairport_codeThe 3-letter identifier (e.g., LAX, SFO). Must be strictly uppercase.
^[A-Z]{3}$ · Example JFKbounding_box (bounding_box) bounding_box
typeMust be set to bounding_box.
This field identifies the selector as a rectangular area.
bounding_box · Example bounding_boxsouthwestGeographic coordinates
Show fields
latitudeLatitude coordinate. Note: Precision is capped at 6 decimal places (~11cm). Higher precision is truncated.
40.7128longitudeLongitude coordinate. Note: Precision is capped at 6 decimal places (~11cm). Higher precision is truncated.
-74.006northeastGeographic coordinates
Show fields
latitudeLatitude coordinate. Note: Precision is capped at 6 decimal places (~11cm). Higher precision is truncated.
40.7128longitudeLongitude coordinate. Note: Precision is capped at 6 decimal places (~11cm). Higher precision is truncated.
-74.006polygon (geo_json_polygon) geo_json_polygon
typeMust be set to polygon.
This field identifies the selector as a GeoJSON geometry.
polygon · Example polygoncoordinatesAn array of linear ring coordinate arrays.
- Index 0: Exterior ring (boundary).
- Index 1+: Interior rings (holes).
centerGeographic coordinates
Show fields
latitudeLatitude coordinate. Note: Precision is capped at 6 decimal places (~11cm). Higher precision is truncated.
40.7128longitudeLongitude coordinate. Note: Precision is capped at 6 decimal places (~11cm). Higher precision is truncated.
-74.006circle (circle) circle
typeMust be set to circle.
This field identifies the selector as a radial area.
circle · Example circlecenterGeographic coordinates
Show fields
latitudeLatitude coordinate. Note: Precision is capped at 6 decimal places (~11cm). Higher precision is truncated.
40.7128longitudeLongitude coordinate. Note: Precision is capped at 6 decimal places (~11cm). Higher precision is truncated.
-74.006radiusThe distance measurement defining the search extent from the center.
Show fields
valueThe magnitude of the distance. When converted to meters, must be between 1000 m and 100 km (100,000 m) inclusive. The allowed numeric range depends on the unit (e.g., 1–100 km, 1000–100000 m).
5unitThe unit of measurement.
mkmmift · Example kmpage_sizeMaximum number of lodging results to return in a single response. Guardrails: * To prevent system degradation, a single query (including all subsequent pages) is limited to a maximum of 10,000 total results.
10filtersOptional filters to narrow results by property attributes. Filters are embedded in the pagination cursor — follow-up requests automatically apply the same filters without needing to re-send them.
Show fields
pet_friendlyIf true, only return pet-friendly properties. Applies to: hotels and vacation rentals.
truemin_star_ratingMinimum star rating (1-5). Applies to: hotels and vacation rentals.
3min_user_ratingMinimum user/guest rating on a 0-100 scale. Applies to: hotels and vacation rentals.
80amenitiesRequired amenities — all specified amenities must be present. Applies to: hotels and vacation rentals.
stay_datesCheck-in and check-out dates for filtering by availability. Applies to: hotels and vacation rentals.
Show fields
check_inCheck-in date (YYYY-MM-DD). Must be before check_out.
2026-07-01check_outCheck-out date (YYYY-MM-DD). Must be after check_in.
2026-07-05hotelFilters that apply only to hotel properties. Ignored for vacation-rental-only searches.
Show fields
max_star_ratingMaximum star rating (1-5). Useful for budget searches.
4price_rangeNightly price range filter. Both min and max are required when present. Assumed USD.
Show fields
minMinimum nightly price.
50maxMaximum nightly price.
300vacation_rentalFilters that apply only to vacation rental properties. Ignored for hotel-only searches.
Show fields
num_adultsNumber of adults.
2num_childrenNumber of children.
1min_bedroomsMinimum number of bedrooms.
2min_bathroomsMinimum number of bathrooms (supports half-baths, e.g. 1.5).
1.5min_bedsMinimum number of beds.
2lodging_typeTypes of lodgings to include in the search results. Defaults to ["hotel"] when omitted.
hotel: Hotel properties.vacation_rental: Vacation rental properties.
Vacation rental inventory is not available for all tenants.
Requesting vacation_rental for an unsupported tenant returns InvalidRequest.
follow_up (geo_request_follow_up) geo_request_follow_up
request_idA unique UUID (version 4) for this specific request. Note: This should be a new ID for the follow-up, distinct from the initial request ID, to allow for granular log tracking.
123e4567-e89b-12d3-a456-426614174000typeMust be set to follow_up.
This field identifies the request as a pagination continuation and determines the schema of the remaining fields.
follow_up · Example follow_upcursorThe opaque pagination token received from the previous 'GeoResponse'.
Stability Guidelines:
- Expiration: Tokens are short-lived and may expire; clients must not rely on a fixed validity window. In practice, most tokens remain usable for up to 24 hours, but this is not guaranteed and may change without notice.
- Statelessness: Tokens are strictly for sequential access; skipping pages is not supported.
- Result Shifts: While the search area is locked in the token, the specific lodgings returned may vary slightly if inventory is updated between page requests.
eyJvZmZzZXQiOjIwfQ==Responses
200Return a geographic query successfully
lodging_idsDeprecated: use lodgings instead, which carries the same lodgings in the
same order plus per-lodging data. A list of unique identifiers for lodging
properties found within the geographic search area.
total_resultsThe total count of all matching lodgings across all pages.
150has_moreIndicates whether more results are available beyond the current page.
trueresponse_idUnique identifier of the specific response. Use this identifier when you need to refer to a specific response, when requiring technical support.
123e4567-e89b-12d3-a456-426614174000lodgingsThe lodgings found within the geographic search area, in result (sort)
order. Always present, with exactly one entry per matching lodging on
this page — the same membership and order as the deprecated
lodging_ids. An entry is never omitted because its distance is
unknown; distance is simply absent in that case.
Show fields
lodging_idUnique identifier for the lodging
123e4567-e89b-12d3-a456-426614174000distanceGeodesic straight-line distance (WGS84 ellipsoid) from the search's resolved reference location to the lodging's coordinates. Not a travel (driving/walking) distance. Omitted when unknown for this lodging or when the search has no resolvable reference location.
Show fields
valueThe magnitude of the distance.
1834.6unitThe unit of measurement. Currently always meters; other units may be added later (handle unknown values gracefully, per Forward Compatibility).
m · Example mnext_cursorAn opaque string used to fetch the next set of results. If null or omitted, no further results are available.
eyJvZmZzZXQiOjIwfQ==400Invalid Request. There will be an error code in the response detailing the issue.
error_codeError code for geographic query operation failures
invalid_requestunauthorizeddescriptionHuman-readable description of the error
response_idUnique identifier of the specific response. Use this identifier when you need to refer to a specific response, when requiring technical support.
123e4567-e89b-12d3-a456-426614174000Example
{
"error_code": "invalid_request",
"description": "string",
"response_id": "123e4567-e89b-12d3-a456-426614174000"
}500Internal server error
error_codeError returned when an internal server error occurs.
internal_server_errordescriptionA human-readable description of the error.
response_idUnique identifier of the specific response. Use this identifier when you need to refer to a specific response, when requiring technical support.
123e4567-e89b-12d3-a456-426614174000Example
{
"error_code": "internal_server_error",
"description": "string",
"response_id": "123e4567-e89b-12d3-a456-426614174000"
}curl -X PUT "https://travel-distribution.staging.htsapis.com/api/lodging/v1/geo/query" \
-H "HTS-API-KEY: $HTS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"request_id": "123e4567-e89b-12d3-a456-426614174000",
"type": "initial",
"selector": {
"type": "iata",
"airport_code": "JFK"
},
"page_size": 10,
"filters": {
"pet_friendly": true,
"min_star_rating": 3,
"min_user_rating": 80,
"amenities": [
"pool",
"wifi"
],
"stay_dates": {
"check_in": "2026-07-01",
"check_out": "2026-07-05"
},
"hotel": {
"max_star_rating": 4,
"price_range": {
"min": 50,
"max": 300
}
},
"vacation_rental": {
"num_adults": 2,
"num_children": 1,
"min_bedrooms": 2,
"min_bathrooms": 1.5,
"min_beds": 2
}
},
"lodging_type": [
"hotel"
]
}'{
"total_results": 150,
"has_more": true,
"next_cursor": "eyJvZmZzZXQiOjIwfQ==",
"response_id": "123e4567-e89b-12d3-a456-426614174000",
"lodgings": [
{
"lodging_id": "123e4567-e89b-12d3-a456-426614174000",
"distance": {
"value": 1834.6,
"unit": "m"
}
}
]
}Examples are generated from the schema where the spec publishes none; field values are illustrative.
