Concepts
Limits and quotas
Your firm has two limits for each dataset. Your agreement gives the numbers.
| Limit | Counts | Starts again |
|---|---|---|
| Requests per minute | Each request that has a valid token, an allowed address and the dataset | At the start of each clock minute |
| Keys per day | Each look-up key, for example one CVR number | At midnight, Danish time |
The two limits count for your firm, not for one token. Two tokens of your firm use the same counters.
At a limit
A request above a limit gets the status 429 and the code rate_limited. The header
Retry-After gives the wait in seconds.
HTTP/1.1 429 Too Many Requests
Retry-After: 23
Content-Type: application/json
{"error": {"code": "rate_limited", "message": "The request limit is reached. Try again after the time in Retry-After.", "request_id": "0f6d1c0a4b5e4c7f9a3e2d1c0b9a8f7e", "limit": "requests_per_minute"}}
| Code | Cause | What to do |
|---|---|---|
rate_limited |
Your firm is at one of its two limits, or has a PDF download in work | Wait for the time in Retry-After, then send the request again |
source_rate_limited |
The source register is at its call limit. This is not a limit of your firm | Wait for the time in Retry-After, then send the request again |
The field limit of a rate_limited error names the limit:
limit |
Cause | Retry-After |
|---|---|---|
requests_per_minute |
The requests of the minute are used | The end of the minute |
keys_per_day |
The keys do not fit in the rest of the keys of the day | Midnight, Danish time. A request with fewer keys can fit before that time |
parallel_downloads |
Your firm has a PDF download in work | Some seconds |
limit can get a new value in /v1. For a value that your program does not know, wait for the
time in Retry-After.
Rules for your program:
- Read
Retry-Afterand wait. Do not send the request again immediately. - Do not send requests in parallel without a limit. Use a small, fixed number of connections.
- Use the look-up route for many keys. One call with 500 CVR numbers is one request.
- Ask for the status of a job at the interval that the page Jobs gives.
How keys are counted
| Rule | Detail |
|---|---|
| A key is counted before the look-up | A key counts also when the register does not have it |
| A request that is not valid counts no keys | For example 422 invalid_cvr |
| A request that does not fit in the rest of the quota counts no keys | It gets 429 rate_limited. Send a request with fewer keys, or wait for the next day |
| The same key two times in one request counts one time | The service removes the second one |
| The same key in two requests counts two times | The service keeps no result between requests |
| A failure of the source counts | A request that gets 502 source_unavailable after the count keeps its keys |
Limits of each route
These limits are the same for all clients. They do not change in /v1 to a smaller number.
| Dataset | Route | Limit | Keys for one call |
|---|---|---|---|
| CVR companies | GET /v1/cvr/companies/{cvr} |
1 CVR number | 1 |
| CVR companies | POST /v1/cvr/companies/lookup |
500 CVR numbers for each call. More gives 422 too_many_cvrs |
The number of different CVR numbers |
| CVR companies | GET /v1/cvr/companies/search |
50 results for each call (limit). Default: 15 |
1 |
| Tinglysning | POST /v1/tinglysning/lookups |
500 CVR numbers for each job. More gives 422 too_many_cvrs |
The number of different CVR numbers |
| Tinglysning | GET /v1/tinglysning/companies/{cvr} |
1 CVR number | 1. The same request again counts 0 while its job is not complete |
| Tinglysning | GET /v1/tinglysning/documents/{uuid}/pdf |
1 document. 1 download at a time for your firm. A second one gets 429 rate_limited |
1. A download that is refused counts 0 |
| Tinglysning | POST /v1/tinglysning/vehicles/lookup |
1 vehicle number | 1. With a registration number: also 1 in Vehicles (DMR). The same request again counts 0 while its job is not complete |
| Vehicles (DMR) | POST /v1/dmr/vehicles/lookup |
1 vehicle number. The answer has a maximum of 10 vehicles | 1 |
| Jobs | GET /v1/jobs/{id}, GET /v1/jobs/{id}/results/{key}, GET /v1/jobs/{id}/items/{item_id}, GET /v1/jobs/{id}/items/{item_id}/partial |
1 job, 1 key | 0 |
| Jobs | GET /v1/jobs/{id}/results |
50 keys for each page (limit). Default: 20 |
0 |
A look-up that uses two datasets
POST /v1/tinglysning/vehicles/lookup with a registration number reads two datasets:
Vehicles (DMR) for the vehicle, then Tinglysning for the Bilbog.
| Subject | Rule |
|---|---|
| Datasets | Your firm needs tinglysning and dmr. Without one of them: 403 dataset_not_enabled, and the message names it |
| Requests per minute | The request counts as 1 request in each of the two datasets |
| Keys per day | The look-up counts as 1 key in each of the two datasets |
| At a limit of one of the two | 429 rate_limited. The look-up is not made, and no key is counted in either dataset |
| With a chassis number | Only tinglysning: 1 request and 1 key. The look-up does not read Vehicles (DMR) |
| The result of the job | A request for the status or the result of the job counts as a request in tinglysning only |
Jobs and the limits
| Rule | Detail |
|---|---|
| The keys of a job count when you create the job | A job that does not fit in the rest of your keys of the day gets 429 rate_limited and is not created |
| The routes of a job count as requests | A status request and a result request count against your requests per minute, for the dataset of the job. To get many results, use the pages of GET /v1/jobs/{id}/results: one page is one request |
| A used quota does not stop a job | The service completes a job that it accepted, and you can read its status and its results |
| The source has one limit for all clients | 1 call each second for the dataset Tinglysning. This limit gives the time of a job, not an error. See Jobs |
Records of calls
The service can keep a record of each call with a valid token, for evidence and for support. A record never answers a request.
| Environment | Record |
|---|---|
| Test environment | On |
| Production | Off |
| Data | Kept |
|---|---|
| Time, request id, the CVR number of your firm, the prefix of the token, IP address, method, path, parameters, status | 5 years |
| The request body and the response body (JSON or PDF) | 30 days |
| The token, and each header | Never |
Only an admin of Revisoradgang can read a record. The service records each view of a body.
Your usage
We count requests and keys for each day and each dataset. This count is the base for the invoice. Write to support@revisoradgang.dk for the numbers of your firm.