Skip to content
HotelPricesAPI
All endpoints

Autocomplete global cities, districts, and destination location_id tokens

GET/v1/locations/search· Updated 2026-11-26

Direct Answer · Hospitality Engineering Summary

GET /v1/locations/search resolves free-text city, airport, neighborhood, or landmark queries (?query=Paris, ?query=Shinjuku, ?query=Dubai Marina) into permanent base64 location_id and numeric dest_id handles, property counts, country codes, timezones, and lat/lng centroids for 2 Credits per call.

Caching, Latency & Scope Boundaries

  • →All resolved destination queries are cached permanently in PostgreSQL (hotel_locations) + 30-day Redis (hp:loc:) so subsequent lookups return in <25ms without touching upstream.
  • →Top 50 global travel cities are already pre-seeded—you can pass ?city=Paris or ?city=Tokyo directly to /v1/hotels/search without calling /v1/locations/search first.

Resolves destination queries into canonical location_id handles, GPS coordinates, timezones, and available hotel counts. Top 50 global cities are pre-seeded for sub-20ms resolution. Cost: 2 Credits / call.

Parameters

  • querystringrequired

  • limitinteger (1 to 20)

Example Request (cURL / Python / JavaScript)

curl "https://api.hotelpricesapi.com/v1/locations/search?query=Paris" \
  -H "x-api-key: hp_live_your_api_key"

Live Response Preview

{
  "code": 0,
  "provider": "https://hotelpricesapi.com",
  "status": "ok",
  "msg": "success",
  "data": {
    "query": "Paris",
    "count": 1,
    "locations": [
      {
        "location_id": "eyJjaXR5X25hbWUiOiJQYXJpcyIsImNvdW50cnkiOiJGcmFuY2UiLCJkZXN0X2lkIjoiLTE0NTY5MjgiLCJkZXN0X3R5cGUiOiJjaXR5In0=",
        "dest_id": "-1456928",
        "dest_type": "city",
        "name": "Paris",
        "city_name": "Paris",
        "region": "Ile de France",
        "country": "France",
        "country_code": "fr",
        "label": "Paris, Ile de France, France",
        "latitude": 48.85668,
        "longitude": 2.35148,
        "hotels_count": 27083,
        "timezone": "Europe/Paris"
      }
    ]
  }
}

Response Fields

Normalized destination matches

Status Codes

200
Normalized destination matches