Geocoding API

Turn a place name or address into coordinates, or coordinates into the nearest places. Built on OpenStreetMap and compatible with Photon and Nominatim, so existing clients work by changing their base URL.

ForwardReverseSearch as you typeGeoJSONNominatim compatible

Try it live

Type a place or address and pick a result from the dropdown. As you type, it runs a real GET /geocode/api call with a shared demo key (limited per day). Get your own key to go further.

How to use

1. Create a free API key. 2. Send it as Authorization: Bearer YOUR_KEY, or as ?key=YOUR_KEY. 3. Call one of the two endpoints.

Search: GET /geocode/api

curl JavaScript
curl "https://api.maplark.com/geocode/api?q=Gamla+Stan+Stockholm&limit=3" \
  -H "Authorization: Bearer YOUR_KEY"

Reverse: GET /geocode/reverse

curl
curl "https://api.maplark.com/geocode/reverse?lat=59.325&lon=18.071&limit=1" \
  -H "Authorization: Bearer YOUR_KEY"

Response

A GeoJSON FeatureCollection, ranked best match first. Coordinates are [lon, lat].

json
{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": { "type": "Point", "coordinates": [18.0711, 59.3252] },
      "properties": {
        "osm_type": "R",
        "osm_id": 1234567,
        "name": "Gamla stan",
        "city": "Stockholm",
        "country": "Sweden",
        "extent": [18.063, 59.328, 18.080, 59.322]
      }
    }
  ]
}

Nominatim clients: /geocode/nominatim/

Already using Nominatim? Point your client at https://api.maplark.com/geocode/nominatim/ and add your key. /search, /reverse and /status take Nominatim's parameters and return xml, json, jsonv2, geojson or geocodejson. Requests count against the same monthly geocoding allowance.

curl geopy
curl "https://api.maplark.com/geocode/nominatim/search?q=Gamla+Stan+Stockholm&format=jsonv2&key=YOUR_KEY"
curl "https://api.maplark.com/geocode/nominatim/reverse?lat=59.325&lon=18.071&format=json&key=YOUR_KEY"

Parameters

ParamUsed byWhat it does
qsearchPlace name or address. Required. Tolerates typos and partial input.
lat, lonbothSearch: bias results toward this point. Reverse: the point to look up (required).
limitbothMax results, up to 50.
bboxsearchOnly results inside min_lon,min_lat,max_lon,max_lat.
radiusreverseSearch radius in km, up to 5000.
langbothResult language: default, en, de, fr, or it.
osm_tagbothFilter by OSM tag, e.g. osm_tag=amenity:cafe. Repeat to combine.
layerbothRestrict to city, street, house, and similar layers.
  • Get the shape. Each feature has osm_type (N, W, R) and osm_id. Pass them to the OSM Features API (within=relation/<id> or osm_ids) for the full polygon.
  • Cost. No credits. Each plan includes monthly geocoding requests. See pricing.

Start geocoding

The free tier is enough to build with.