APIs

← Back

TerrainX uses two external APIs. Both are free with no authentication required.


OpenFreeMap

Purpose: Serves the actual map tile data (roads, buildings, water, etc.)

Request 1 — TileJSON manifest

Called once on map load to get the tile URL template and metadata.

GET https://tiles.openfreemap.org/planet

Response:

{
  "tilejson": "3.0.0",
  "tiles": ["https://tiles.openfreemap.org/planet/{z}/{x}/{y}"],
  "minzoom": 0,
  "maxzoom": 14,
  "bounds": [-180, -85.05, 180, 85.05],
  "attribution": "© OpenMapTiles © OpenStreetMap"
}

Request 2 — Vector tiles

Called many times as the user pans and zooms.

GET https://tiles.openfreemap.org/planet/{z}/{x}/{y}
ParamDescription
zZoom level (0–14)
xTile column
yTile row

Response: Binary .pbf (Protocol Buffer) — decoded by MapLibre internally.

AuthNone
Rate limitGenerous — fine for dev/test
Attribution requiredYes — © OpenMapTiles © OpenStreetMap

Nominatim

Purpose: Geocoding — converts a search string into coordinates. Used only by [[components/SearchBox|<SearchBox />]].

GET https://nominatim.openstreetmap.org/search

Query params:

ParamValueDescription
q"New Delhi"Search string
format"json"Response format
limit5Max number of results

Example:

GET https://nominatim.openstreetmap.org/search?q=New+Delhi&format=json&limit=5

Response:

[
  {
    "display_name": "New Delhi, Delhi, India",
    "lat": "28.6139391",
    "lon": "77.2090212"
  }
]
AuthNone
Rate limit1 request/second
Required headerUser-Agent: TerrainX/1.0
Production useNot recommended — dev/test only

Summary

APICalled byAuthRate limit
OpenFreeMap tiles<Map /> (via MapLibre)NoneGenerous
Nominatim search<SearchBox />None1 req/sec