---
title: "Hierarchical CNAE tree"
method: GET
path: "/api/v1/cnae/tree"
tags: ["Sectors"]
---

# Hierarchical CNAE tree

`GET /api/v1/cnae/tree`

Return the CNAE-2009 hierarchy with counts read only from the offline sector projection. Cached 24h; no live aggregation is performed.

## Response `200`

CNAE tree

- CnaeTreeResponse
  - `sections` CnaeNode[], required
    - `code` string
    - `name` string
    - `level` integer, nullable
    - `parent` string, nullable
    - `companies_count` integer, nullable
    - `count_status` 'precomputed' | 'not_precomputed'
    - `children` CnaeNode[]

## Other responses

- `429` — Rate limit exceeded
- `503` — The public read failed closed because its legal source catalog, subject classification, bounded projection, database helper or required artifact is unavailable. Clients must not infer an empty result.

## Changes

- **2026-07-26** `996f96a11758` — 6 info
  - api operation id `getCnaeTree` was added
  - the endpoint scheme security `apiKey` was added to the API
  - the endpoint scheme security `bearerAuth` was added to the API
  - added the non-success response with the status `429`
  - …2 more

[Change history](https://skmtc.dev/openmercantil/apis/openmercantil-public-api/changes/api/v1/cnae/tree/get.md)

---

[API](https://skmtc.dev/openmercantil/apis/openmercantil-public-api.md) · [All operations](https://skmtc.dev/openmercantil/apis/openmercantil-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/openmercantil/openmercantil-public-api/revisions/601ff6123c86/schema)
