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

# Local storage

> Build a local copy of the full RÚZ dataset and keep it up to date.

***

## Choose a method

RÚZ supports local copies through list endpoints, detail endpoints, and incremental updates with `zmenene-od`. Use this approach when you need the full dataset in your own system or want to keep a local copy up to date.

| Use case                                        | Best choice   |
| ----------------------------------------------- | ------------- |
| Fetch one entity on demand                      | REST API      |
| Fetch recently changed entities                 | REST API      |
| Build a full local copy of the entire register  | Local storage |
| Keep your local copy of the register up to date | Local storage |

## Build your local copy

<Steps>
  <Step title="Start with an early date">
    Use an early `zmenene-od` value such as `2000-01-01` to retrieve the full dataset through the list endpoints.

    ```bash List accounting unit IDs theme={null}
    curl "https://www.registeruz.sk/cruz-public/api/uctovne-jednotky?zmenene-od=2000-01-01&max-zaznamov=100"
    ```

    ```json Response theme={null}
    {
      "id": [336953, 412071, 598204],
      "existujeDalsieId": true
    }
    ```
  </Step>

  <Step title="Page through all IDs">
    Continue paging until `existujeDalsieId` is `false`. To get the next page, repeat the same request and set `pokracovat-za-id` to the last returned ID.

    ```bash Get the next page theme={null}
    curl "https://www.registeruz.sk/cruz-public/api/uctovne-jednotky?zmenene-od=2000-01-01&max-zaznamov=100&pokracovat-za-id=598204"
    ```
  </Step>

  <Step title="Fetch full records">
    For each returned ID, call the matching detail endpoint and store the full record in your database, warehouse, or other local storage.

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

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

  <Step title="Repeat for each entity type">
    To keep a complete local copy, repeat the same flow for accounting units, financial statements, financial reports, and annual reports.

    <Tip>
      To understand the pattern used to retrieve financial statements, financial reports, and annual reports, see the [Data access](/ruz/getting-started/data-access) guide.
    </Tip>
  </Step>

  <Step title="Keep it up to date">
    After the initial load, store the date or timestamp from the start of the run and reuse it as `zmenene-od` on the next run. This returns only entities whose `datumPoslednejUpravy` is on or after that specific date.

    * **Date only:** `YYYY-MM-DD`
    * **Date and time:** `YYYY-MM-DDThh:mm:ssZ`

    Use the timestamp form when you need sub-day precision, for example if you sync multiple times per day.

    ```bash Example requests theme={null}
    # All changes from 2025-07-01 onward
    curl "https://www.registeruz.sk/cruz-public/api/uctovne-jednotky?zmenene-od=2025-07-01"

    # Changes from a specific time
    curl "https://www.registeruz.sk/cruz-public/api/uctovne-jednotky?zmenene-od=2025-07-01T14:30:00Z"
    ```
  </Step>
</Steps>

***

## Review limits

* The `zmenene-od` is tracked per entity type
* Any changes to a financial report **do not** update the accounting unit's modified date
* For multiple syncs per day, use the timestamp form of `zmenene-od`
* If you need financial reports or annual reports, you must sync those entity lists separately.

## See more

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

  <Card title="Data access" icon="route" href="/ruz/getting-started/data-access">
    See how accounting units, statements, reports, and annual reports link together.
  </Card>

  <Card title="Identifier lists" icon="list" href="/ruz/api-reference/identifier-lists/list-accounting-units">
    Review all list endpoints, filters, and response formats.
  </Card>

  <Card title="Entity details" icon="file-text" href="/ruz/api-reference/entity-details/get-accounting-unit">
    Fetch full records for accounting units, statements, reports, and annual reports.
  </Card>
</CardGroup>
