MGBI provides a comprehensive API for retrieving data from public registers and records, including the National Court Register (KRS). You can find a list of data sources available through this service at:
👉 Public Registers API
This guide covers the API for the KRS Financial Documents Repository, which we provide as part of the following product:
👉 National Court Register API (KRS API) - Financial Documents Repository
Below, we describe how you can use the API to download a file containing the financial documents of a specific entity listed in the National Court Register (KRS) based on its KRS number and other parameters.
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:
👉 National Court Register API (KRS API) - Financial Documents Repository
Step 2: Call the Get Records endpoint
We make the data available in the KRS Financial Documents Repository accessible via the MGBI API in a data model with the identifier pl-krs-rdf-record.
The API provides a Get Records endpoint for this model, which returns records containing information about individual financial documents that meet the specified criteria.
👉 Documentation for the Get Records endpoint for the pl-krs-rdf-record model
To retrieve a list of documents available in the KRS Financial Document Repository for a selected entity, you must provide its registration number—KRS, NIP, or REGON—in the Get Records endpoint.
Example of calling the Get Records endpoint using a KRS number:
GET /v1/models/pl-krs-rdf-record/records?identifiers.pl_krs=[KRS number] HTTP/1.1
Host: api.mgbi.pl
Authorization: [authorization key]
To narrow down the list to the documents you're interested in, you can also use additional parameters, such as:
- type - type of document (e.g., annual financial statements, management report on the entity's operations),
- period_major_year - the year in which the majority of the period covered by the document falls.
In the example below, the Get Records endpoint was used to retrieve the 2025 financial statements for the entity with the specified KRS number.
Example of calling the Get Records endpoint with a KRS number, document type, and fiscal year:
GET /v1/models/pl-krs-rdf-record/records?identifiers.pl_krs=[KRS number]&type=financial_statement._major_year=2025 HTTP/1.1
Host: api.mgbi.pl
Authorization: [authorization key]
Step 3: Find the download link for the document file in the response
A successful call to the Get Records endpoint returns a list of documents that meet the specified criteria.
In the previous examples, the endpoint should return a list of results containing one or more records:
{
"count": [liczba wyników],
"pages": [liczba stron wyników],
"results": [
{
"id": [identyfikator rekordu],
"identifiers": [identyfikatory podmiotu],
"document": [informacje o dokumencie]
"content": [zawartość dokumentu],
"files": [pliki z treścią dokumentu],
"meta": [metadane rekordu]
}
]
}
You can find the URL of the file containing the document in its original format, as submitted to the KRS Financial Documents Repository , in the ` files.main_document.original.url` field .
Step 4: Download the file contents and save them or send them to your browser
To retrieve the contents of the file with the latest version, send an HTTP GET request using the URL retrieved from the `files.main_document.original.url ` field and the API authorization key:
GET [file path] HTTP/1.1
Host: api.mgbi.pl
Authorization: [authorization key]
You can also send the file's content directly to your app user's web browser. In this case, set the value of the HTTP Content-Type header—which informs the browser of the file's format—based on the contents of the ` files.main_document.original.content_type` field.
Learn more:
👉 Data structure in the pl-krs-rdf-record model
👉 Endpoint documentation for the pl-krs-rdf-record model