v1

latestOpenAPI 3.0.32026-07-1761214.3 KB
Geocoding

Batch reverse geocoding (cached, grid-snapped)

Reverse-geocode many coordinates in one round trip.

  • Coords are snapped to a ~11 m grid (4 decimal places) when computing the cache key, so repeated lookups of points within ~11 m of each other share a result.
  • Solid Cache (Rails 8 default) memoizes results for 30 days — dawarich-style trip replays after the first run hit cache nearly 100%.
  • Hard cap: 500 coords per request. For larger inputs, page client-side.
  • Each result preserves the caller's optional id so clients can correlate.
post/api/v1/reverse/batch

Request body

langstring nullable

Example request

{
  "coords": [
    {
      "id": "p_42",
      "lat": 52.5163,
      "lon": 13.3777
    }
  ],
  "lang": "de"
}

Response

batch results

Example response

{
  "data": [
    {
      "coord": {
        "lat": 52.52,
        "lon": 13.405
      },
      "here": {
        "id": "node:240109189",
        "name": "Berlin",
        "label": "Berlin, Germany",
        "type": "city",
        "coords": {
          "lat": 52.52,
          "lon": 13.405
        },
        "admin": {
          "country": "Germany",
          "state": "Berlin",
          "city": "Berlin"
        }
      },
      "admin": {
        "country": "Germany",
        "state": "Berlin",
        "city": "Berlin"
      }
    }
  ],
  "meta": {
    "upstream": "ok",
    "count": 5,
    "cache_hits": 184,
    "cache_misses": 16,
    "grid_precision": 4,
    "max_coords": 500
  }
}