circle

Read our latest report on bankruptcies and restructuring in the construction industry. Download »

Public Registers API

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 retrieve selected fields from the financial statements 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 record containing financial statements from the KRS Financial Documents Repository for a selected entity, you must specify its registration number—KRS, NIP, or REGON—in the Get Records endpoint, along with 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: Extract the selected report fields from the response

A successful call to the Get Records endpoint returns a list of documents that meet the specified criteria.

In the previous example, the endpoint should return a list of results containing a single record:

{
    "count": 1,
    "pages": 1,
    "results": [
        {
            "id": [identyfikator rekordu],
            "identifiers": [identyfikatory podmiotu],
            "document": [informacje o dokumencie]
            "content": [zawartość dokumentu],
            "files": [pliki z treścią dokumentu],
            "meta": [metadane rekordu]
        }
    ]
}

The fields available in financial statements in XML format, which comply with the logical structures specified by the Polish Ministry of Finance, are stored in two dictionaries:

  • content.extracted_fields,
  • content.standardized_fields.

The content.extracted_fields dictionary contains all fields available in the report according to the logical structure used.

We provide a complete list of the fields available in this dictionary in an Excel file. Please contact us using the form on the product page to receive a link to download the file.

Sample contents of the content.extracted_fieldsdictionary:

{
    "bs": {
        "a_ca_cfy": 0,
        "a_ca_pfy": 0,
        "a_fa_cfy": 0,
        "a_fa_pfy": 0,
        "a_ta_cfy": 0,
        "a_ta_pfy": 0,
        ...
    }
}

If you need access to all financial fields in the report, use the `content.extracted_fields` dictionary. If, on the other hand, you only need the most important fields from the balance sheet or income statement, use the `content.standardized_fields` dictionary.

Learn more:
👉 Data structure in the pl-krs-rdf-record model
👉 Endpoint documentation for the pl-krs-rdf-record model

A demo is worth more than a thousand words

Get in touch with us
arrow_forward