MGBI provides a comprehensive API for retrieving data from public registers and records, including the Regulated Activities Register (RDR).
You can find a list of data sources available through this service at:
👉Public Registers API
This guide coversthe API for the Regulated Activity Registers (RDR) for entities registered in the National Court Register (KRS), which we provide as part of the following product:
👉Regulated Activity Registers API (RDR API)
Below, we describe how you canuse the API to retrieve the content of RDR entries for specific entities based on their registration numbers (KRS, NIP, or REGON).
Step 1: Obtain an API authorization key
To obtain the authorization key required to call endpoints available in the MGBI API, please contact us using the contact form on the product page:
👉Regulated Activities Register API (RDR API)
Step 2: Call the Create Refresh endpoint
We make the data available in the RDR accessible via the MGBI API in the data model with the identifierpl-rdr-record.
This model is synchronized on demand, which means that we do not have a complete copy of the data available in the source registry in our database.
To retrieve the latest data for a specific entity from the model, you must first create a request to fetch it from the RDR using theCreate Refresh endpoint.
👉Create Refresh endpoint documentation
Example of calling the Create Refresh endpoint with a KRS number:
POST /v1/refresh HTTP/1.1
Host: api.mgbi.pl
Authorization: [klucz autoryzacji]
{
"query": {
"model": "pl-rdr-record",
"identifiers.pl_krs": "[numer KRS]"
}
}
A successful call to theCreate Refreshendpoint returns a dictionary containing the request ID in theid field.
Step 3: Call the Get Refresh endpoint
Requests to retrieve data from the source registry typically take anywhere from a few to several seconds to complete after they are created by theCreate Refresh endpoint.
To check the current status of an order, call theGet Refreshendpoint and include the order ID obtained in the previous step in the URL.
👉Get Refresh endpoint documentation
Example of calling the Get Refresh endpoint with a request ID:
GET /v1/refresh/[order ID] HTTP/1.1
Host: api.mgbi.pl
Authorization: [authorization key]
If the status field in the returned dictionary is set to "pending," the request is still being processed, and you should call theGet Refreshendpoint again in a few seconds.
If the status field is set to "success," this means that the request has been processed and the data regarding the specified debtor has already been retrieved from the source registry.
Step 4: Call the Get Records endpoint
The API for thepl-rdr-recordmodel provides aGet Records endpoint that returns records with the full response content from the RDR registry for the specified KRS number.
👉Documentation for the Get Records endpoint for the pl-rdr-record model
To retrieve data from the source registry in a previously created request, call theGet Recordsendpoint and pass the request ID in therefresh_id parameter.
GET /v1/models/pl-rdr-record/records?refresh_id=[order ID] HTTP/1.1
Host: api.mgbi.pl
Authorization: [authorization key]
Step 5: Use the response to generate a list of licenses, permits, and RDR entries for the specified entity
A successful call to the Get Records endpoint returns a list of records that meet the specified criteria.
In the example above, the endpoint should return a list of results containing a single record:
{
"count": 1,
"pages": 1,
"results": [
{
"id": "[identyfikator rekordu]",
"identifiers": "[identyfikatory podmiotu]",
"content": "[treść odpowiedzi]",
"meta": "[metadane rekordu]"
}
]
}
You can find all data regarding individual permissions available in the RDR for the specified entity in the elements of the ` content.raw_result.permissions` list.
Sample content of the content.raw_result.permissions list item:
{
"from": "[data początkowa okresu obowiązywania]",
"to": "[data końcowa okresu obowiązywania]",
"name": "[nazwa uprawnienia]",
"description": "[opis uprawnienia]",
"issueAuthorityName": "[nazwa organu wydającego]"
}
Learn more:
👉Data structure in the pl-rdr-record model
👉Endpoint documentation for the pl-rdr-record model