Documentation
Introduction
Ubhub Location Service offers HTTP APIs for location-aware applications in Mongolia: geocoding, reverse geocoding, routing and vector basemaps.
What you can build
Available APIs
GET /v1/geocodeTurn place names and addresses into coordinates, for search boxes and autocomplete.
GET /v1/geocode?lat=…&lon=…Turn a coordinate into the nearest address, place or street. Same endpoint as geocoding, with lat and lon instead of q.
GET /v1/routeGet the fastest driving or walking route, its distance, travel time and a GeoJSON line.
GET /v1/basemap/style.jsonDisplay Mongolia with a vector basemap (Default or Nova style), including streets and labels.
The interactive map is built on exactly these endpoints, so what you see there is what your application gets.
Base URL
All endpoints live under a versioned path on one host:
https://developers.ubhub.mn/v1Every request needs an API key in the Authorization header. See Authentication.
Conventions
- All endpoints use
GETwith query parameters and return JSON (UTF-8). - Coordinates are WGS84 decimal degrees. Separate parameters are named
latandlon; combined values such asoriginuse GeoJSON order:longitude,latitude. - Distances are in meters and durations in seconds.
- Geometries are GeoJSON, so they can be added to MapLibre, Mapbox GL, Leaflet or OpenLayers directly.
- Errors always use the same envelope:
{"error": {"code", "message", "details"}}. See Errors. - Every response carries rate-limit headers and an
X-Request-ID. See Rate limits.
Data sources
Results come from the platform's own geospatial data sources. Which places, addresses and roads are available depends on the data configured for this deployment, so coverage can differ between areas. The API contract (paths, parameters and response fields) stays the same whatever the underlying data source is.
Version stability
/v1 never receives breaking changes. New optional response fields may be added, so parse responses leniently. Read Versioning for the full policy.Next steps
- React & Next.js SDK: maps, place search and typed API calls, with a server route that keeps your key secret.
- Flutter SDK: one package for maps, search widgets, and typed API calls.
- Getting started: create a key and make your first request in five minutes.
- Geocoding and Routing: every parameter and field, with a playground to try requests from the browser.
- Code examples: cURL, JavaScript, TypeScript, Python and Dart snippets.