Skip to content
All examplesGeocoding

Search for a place

Forward geocoding turns text into a coordinate. search ranks by relevance over Canadian addresses and places, so "Calgary Tower" finds the tower and not every row that mentions Calgary.

live result
the code that produced it
import { Unmap } from "@unmap/sdk";

const unmap = new Unmap({ key: "um_live_..." });

const results = await unmap.geocoder.search("Calgary Tower", { limit: 3 });

Every call resolves to an array, even for zero or one match. Each result carries id, name, layer, lng, lat, a names map when the place has names in more than one language, and a structured address when one exists. Search results add a score.

To keep results inside a box, pass bbox as [minLng, minLat, maxLng, maxLat]. It is a hard filter, not a bias: a row whose point falls outside the box is dropped.

const results = await unmap.geocoder.search("Tower", {
  bbox: [-114.12, 51.02, -114.02, 51.07],
  limit: 5,
});

The Geocoding API documents every parameter and the result shape. @unmap/geocoding is the same client with no map dependency.