Skip to content
Introduction

Documentation

Introduction

Ubhub Location Service offers three HTTP APIs for location-aware applications in Mongolia: geocoding, reverse geocoding and routing.

What you can build

Available APIs
APIEndpointUse it to
GeocodingGET /v1/geocodeTurn place names and addresses into coordinates, for search boxes and autocomplete.
RoutingGET /v1/routeGet the fastest driving or walking route, its distance, travel time and a GeoJSON line.

The interactive map on the home page 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:

Base URL
https://developers.ubhub.mn/v1

Every request needs an API key in the Authorization header. See Authentication.

Conventions

  • All endpoints use GET with query parameters and return JSON (UTF-8).
  • Coordinates are WGS84 decimal degrees. Separate parameters are named lat and lon; combined values such as origin use 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

  • Getting started: create a key and make your first request in five minutes.
  • API reference: every parameter and field, with a playground to try requests from the browser.
  • Code examples: cURL, JavaScript, TypeScript, Python and Dart snippets.