All examplesGeocoding
Autocomplete as you type
Autocomplete is the type-ahead endpoint. Fire it on each keystroke. It matches genuine partial prefixes: Calgar finds Calgary, rue sainte-cath finds rue Sainte-Catherine.
live result
the code that produced it
import { Unmap } from "@unmap/sdk";
const unmap = new Unmap({ key: "um_live_..." });
const results = await unmap.geocoder.autocomplete("rue sainte-cath", { limit: 5, lang: "fr" });Send the whole input box, not the last word. Every word but the last must match a token in full and the last is treated as the prefix still being typed. Input of three characters or fewer answers with localities, provinces, and points of interest only; addresses and streets come back at the fourth character.
Autocomplete ranks more crudely than search: no exact-name bonus, no typo tolerance. Use search when you want the best single answer and autocomplete when you want fast suggestions. Autocomplete takes no bbox.
The Geocoding API covers the ranking difference in full.