How do I geocode a Swedish address for free?
curl 'https://api.kart-api.se/v1/geocode?q=Storgatan%201,%20Motala'No account, no key for the first 200 calls a day. The response:
{
"query": "Storgatan 1, Motala",
"antal": 4,
"spridning": { "traffar": 0, "kommuner": 0, "entydig": null,
"skal": "the query matches no place name — spread is UNMEASURED" },
"results": [
{ "lat": 58.5433, "lon": 15.0251, "namn": "Storgatan, Motala, …",
"tier": "address", "kalla": "osm" }
],
"attribution": ["© OpenStreetMap contributors · ODbL 1.0"]
}Read this first
tier is the precision: address is street level, place is a locality centroid, kommun is the whole municipality. A place hit is not a bad address — it is a different kind of answer, and should not be drawn as a pin on a property.
spridning is how many municipalities the name occurs in, counted before the limit. entydig: null means the query could not be measured as a place name. Never treat null as true.
Restrict to one municipality
curl 'https://api.kart-api.se/v1/geocode?q=Bergsv%C3%A4gen%201&kommunkod=0562'The filter measures where the hit is (point in municipal polygon), not what the name contains. If the list comes back empty you get a kommunfilter field with the reason — "no hit in this municipality" and "the place does not exist" are different things.
Where the data comes from
Place names and municipality names from Lantmäteriet (CC BY 4.0), street addresses from OpenStreetMap (ODbL). The official Swedish address register sits behind a permit that binds us to editorial use, so it is not included here — we would rather say so than let you wonder why a newly built street is missing.