Plexe/Autosuggest
autosuggest · live in the API

The right place,
from half a word.autosuggest

One call turns what a traveller has typed into ranked cities, areas, landmarks, airports and hotels in 224 countries, each with the area to search and the hotels in it.

Try it

Type like a traveller

Half a word, a typo, an airport code or another script. Each keystroke goes through the live index, the same as an API call.

Try

Suggestions appear here as you type.

What it handles

Built for a hotel search box

People type half a word, misspell it, or mean an area rather than a city. A general places API returns addresses; this returns places you can search hotels in.

01 · Input

Partial and misspelled

Prefixes match from the first letter, typos from four characters, and any script works.

barcelna → Barcelona · 東京 → Tokyo

02 · Places

Every kind of place

Cities, neighbourhoods, landmarks, airports by name or code, islands, regions and metro areas, each with its hotel count.

dxb → Dubai International

03 · Hotels

Hotels and brands

Hotels appear from three characters. A brand lists its hotels; a famous hotel comes before the place it is named after.

burj al arab → the hotel

04 · Area

The area to search

Every place has a search area: a circle for a city, a polygon or multipolygon for islands and island nations.

maldives → its islands, not a circle

05 · Lists

Hotel lists per place

Pick a place and page through the hotels it counts, most popular first, 250 at a time, ready for an availability call.

GET /api/regions/{id}/hotels

06 · Language

Names in the traveller's language

Ask for a language and place names and breadcrumbs come back in it. Matching works in every language either way.

language=de → Mailand, Lombardei, Italien

API

One call per keystroke

GET /api/suggest
curl "https://suggest.plexe.ai/api/suggest?q=ao%20na&limit=3" \
  -H "X-API-Key: $PLEXE_SUGGEST_KEY"
200 OK · results[]
"results": [
  { "id": "gn:1158377", "type": "city",
    "name": "Ao Nang",
    "label": "Ao Nang, Krabi, Thailand",
    "lat": 8.0458, "lon": 98.81035,
    "hotel_count": 589,
    "search_type": "Polygon" },
  // then Ao Nang Beach, Ao Nang Pier …
]

Abridged; each suggestion also carries its country, highlight spans and, for hotels, the hotel and place ids. Read the guide.

Questions

What to expect

How do I get a key?

For a search box that calls from the browser, create a website key in the autosuggest console; it is locked to your sites.

Is it fast enough for every keystroke?

Median server time is under 50 ms. Debounce input by 100 to 150 ms and request up to 8 results.

Is there a ready-made search box?

Yes: a web component with no dependencies and a React wrapper, @plexe/autosuggest.

How is this different from a general places API?

It knows which hotels sit in each place, ranks places by the hotels people book there, and returns the area to search a supplier with.

Can results show only the hotels we sell?

Yes. We map your hotel list to ours; your keys can then return only your hotels, with place counts that match.

Where does the data come from?

Places from GeoNames (CC BY 4.0), OurAirports and Wikidata; island outlines © OpenStreetMap contributors (ODbL); hotels from supplier catalogues.