Quickstart
Measure your first property with the Duranta API in three steps.
Before you start
You need a Duranta workspace with API access. If you don't see Settings → API, ask your Duranta account manager.
Create an API key
Open Settings → API in the Duranta app and create a key. Copy the client ID, the client secret, and the workspace ID shown on the same page. The secret is shown only once.
To try a call before writing any code, press Try it in the playground in that dialog, or Try in Playground on any page of the API reference. Both take the key and get the access token for you.
Get an access token
Exchange the key for a token with the OAuth 2.0 client credentials grant. Reuse it until expires_in runs out. The dialog that shows your secret has this command ready to copy.
TOKEN=$(curl -s https://logto.app.getduranta.com/oidc/token \
-u "$CLIENT_ID:$CLIENT_SECRET" \
-d grant_type=client_credentials \
-d resource=https://public.api.getduranta.com \
-d organization_id=$WORKSPACE_ID \
-d scope=sites:scan | jq -r .access_token)Measure a property
Call Create a site with one address and a result tier. Then poll Get a site until status is no longer SITE_STATUS_ACCEPTED.
A completed measurement is charged to your workspace's credits, see Billing; the sandbox is free. New workspaces start with RESULT_TIER_IMAGE. Duranta enables higher tiers per workspace; requesting one that isn't enabled fails with permission_denied (see Errors).
curl -X POST https://app.getduranta.com/duranta.api.public.v1.SiteService/CreateSite \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"externalId": "PROP-000001",
"tier": "RESULT_TIER_IMAGE",
"address": {
"line1": "2910 Mall Dr",
"city": "Eau Claire",
"region": "WI",
"postalCode": "54701",
"country": "US"
}
}'
# Repeat every few seconds until "status" is no longer SITE_STATUS_ACCEPTED.
curl https://app.getduranta.com/duranta.api.public.v1.SiteService/GetSite \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"externalId": "PROP-000001"}'Rarely, the address lookup services place an address on different parcels and none of them wins. The site then ends with SITE_STATUS_ISSUE and PARCEL_AMBIGUOUS, nothing is measured and nothing is charged. Choosing the parcel shows how to list the candidate parcels and measure the right one under the same externalId.