> ## Documentation Index
> Fetch the complete documentation index at: https://slovakapi.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Data access

> Follow links from accounting units to financial data.

***

## Understand the pattern

Regardless of what you're trying to retrieve, every RÚZ integration follows the same **drill-down** pattern. Once you understand it, the rest of the API becomes much easier to work with.

You never get everything in one call. Each step gets you closer to the data you need:

```mermaid theme={null}
flowchart LR
  A[List IDs] --> B[Fetch full record] --> C[Follow links deeper]
```

1. **List** — call an identifier list endpoint to get a page of IDs matching your criteria.
2. **Fetch** — use an ID to get the full record for that entity.
3. **Drill down** — the full record contains IDs of related entities. Follow them to go deeper.

***

## Understand the hierarchy

Four main entity types make up the register. An [Accounting unit](/ruz/api-reference/entity-details/get-accounting-unit) is always the starting point. Financial statements and annual reports link from it, and financial reports link from those.

```mermaid theme={null}
%%{init: {'flowchart': {'nodeSpacing': 50, 'rankSpacing': 40}}}%%
flowchart LR
  UJ["Accounting unit"]
  UZ["Financial statement"]
  VS["Annual report"]
  UV["Financial report"]
  SAB["Template"]
  PRIL["Attachment"]

  UJ -->|idUctovnychZavierok| UZ
  UJ -->|idVyrocnychSprav| VS
  UZ -->|idUctovnychVykazov| UV
  VS -->|idUctovnychVykazov| UV
  UV -.->|idSablony| SAB
  UV -.- PRIL
  VS -.- PRIL
```

Each arrow is a field on the parent containing an array of child IDs. You call the child's detail endpoint with those IDs to go one level deeper. Dotted lines indicate supporting objects that belong to a parent but are not navigated to via a separate endpoint.

<Info>
  A financial report can belong to both a financial statement and an annual report simultaneously.
</Info>

To learn more about each entity type, see [Data models](/ruz/concepts/data-models).

***

## See common flows

The examples below demonstrate the drill-down pattern with real requests and responses. Each one shows a complete flow from listing IDs to retrieving the data you need.

