Geocoding API
Forward + Reverse
Batch Lookups
Confidence Scores

Addresses to coordinates. And back.

Forward and reverse geocoding backed by OpenStreetMap Nominatim, with normalized results, confidence scores, batch lookups, and a 24-hour cache.

2 · lookup directions25 · queries per batch24h · response cache10 · max results per lookup

Geocode something.

This calls the live Geocoding API. Turn a place name into coordinates, or pick coordinates and get the structured address back.

Request builder
Two directions, one normalized shape.
GET /geocoding/forward
Batch mode
POST /batch accepts up to 25 mixed forward and reverse queries and returns per-item status codes, ideal for enriching whole datasets in one call.
Output preview
Live response from the API, plus the exact request to reproduce it.
displayNamelatlonconfidence
Loading live response...

Why Geocoding API

Location resolution, normalized.

Forward and reverse

Free-form text to coordinates, or lat/lon to a structured address with road, city, state, postcode, and country fields.

Confidence scores

Every forward match carries a confidence object with a numeric score and a high/medium/low level derived from provider importance.

Batch lookups

POST /batch runs up to 25 mixed forward and reverse queries in order and returns a per-item statusCode with each payload.

Query shaping

Tune forward results with limit, language, countryCodes filters, and viewbox/bounded hints; control reverse detail with zoom.

24-hour cache

Responses are cached for a day with a 1 req/s upstream throttle, keeping repeat lookups fast and well within provider etiquette.

Provider-agnostic contract

Adapter-based provider selection (Nominatim today) behind one stable response shape, so integrations never chase upstream changes.

/api/v1/geocoding

Endpoints, at a glance.

Two GET lookups plus a POST batch endpoint, all returning the same normalized result shapes with meta timing.
GET/api/v1/geocoding/forward

Forward geocoding

Requires q. Resolves free-form place text to normalized matches with coordinates and confidence.

PRIMARY
GET/api/v1/geocoding/reverse

Reverse geocoding

Requires lat and lon. Returns a structured address for the coordinate pair.

POST/api/v1/geocoding/batch

Batch lookups

1 to 25 mixed forward and reverse queries executed in order, each with its own statusCode.

GET/health

Service health

Status, service name, version, active provider, and correlationId.

GET/metrics

Prometheus metrics

Request counts and latency histograms in Prometheus exposition format.

ParameterTypeRequiredDescription
qstringforwardFree-form location text, trimmed, 1 to 256 characters.
lat / lonnumberreverseCoordinates: lat -90..90, lon -180..180.
limitintegernoMax forward results, 1 to 10. Default 5.
languagestringnoPreferred response language, e.g. en or en-US.
countryCodesstringnoComma-separated ISO country filters for forward lookups, e.g. us,ca.
viewbox / boundedstring / booleannoBounding-box hint (left,top,right,bottom); bounded=true restricts results to the box.
zoomintegernoReverse detail level, 0 to 18.
addressdetailsbooleannoInclude normalized address components in reverse output. Default true.
queriesarraybatch1 to 25 batch items; each is forward ({q}) or reverse ({lat, lon}) with the same options.

Error reference

Deterministic error shapes.

Failures return success: false with an error message, a machine-readable reason where relevant, and a correlationId.

400Validation Error

Missing or invalid q, lat, or lon, or malformed batch queries. The details array lists each failing field.

401Authentication Error

Missing or invalid gateway API key. Send x-api-key or api_key with every request.

404Not Found

Unknown route. Valid paths are /forward, /reverse, and /batch under /api/v1/geocoding.

429Rate Limit

More than 120 requests in a 15-minute window. The response includes retryAfter seconds.

502Upstream Unavailable

The geocoding provider did not respond; reason is upstream-unavailable. Cached lookups keep working.

500Internal Error

Unexpected service failure. Include the correlationId when reporting the issue.

Example error response

{
  "success": false,
  "error": "Invalid query parameters",
  "details": [
    "\"lat\" must be less than or equal to 90"
  ],
  "correlationId": "abc-123"
}

FAQ

API questions developers ask first.

What is the difference between forward and reverse geocoding?

Forward geocoding (GET /forward?q=...) turns free-form text like a place name or street address into coordinates with normalized metadata. Reverse geocoding (GET /reverse?lat=...&lon=...) turns a coordinate pair into a structured address with road, city, state, postcode, and country fields.

How accurate are the results, and can I measure confidence?

Every forward match includes a confidence object with a numeric score and a high/medium/low level derived from the provider's importance ranking, so you can threshold matches or ask users to disambiguate.

Can I geocode many addresses at once?

Yes. POST /batch accepts 1 to 25 items, each either forward ({"q": ...}) or reverse ({"lat": ..., "lon": ...}), and returns results in order with a per-item statusCode.

Where does the data come from?

The current provider is OpenStreetMap Nominatim behind an adapter layer, with a 24-hour cache and a 1 req/s upstream throttle. The response contract is provider-agnostic, so future providers will not change your integration.

How do I authenticate requests?

Send your Datpaq API key as an x-api-key header or an api_key query parameter. Keys are created in the Datpaq dashboard and a free tier is included.

Put every address on the map.

Forward, reverse, and batch geocoding with confidence scores and a stable response contract. No provider accounts, no cache to build.