Places
Four queries find things on the map. geocode turns text into places, reverseGeocode names a point, and pois lists points of interest. search looks across all of them, trails, and your own itineraries at once.
Every sample on this page reuses this setup. It mints a session token with your secret key, so run it on your server.
A session token lasts five minutes, so mint a new one when it expires.
Turn text into named places. focus ranks places near Chamonix first.
Places come back by relevance. Pass layers to keep only some kinds of place, such as CITY or NATURAL.
Layers are ordered from the coarsest scope (COUNTRY) to the finest (HOUSE, NATURAL). Pass a subset to a geocode query to restrict the result granularity.
Name the places at a coordinate. This one asks which village sits at the Argentière point.
Places come back nearest first. Without layers, the nearest match is often a street or a building.
List points of interest by category inside an area. This finds huts in the Chamonix valley.
To list what lies along a route instead, send the route's line as buffered.geometry with a bufferMeters distance. Each point then carries its distanceMeters from the line.
Run one query across several sources at once. This looks for the Tour du Mont-Blanc among places and among your own itineraries.
Turn on only the targets you need: places, pois, ways, itineraries, collections, or zones. Each hit is a reference, so read an itinerary in full with itinerary.
If one target fails, its section is null and errors says why, while the others still answer.