<AccordionGroup>
  <Accordion title="Get financial statements and reports">
    Drilling from an accounting unit down to structured financial statements and reports.

    <Steps>
      <Step title="Find the accounting unit ID">
        Call the accounting units list with an `ico` filter to find the entity.

        ```bash List accounting units by IČO theme={null}
        curl "https://www.registeruz.sk/cruz-public/api/uctovne-jednotky?zmenene-od=2000-01-01&ico=00603481"
        ```

        ```json Response highlight={2} theme={null}
        {
          "id": [336953],
          "existujeDalsieId": false
        }
        ```
      </Step>

      <Step title="Fetch the accounting unit">
        Use the ID to get the full record. The response contains `idUctovnychZavierok`, the IDs of all financial statements filed by this unit.

        ```bash Get accounting unit by ID theme={null}
        curl "https://www.registeruz.sk/cruz-public/api/uctovna-jednotka?id=336953"
        ```

        ```json Response highlight={6} theme={null}
        {
          "id": 336953,
          "ico": "00603481",
          "nazovUJ": "Hlavné mesto Slovenskej republiky Bratislava",
          "datumZalozenia": "1991-01-01",
          "idUctovnychZavierok": [340867, 497509, 1100864],
          "idVyrocnychSprav": []
        }
        ```
      </Step>

      <Step title="Fetch a financial statement">
        Pick a statement ID from `idUctovnychZavierok` and fetch its detail. The response contains `idUctovnychVykazov`, the IDs of the individual financial reports within this statement.

        ```bash Get financial statement by ID theme={null}
        curl "https://www.registeruz.sk/cruz-public/api/uctovna-zavierka?id=340867"
        ```

        ```json Response highlight={7} theme={null}
        {
          "id": 340867,
          "idUJ": 336953,
          "obdobieOd": "2009-01",
          "obdobieDo": "2009-12",
          "typ": "Riadna",
          "idUctovnychVykazov": [686260, 680247]
        }
        ```
      </Step>

      <Step title="Fetch a financial report">
        Pick a report ID from `idUctovnychVykazov` and fetch its detail. The response contains structured table data in `obsah.tabulky`, a cover page in `titulnaStrana`, and downloadable attachments in `prilohy`.

        ```bash Get financial report by ID theme={null}
        curl "https://www.registeruz.sk/cruz-public/api/uctovny-vykaz?id=686260"
        ```

        ```json Response theme={null}
        {
          "id": 686260,
          "idUctovnejZavierky": 340867,
          "idSablony": 98,
          "obsah": {
            "titulnaStrana": {
              "ico": "00603481",
              "obdobieOd": "2009-01",
              "obdobieDo": "2009-12",
              "nazovUctovnejJednotky": "Hlavné mesto Slovenskej republiky Bratislava"
            },
            "tabulky": [
              { "nazov": { "sk": "Náklady" }, "data": ["4248919", "17058", "145116521"] },
              { "nazov": { "sk": "Výnosy" }, "data": ["12222937", "425982", "130597430"] }
            ]
          },
          "prilohy": [
            { "id": 214469, "mimeType": "image/tiff", "velkostPrilohy": 203499 }
          ]
        }
        ```

        <Info>
          Row labels for `tabulky` are defined by the report template at `idSablony`. Fetch it from [Get report template](/ruz/api-reference/templates/get-report-template) to map row numbers to their Slovak labels.
        </Info>
      </Step>
    </Steps>
  </Accordion>

  <Accordion title="Get annual reports">
    Drilling from an accounting unit down to annual report attachments.

    <Steps>
      <Step title="Fetch the accounting unit">
        The accounting unit response contains `idVyrocnychSprav`, the IDs of all annual reports filed by this unit.

        ```bash Get accounting unit by ID theme={null}
        curl "https://www.registeruz.sk/cruz-public/api/uctovna-jednotka?id=635004"
        ```

        ```json Response theme={null}
        {
          "id": 635004,
          "nazovUJ": "Continental Matador Rubber, s.r.o.",
          "idVyrocnychSprav": [316853, 316854]
        }
        ```
      </Step>

      <Step title="Fetch an annual report">
        Pick an ID from `idVyrocnychSprav` and fetch its detail. Download attachments at `/domain/financialreport/attachment/{id}`.

        ```bash Get annual report by ID theme={null}
        curl "https://www.registeruz.sk/cruz-public/api/vyrocna-sprava?id=316853"
        ```

        ```json Response theme={null}
        {
          "id": 316853,
          "nazovUJ": "Continental Matador Rubber, s.r.o.",
          "typ": "Individuálna výročná správa",
          "obdobieOd": "2011-01",
          "obdobieDo": "2011-12",
          "prilohy": [
            {
              "id": 217769,
              "mimeType": "image/tiff",
              "meno": "POD201_4045546120_IR_2011_617_2013_538566.TIF",
              "velkostPrilohy": 296519
            }
          ]
        }
        ```
      </Step>
    </Steps>
  </Accordion>
</AccordionGroup>

***

## Next steps

<CardGroup cols={2}>
  <Card title="Pagination" icon="refresh-cw" href="/ruz/getting-started/pagination">
    How to page through identifier list results.
  </Card>

  <Card title="Syncing data" icon="refresh-cw" href="/ruz/getting-started/local-storage">
    How to fetch only recently updated records and keep a local copy in sync.
  </Card>

  <Card title="Codelists" icon="book-open" href="/ruz/concepts/codelists">
    Resolve coded fields (legal form, NACE, region, district, etc.) to labels.
  </Card>

  <Card title="API Reference" icon="code" href="/ruz/api-reference/identifier-lists/list-accounting-units">
    Every endpoint with parameters, responses, and examples.
  </Card>
</CardGroup>
