Till innehållet
kart-api.se

Isochrones (travel time) in Sweden

curl -G 'https://api.kart-api.se/v1/route/isochrone' --data-urlencode 'json={
  "locations":[{"lat":58.7052,"lon":15.7803}],
  "costing":"pedestrian",
  "contours":[{"time":10},{"time":20}],
  "polygons":true
}'

The response is GeoJSON polygons you can drop straight into MapLibre. costing can be auto, bicycle, pedestrian or bus; contours takes travel time in minutes (or distance in kilometres).

Directions instead

curl -G 'https://api.kart-api.se/v1/route/route' --data-urlencode 'json={
  "locations":[{"lat":58.705,"lon":15.78},{"lat":58.54,"lon":15.04}],
  "costing":"auto"
}'

Worth knowing

The engine is Valhalla over the Swedish OpenStreetMap road network. Travel times are modelled, not measured: they ignore current traffic, road conditions and roadworks. For a walking isochrone in a town they hold up well; for driving at rush hour they are optimistic.

Routing is heavier than a lookup, so at most four concurrent external calls — beyond that 429 with Retry-After.