Places
Several queries find places and features. geocode turns free text into named places, reverseGeocode turns a coordinate into the nearest places, pois lists points of interest in an area, and search runs one full-text query across places, POIs, ways, and your own itineraries, collections, and zones.
All coordinates are [longitude, latitude] in WGS 84.
geocode
Forward-geocode a free-text query into a ranked list of named places such as cities, regions, natural features, and addresses.
Input
geocode(input: GeocodeInput!)
queryString!
Search text, 1 to 200 characters after trimming. For example Chamonix or Mont Blanc.
languageLanguage
Biases result names. Defaults to English.
limitInt
default: 10
Maximum number of places to return (1 to 50).
focus[Float!]
[longitude, latitude] center that biases ranking toward nearby results.
bbox[Float!]
[minLon, minLat, maxLon, maxLat] bounding box that restricts the search area.
layers[GeocodeLayer!]
Restrict results to specific layers. Every layer is eligible when omitted.
categoriesPlaceCategoriesInput
Boolean-per-category filter on the output (populatedPlace, naturalFeature, amenity, and so on). Every category is allowed when omitted.
The layers filter accepts these values:
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.
Example
Response
GeocodeResult carries count and a places list ordered by relevance. Each Place includes:
nameString!
Localized display name.
labelString!
Single-line label derived from city, region, and country.
layerGeocodeLayer!
Canonical layer for the place.
categoryPlaceCategory!
Canonical category, the dimension categories filters on.
point[Float!]!
Centroid as [longitude, latitude].
bounds[Float!]
Extent as [minLon, minLat, maxLon, maxLat], when known.
scoreFloat!
Relevance score. Higher is more relevant.
Place also exposes country, countryName, region, county, city, postcode, street, housenumber, and an osm reference to the source feature.
Run this query live: open it in the playground and try it against the schema.
reverseGeocode
Reverse-geocode a [longitude, latitude] point into the named places closest to it.
Input
reverseGeocode(input: ReverseGeocodeInput!)
point[Float!]!
Anchor point as [longitude, latitude].
languageLanguage
Biases result names. Defaults to English.
radiusMetersInt
default: 500
Maximum search radius around the anchor in meters (1 to 5000).
limitInt
default: 1
Maximum number of places to return (1 to 50).
layers[GeocodeLayer!]
Restrict results to specific layers.
Example
ReverseGeocodeResult echoes the point and returns a places list of the same Place shape as geocode, ordered by proximity then relevance.
pois
List points of interest matching one or more categories, inside either a bounding box or a buffered geometry. When a buffered area is used, each POI is annotated with its distance to the geometry.
Input
pois(input: POIsInput!)
categories[POICategory!]!
POI categories to include (1 to 10).
bbox[Float!]
[minLon, minLat, maxLon, maxLat] search box. Mutually exclusive with buffered.
bufferedBufferedAreaInput
A GeoJSON geometry plus a bufferMeters distance (1 to 5000) that expands it into a search area. Mutually exclusive with bbox.
languageLanguage
Biases result names. Defaults to English.
limitInt
default: 50
Maximum number of POIs to return (1 to 50).
The categories filter accepts these values:
Example
Response
POIsResult carries count and a pois list. Each POI includes name, category, point, optional elevation (meters above sea level), selected OSM tags, and, when a buffered area was used, distanceMeters from the geometry. Admin context (country, region, city) is included when resolved.
search
Run one full-text query across several targets at once. Each target is opt-in, runs concurrently, and degrades gracefully: a target that fails leaves its section null and reports an entry in errors, while the others still return. Owned-entity targets (itineraries, collections, zones) return only entities the calling credential may view.
Input
search(input: SearchInput!)
queryString!
Search text, 1 to 200 characters after trimming.
targetsSearchTargetsInput!
Per-target enable flags. Every flag defaults to false, so set at least one of places, pois, ways, itineraries, collections, or zones to true.
languageLanguage
Biases result names. Defaults to English.
limitInt
default: 8
Per-target maximum number of results (1 to 50).
focus[Float!]
[longitude, latitude] center that biases the places, pois, and ways targets.
bbox[Float!]
Bounding box that restricts the places, pois, and ways targets.
activityActivitySlug
Filters and ranks the ways target. Ignored unless targets.ways is true.
search also accepts a pois category list and a categories filter that apply to those targets, mirroring the pois and geocode inputs.
Example
Response
SearchResult echoes the query and targets, then carries one section per enabled target (places, pois, ways, itineraries, collections, zones). A section is null when its target was disabled or its branch failed. The errors list holds one SearchTargetError (target, code, message) per failed branch, and is empty when every enabled branch succeeded.