The response envelope
Every endpoint except Map Styles returns the same wrapper. The payload you want is always underdata.
string
Server time when the response was generated, in Nepal Time.
integer
The HTTP status, echoed into the body. It matches the real HTTP status code — check the
transport-level status, not this field, when handling errors.
string
Success on a 2xx, or a human-readable explanation otherwise.array
The results. Always an array, even for endpoints that return a single logical result —
Places and Reverse Search both return a
one-element array, so read
data[0].Coordinate order
Kathmandu is at latitude27.7172, longitude 85.3240. The same point, three ways:
centroid.lat, centroid.lon), so the risk is in the
handoff to your map library:
geometry field on a
Place, which is GeoJSON and therefore already [lon, lat].
Identifying a place
The two-step search flow exists because search responses are optimised for autocomplete UIs — they omit geometry to stay small and fast:1
Search returns lightweight suggestions
GET /search?q=patan → name, address, type, placeId. No coordinates.2
Places resolves one suggestion in full
GET /places?placeId=344470 → centroid, geometry and OpenStreetMap tags.Encoded polylines
Directions returns route geometry asencodedPolyline — a compact
string in Google’s encoded polyline format,
rather than a large GeoJSON LineString. Decode it before handing it to a renderer.
distanceInMeters, timeInMs (milliseconds,
not seconds) and — when you request instructions=true — an instructionList. Without that
parameter, instructionList is null rather than an empty array.
Place types
Thetype field is drawn from
OpenStreetMap map features. Baato also
defines a few merged types that combine related features, so type=eat returns cafes,
restaurants and bakeries together. The full list is on the
Nearby Places page.
Relevance scores
Search and Places results carry ascore. Higher is more relevant, but the scale is not
normalised — compare scores within a single response, never across responses.
Endpoints that do not compute a score return the string
"NaN" rather than a number
or null. Guard against it before doing arithmetic:Versioning
All endpoints live underhttps://api.baato.io/api/v1. See
API versioning for how new versions are introduced.