Addresses

Calculate the distance between two locations

Each point is given as either {id} (an access address UUID) or {lat, lon}.

POST/v1/adgangsadresser/distance

Authentication

Authorizationstringheaderrequired

Your API key as a Bearer token.

Body

application/json
toobjectrequired

One of these shapes:

Shape 1
to.idstring<uuid>required
Shape 2
to.latnumberrequired
to.lonnumberrequired
fromobjectrequired

One of these shapes:

Shape 1
from.idstring<uuid>required
Shape 2
from.latnumberrequired
from.lonnumberrequired

Request

curl --request POST \
  --url "https://api.danskadresseapi.dk/v1/adgangsadresser/distance" \
  --header "Authorization: Bearer $API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
  "to": {
    "id": "3c9f6a4e-2b1d-4c8e-9f7a-1d2e3f4a5b6c"
  },
  "from": {
    "id": "3c9f6a4e-2b1d-4c8e-9f7a-1d2e3f4a5b6c"
  }
}'
Try it
POST https://api.danskadresseapi.dk/v1/adgangsadresser/distance

Response

application/json

Distance

toobject
fromobject
distance_minteger
distance_kmnumber
200Eksempel
{
  "to": {},
  "from": {},
  "distance_m": 0,
  "distance_km": 0
}
401Missing key
{
  "error": {
    "code": "unauthorized",
    "message": "Missing or invalid API key."
  }
}