Content
Destinations
The countries and cities a search can be run in. Pick one here, then search with it.
/api/v1/destinations x-api-keyA search by place needs a place the API knows by name. This is that list: every country and city that has hotels to offer, in one alphabetical list. A country comes first, then its cities. Nothing in it says where a place came from, and a city that is covered more than one way is listed once.
Query Parameters
type"country" | "city" optional- Only countries, or only cities. Omit for both.
countrystring optional- Only this country’s destinations: an ISO-2 code (
ZW) or an English name (Zimbabwe), in any case. A country that is not recognised returns an empty list, not an error. qstring optional- Names that start with this text, in any case —
harfinds Harare. Matches cities and countries alike. Characters such as%and_are taken literally. limitinteger (≤200) default 50- How many destinations to return in one page.
cursorstring optional- The
nextCursorfrom the previous page, unchanged. An invalid cursor is a400.
Response
destinationsobject[] optional- The page of destinations, in the order described below.
nextCursorstring optional- Pass back as
cursorfor the next page. Absent on the last page.
The Destination Object
type"country" | "city" optional- What kind of place this is.
labelstring optional- Ready to show in a list:
Harare, Zimbabwe, orSpringfield, IL, United Stateswhere a region tells same-named cities apart. citystring | null optional- The city’s name.
nullon a country. regionstring | null optional- A state or province that tells apart cities with the same name —
IL,South Australia.nullwhen there is none. countrystring optional- The ISO-3166 alpha-2 code. This is what to send as
destination.countryin a search. countryNamestring optional- The country’s English name.
A country is the same object with the city and region empty:
Order is stable between requests: by country name, a country before its cities, then city name, then region. That is what makes the cursor reliable — a page boundary does not move between two calls.
Using One in a Search
Send the destination's city and country as destination on POST /search, or just the country to search
a whole country. You do not send the region: a city name that exists in several
places, like Springfield, is searched in all of them.
Search as You Type
- Wait a moment before asking. Debounce by 200–300 ms so a guest typing “harare” is one request, not six.
- The country list is stable. About two hundred countries change rarely. Fetch
?type=country&limit=200once per session, or once a day, and cache it. - Narrow once a country is chosen.
?type=city&country=ZWis a short list that can be shown whole. - Use
labelfor display. It already carries the region and country where they are needed to tell two places apart.
Status Codes
- 200
- The page — possibly empty, which is not an error.
- 400
validation_error - A bad query parameter: a
limitabove 200, an unknowntype, or acursorthat is not one this API issued. - 401
unauthorized - Missing or invalid
x-api-key. - 429
rate_limited - Too many requests. Back off for
details.retryAfterSeconds. - 503
mode_unavailable - This deployment has no configuration for the environment your key points at.