Skip to content

Getting started

The AvtoPodatki API is at https://api.avtopodatki.si. Every call needs your company’s API key, and returns JSON.

Prefix What it is
/v1/market Used cars: listings, sellers and price statistics
/v1/catalog New vehicles: list prices and specifications
/v1/integrations Integrations prepared for your company, such as your stock on your website
/v1/auth Your key’s permissions and limits (/me)
  1. Create an API key on the API keys page of the AvtoPodatki app. Your company’s owners and developers can create keys. Give the key only the permissions it needs, and limit it to your server’s IP addresses if you can. The key is shown once: store it safely.

  2. Send it on every request as a bearer token:

    Authorization: Bearer ap_…
  3. Ask who you are. GET /v1/auth/me lists the key’s permissions, your company’s monthly limits and this month’s use.

    Terminal window
    curl https://api.avtopodatki.si/v1/auth/me \
    -H "Authorization: Bearer $AVTOPODATKI_KEY"

If the API keys page says API access is not included, your company’s plan does not include it yet: write to info@avtopodatki.si.

Your company is granted permissions, such as market.read or catalog.export, and each key holds some of them. Every endpoint in the API reference says which permission it needs. Calling one the key doesn’t have answers 403 with the missing permission in detail.required_permission.

The reference on this site shows the public APIs. To see every endpoint your key can call, sign in with your key.

  • Rate limit: each key may make a limited number of calls a minute (120 today). Over it, calls answer 429 rate_limited with a Retry-After header: wait that many seconds.
  • Credits: calls to endpoints that need a permission spend credits from your company’s monthly allowance. Exports also count towards a monthly number of exports, and cost nothing if they fail. A response that spent credits carries X-Credits-Limit, X-Credits-Remaining and X-Credits-Reset. When a monthly limit is used up, calls answer 429 quota_exceeded, with detail.meter naming the limit (credits, exports), until the 1st of next month (UTC).

A refused call costs nothing.

Every error has the same shape:

{
"error": {
"code": "forbidden",
"message": "Readable text you can show.",
"detail": { "required_permission": "market.read" }
}
}

code is stable and meant for your code; message is for people.

Status code What happened
401 unauthorized No key, or not a valid one (revoked, expired)
403 forbidden The key lacks the permission in detail.required_permission
403 ip_not_allowed The call came from an address the key does not allow
403 api_not_included Your company’s plan does not include API access
403 access_expired Your company’s access has ended
404 not_found Nothing at that id, or not yours to see
409 conflict The request conflicts with the current state
422 validation_error A parameter is missing or not valid; detail says which
429 rate_limited Too many calls; wait Retry-After seconds
429 quota_exceeded A monthly limit is used up
503 upstream_unavailable A service behind the API is unavailable; try again later