API reference

HTS APIs

Every endpoint, schema and error code, rendered from the published OpenAPI files, in the order you integrate them.

PUT/api/lodging/v1/geo/querySearch

Get lodgings by geographic location

https://travel-distribution.staging.htsapis.com/api/lodging/v1/geo/query

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 initial request is made, the search area and criteria are encoded into the cursor. 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_up request, 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_size are stable. However, if inventory or ranking changes between calls, some items may be skipped or reappear; clients SHOULD de-duplicate using lodging_id and MUST NOT rely on strict history immutability.

Typical Crawling Pattern

  1. Initial Search: Define your area (BBox, Circle, IATA, or Polygon) and set a page_size (max 200 for efficient crawling).
  2. Process and Paginate: Extract lodging_ids from the response. If next_cursor is present, use it immediately for the next request.
  3. 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.
  4. Handle Rate Limits: Implement exponential backoff if you receive a 429 Too Many Requests response. Monitor standard X-RateLimit headers 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 a cursor.
Exactly one of the following, selected by type:
initial (geo_request_initial) geo_request_initial
request_id
string · uuid
required

A client-generated V4 UUID to track the lifecycle of the request.

Example 123e4567-e89b-12d3-a456-426614174000
type
string enum
required

Must be set to initial. This field identifies the request as a new search query and determines the schema of the remaining fields.

Values initial · Example initial
selector
geo_query_location · one of 4
required

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.
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.
Exactly one of the following, selected by type:
iata (iata_code) iata_code
type
string enum
required

Must be set to iata. This field identifies the selector as an airport code and determines the schema requirements.

Values iata · Example iata
airport_code
string
required

The 3-letter identifier (e.g., LAX, SFO). Must be strictly uppercase.

Length ≥ 3, ≤ 3 · Pattern ^[A-Z]{3}$ · Example JFK
bounding_box (bounding_box) bounding_box
type
string enum
required

Must be set to bounding_box. This field identifies the selector as a rectangular area.

Values bounding_box · Example bounding_box
southwest
coordinates
required

Geographic coordinates

Show fields
latitude
number
required

Latitude coordinate. Note: Precision is capped at 6 decimal places (~11cm). Higher precision is truncated.

Range ≥ -90, ≤ 90 · Example 40.7128
longitude
number
required

Longitude coordinate. Note: Precision is capped at 6 decimal places (~11cm). Higher precision is truncated.

Range ≥ -180, ≤ 180 · Example -74.006
northeast
coordinates
required

Geographic coordinates

Show fields
latitude
number
required

Latitude coordinate. Note: Precision is capped at 6 decimal places (~11cm). Higher precision is truncated.

Range ≥ -90, ≤ 90 · Example 40.7128
longitude
number
required

Longitude coordinate. Note: Precision is capped at 6 decimal places (~11cm). Higher precision is truncated.

Range ≥ -180, ≤ 180 · Example -74.006
polygon (geo_json_polygon) geo_json_polygon
type
string enum
required

Must be set to polygon. This field identifies the selector as a GeoJSON geometry.

Values polygon · Example polygon
coordinates
array of array of array of number
required

An array of linear ring coordinate arrays.

  • Index 0: Exterior ring (boundary).
  • Index 1+: Interior rings (holes).
Items ≥ 1
center
coordinates

Geographic coordinates

Show fields
latitude
number
required

Latitude coordinate. Note: Precision is capped at 6 decimal places (~11cm). Higher precision is truncated.

Range ≥ -90, ≤ 90 · Example 40.7128
longitude
number
required

Longitude coordinate. Note: Precision is capped at 6 decimal places (~11cm). Higher precision is truncated.

Range ≥ -180, ≤ 180 · Example -74.006
circle (circle) circle
type
string enum
required

Must be set to circle. This field identifies the selector as a radial area.

Values circle · Example circle
center
coordinates
required

Geographic coordinates

Show fields
latitude
number
required

Latitude coordinate. Note: Precision is capped at 6 decimal places (~11cm). Higher precision is truncated.

Range ≥ -90, ≤ 90 · Example 40.7128
longitude
number
required

Longitude coordinate. Note: Precision is capped at 6 decimal places (~11cm). Higher precision is truncated.

Range ≥ -180, ≤ 180 · Example -74.006
radius
Radius
required

The distance measurement defining the search extent from the center.

Show fields
value
number
required

The 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).

Range ≥ 0, ≤ 500000 · Example 5
unit
string enum
required

The unit of measurement.

Values mkmmift · Example km
page_size
integer
required

Maximum 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.

Range ≥ 1, ≤ 200 · Example 10
filters
object

