Analytics
OData API
Welcome to our OData REST API documentation.
The 21RISK OData API is an efficient API that makes it easy to extract your data from 21RISK into Power BI, a data warehouse, or similar.
The API refrence documentation is made using the Open API specification .
Why OData Why OData
OData is a REST API standard, well recognized by the industry. We are using v4.
You can access the $metadata here. With tools speaking OData both ends, this can help simplify common issues encountered when doing "raw" REST API integrations.
Authentication Authentication
To create an API key, go to Account Settings in 21RISK, and choose Create API Key
After choosing a friendly name, copy the API key and store it securely, you will not be able to see the key again.
Note
Never share your secret API keys in publicly accessible areas, client-side code or similar.
You must make all API calls over HTTPS . You can either provide the API key with HTTP Basic Auth or as a Bearer Token.
curl --location 'https://www.21risk.com/odata/v5/items-per-month' \ --header 'Authorization: Bearer <token>'
There is no usage limit on the API, but please refer to our Acceptable Use Policy if you plan on something special. We currently enforce a max of 10 API keys.
Pagination Pagination
All 21RISK OData endpoints return lists of data, following the standard OData cursor based pagination.
{ "value": [ {"id": "item1"}, {"id": "item2"} ] }
And you can limit the amount of results in a page, by specifying the maxPageSizeInMb query param.
It defines the max-size in Mb for each request, with a maximum allowed value of 450. Minimum is 1, and it will defualt to 50.
Most ETL related integrations can benefit, from setting this value relatively high.
Note
All requests are also subject to a 250 seconds duration limit, and will gracefully close before hitting this limit.
Besides the maxPageSizeInMb , use the $skiptoken when implementing pagination. You can read more at the official OData documentation.
Data model Data model
Our API follows the Star schema design.
We have dimension and fact tables. The most relevant fact table is ItemsPerMonth
The ItemsPerMonth is one row per question per site per month. This makes the fact easy to use, when answering questions like:
- How many sites are compliant in question 1.
- Compared to 6 months ago, what is the compliance percentage in Europe?
- Do our sites use the Not Applicable option more or less compared to last year?
- What is the overall distribution of answered questions?
Note
Items Per Month currently returns the last 24 months and the next 12 months.