Attribution
Attribution is a licence condition, not a courtesy. Lantmäteriet's open data requires credit under CC BY 4.0, OpenStreetMap requires it under ODbL, and the requirement travels with the data to you. Use our API and you inherit it.
So we make it as hard as possible to lose:
- Every JSON response carries an
attributionfield — a list of ready-made lines. - Every response, including images and tiles, carries the
X-Attributionheader. - Every rendered image has the credit burned into the pixels. It cannot be cropped away.
Read the header
X-Attribution is percent-encoded. HTTP field values are ASCII in practice: a raw © or ä in a header is something an intermediary may drop, and an HTTP/2 chain did exactly that to us in August 2026 — the header vanished with no error. Decode before displaying:
decodeURIComponent(res.headers.get('X-Attribution'))urllib.parse.unquote(r.headers['X-Attribution'])Ready-made snippets
Below a map:
<div class="credit">
©Lantmäteriet · Ortnamn · CC BY 4.0 ·
© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors · ODbL 1.0
</div>In MapLibre it is handled for you — the style carries the attribution, so leave the control in place:
new maplibregl.Map({ style: 'https://api.kart-api.se/v1/styles/ljus.json',
attributionControl: { compact: true } })Who to credit for what
| Endpoint | Line |
|---|---|
/v1/geocode, /v1/ortnamn | ©Lantmäteriet · Ortnamn · CC BY 4.0 · Bearbetad (+ OpenStreetMap for street-level hits) |
/v1/kommun/* | ©Lantmäteriet · Administrativ indelning · CC BY 4.0 |
/v1/hojd, terrain archives | ©Lantmäteriet · Markhöjdmodell · CC BY 4.0 |
/v1/marktacke, /v1/hydrografi | ©Lantmäteriet · Marktäcke / Hydrografi · CC BY 4.0 · Bearbetad |
Basemap, /v1/render/karta, routing | © OpenMapTiles © OpenStreetMap contributors · ODbL 1.0 |
/v1/trafik/* | Trafiklab GTFS Regional Realtime (CC0) · © Samtrafiken |
/v1/befolkningsrutor | Statistics Sweden (SCB) |
/v1/avverkning | Skogsstyrelsen · Avverkningsanmälan |
/v1/skyddsrum | Myndigheten för civilt försvar · shelter register |
/v1/valresultat | Valresultat © Valmyndigheten (open data) |
The list in the response wins over the list here: it comes from the same table as the header, and this page is a copy that can go stale.
What you may not do
Build a copy of the data and redistribute it as a data product of your own. Rendering, displaying, looking up and building services on top: yes. The database itself: no. See terms.