# Get a CAEN code with hierarchy and Rev.2 mapping

One CAEN Rev.3 code with its full ancestor chain, direct children and the Rev.2 codes it replaces. Looking up a dropped Rev.2 code answers 404 listing its Rev.3 successors (migration aid for pre-2025 codes). Free of charge.

- REST: `GET https://api.datero.ro/v1/caen-codes/:code`
- Tool MCP: `get_caen_code` (endpoint: https://api.datero.ro/mcp)
- Cost: gratuit (0 credite)
- Autentificare: opțională — funcționează și fără cheie (doar rate-limited)

## Parametri

| Nume | În | Tip | Obligatoriu | Descriere |
| --- | --- | --- | --- | --- |
| `code` | path | string | da | Section letter ("J") or 2–4 digit code ("62", "620", "6210"). |

## Exemplu: Clasa 6210 cu ierarhie și echivalențe Rev.2

Răspunsul include lanțul de părinți (secțiune → diviziune → grupă) și codurile Rev.2 înlocuite.

```bash
curl "https://api.datero.ro/v1/caen-codes/6210"
```

Răspuns:

```json
{
  "code": "6210",
  "name": "Activități de realizare a softului la comandă (software orientat client)",
  "type": "class",
  "description": null,
  "parentCode": "621",
  "parents": [
    {
      "code": "K",
      "name": "Telecomunicații; activități de programare și de consultanță în tehnologia informației; alte servicii informaționale",
      "type": "section",
      "description": null,
      "parentCode": null
    },
    {
      "code": "62",
      "name": "Activități de programare și activități de consultanță în tehnologia informației",
      "type": "division",
      "description": null,
      "parentCode": "K"
    },
    {
      "code": "621",
      "name": "Activități de programare",
      "type": "group",
      "description": null,
      "parentCode": "62"
    }
  ],
  "children": [],
  "replacesRev2Codes": [
    6201
  ]
}
```

Documentație completă: https://datero.ro/docs/api/caen/get · OpenAPI: https://api.datero.ro/openapi.json