Optional 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_friendly
boolean

If true, only return pet-friendly properties. Applies to: hotels and vacation rentals.

Example true
min_star_rating
integer

Minimum star rating (1-5). Applies to: hotels and vacation rentals.

Range ≥ 1, ≤ 5 · Example 3
min_user_rating
number

Minimum user/guest rating on a 0-100 scale. Applies to: hotels and vacation rentals.

Range ≥ 0, ≤ 100 · Example 80
amenities
array of amenity_filter

Required amenities — all specified amenities must be present. Applies to: hotels and vacation rentals.

stay_dates
object

Check-in and check-out dates for filtering by availability. Applies to: hotels and vacation rentals.

Show fields
check_in
string · date
required

Check-in date (YYYY-MM-DD). Must be before check_out.

Example 2026-07-01
check_out
string · date
required

Check-out date (YYYY-MM-DD). Must be after check_in.

Example 2026-07-05
hotel
object

Filters that apply only to hotel properties. Ignored for vacation-rental-only searches.

Show fields
max_star_rating
integer

Maximum star rating (1-5). Useful for budget searches.

Range ≥ 1, ≤ 5 · Example 4
price_range
object

Nightly price range filter. Both min and max are required when present. Assumed USD.

Show fields
min
number
required

Minimum nightly price.

Range ≥ 0 · Example 50
max
number
required

Maximum nightly price.

Range ≥ 0 · Example 300
vacation_rental
object

Filters that apply only to vacation rental properties. Ignored for hotel-only searches.

Show fields
num_adults
integer

Number of adults.

Range ≥ 1 · Example 2
num_children
integer

Number of children.

Range ≥ 0 · Example 1
min_bedrooms
integer

Minimum number of bedrooms.

Range ≥ 1 · Example 2
min_bathrooms
number

Minimum number of bathrooms (supports half-baths, e.g. 1.5).

Range ≥ 0.5 · Example 1.5
min_beds
integer

Minimum number of beds.

Range ≥ 1 · Example 2
lodging_type
array of lodging_type

Types 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.

Items ≥ 1
follow_up (geo_request_follow_up) geo_request_follow_up
request_id
string · uuid
required

A 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.

Example 123e4567-e89b-12d3-a456-426614174000
type
string enum
required

Must be set to follow_up. This field identifies the request as a pagination continuation and determines the schema of the remaining fields.

Values follow_up · Example follow_up
cursor
string
required

The 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.
Example eyJvZmZzZXQiOjIwfQ==

Responses

200Return a geographic query successfully
lodging_ids
array of lodging_id
required
deprecated

Deprecated: 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_results
integer
required

The total count of all matching lodgings across all pages.

Example 150
has_more
boolean
required

Indicates whether more results are available beyond the current page.

Example true
response_id
string · uuid
required

Unique identifier of the specific response. Use this identifier when you need to refer to a specific response, when requiring technical support.

Example 123e4567-e89b-12d3-a456-426614174000
lodgings
array of GeoResult
required

The 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
Array of GeoResult · The 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.
lodging_id
string
required

Unique identifier for the lodging

Example 123e4567-e89b-12d3-a456-426614174000
distance
GeoResultDistance

Geodesic 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
value
number
required

The magnitude of the distance.

Example 1834.6
unit
string enum
required

The unit of measurement. Currently always meters; other units may be added later (handle unknown values gracefully, per Forward Compatibility).

Values m · Example m
next_cursor
string

An opaque string used to fetch the next set of results. If null or omitted, no further results are available.

Example eyJvZmZzZXQiOjIwfQ==
400Invalid Request. There will be an error code in the response detailing the issue.
error_code
string enum
required

Error code for geographic query operation failures

Values invalid_requestunauthorized
description
string
required

Human-readable description of the error

response_id
string · uuid
required

Unique identifier of the specific response. Use this identifier when you need to refer to a specific response, when requiring technical support.

Example 123e4567-e89b-12d3-a456-426614174000
Example
{
  "error_code": "invalid_request",
  "description": "string",
  "response_id": "123e4567-e89b-12d3-a456-426614174000"
}
500Internal server error
error_code
string enum
required

Error returned when an internal server error occurs.

Values internal_server_error
description
string
required

A human-readable description of the error.

response_id
string · uuid
required

Unique identifier of the specific response. Use this identifier when you need to refer to a specific response, when requiring technical support.

Example 123e4567-e89b-12d3-a456-426614174000
Example
{
  "error_code": "internal_server_error",
  "description": "string",
  "response_id": "123e4567-e89b-12d3-a456-426614174000"
}
Request
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"
  ]
}'
Response 200
{
  "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.