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

# Count accounting units

> Returns the number of remaining accounting unit IDs.

Use this endpoint to estimate how many records a sync will process before starting. For example, you can use it to show a progress bar, build structured logs, or decide whether to run a full sync or a targeted one.

It accepts the same filters as [List accounting units](/ruz/api-reference/identifier-lists/list-accounting-units) and returns a single count. It is not required for pagination.

***

## Common patterns

<AccordionGroup>
  <Accordion title="Log the number of remaining records">
    Fetch the count before starting a sync to know how many records you'll process.

    ```js Counting accounting units theme={null}
    // 1. Fetch the count of remaining accounting units
    const { pocetZostavajucichId } = await fetch(
      `/api/zostavajuce-id/uctovne-jednotky?zmenene-od=2025-01-01`
    ).then(r => r.json());

    // 2. Log the number of remaining records
    console.log(`${pocetZostavajucichId} records to process`);
    ```
  </Accordion>
</AccordionGroup>


## OpenAPI

````yaml ruz/openapi.json GET /api/zostavajuce-id/uctovne-jednotky
openapi: 3.1.0
info:
  title: RÚZ API
  description: >-
    Public REST API for Slovakia's Register of Financial Statements (Register
    účtovných závierok). Exposes accounting units, financial statements,
    financial reports, and annual reports in JSON. Data is updated throughout
    the day as records are published.
  version: 2.5.0
  license:
    name: Creative Commons Zero (CC0)
    url: https://creativecommons.org/publicdomain/zero/1.0/
servers:
  - url: https://www.registeruz.sk/cruz-public
    description: Production
security: []
paths:
  /api/zostavajuce-id/uctovne-jednotky:
    get:
      summary: Count accounting units
      description: >-
        Returns the number of remaining accounting unit IDs matching the given
        filters. Useful for progress tracking during a large sync — not required
        for pagination.
      operationId: countRemainingAccountingUnits
      parameters:
        - $ref: '#/components/parameters/zmeneneOd'
        - $ref: '#/components/parameters/pokracuvatZaId'
        - name: ico
          in: query
          description: Filter by IČO — exact match.
          schema:
            type: string
        - name: pravna-forma
          in: query
          description: Filter by legal form code.
          schema:
            type: string
      responses:
        '200':
          description: Remaining count returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemainingCountResponse'
components:
  parameters:
    zmeneneOd:
      name: zmenene-od
      in: query
      required: true
      description: >-
        Return IDs changed on or after this date. Accepts `YYYY-MM-DD` or
        `YYYY-MM-DDThh:mm:ssZ`.
      schema:
        type: string
        example: '2000-01-01'
    pokracuvatZaId:
      name: pokracovat-za-id
      in: query
      description: Pagination cursor. Pass the last `id` from the previous response.
      schema:
        type: integer
  schemas:
    RemainingCountResponse:
      type: object
      description: Count of remaining IDs matching the given filters.
      properties:
        pocetZostavajucichId:
          type: integer
          description: Number of remaining IDs.

````