# lojaDados — Brazilian Public Data API

This document is the complete public contract of the API. The running service serves it without a key at `/docs` (HTML) and `/docs/api.md` (Markdown). Every endpoint under `/api` needs a key.

The service republishes Brazilian government open data, starting with the Receita Federal CNPJ registry, and keeps every published release of it, so answers name the release they come from and history is available. Supplementary datasets (city codes, tax regimes, IBGE population and GDP, CGU sanctions and leniency agreements, CNES health facilities, Anvisa operating authorisations, Anvisa medicine and medical device registrations, Anvisa good-practice certificates and enforcement measures on irregular products, CMED medicine prices, Paraná's PMPF reference prices of medicines (the medicine list only; fuel lists are not loaded), PGFN federal debts, the CVM register of publicly held companies, the Ministry of Labour's forced-labour employer registers, awarded public procurement results of the federal platform Compras.gov.br and its goods and services catalogue, and PNCP purchase notices) have their own releases, as does the IBGE CNEFE 2022 census address base used as the reference for map locations (dataset `cnefe`, no endpoint of its own; see Map). CEP addresses are not a dataset of this service: each lookup is forwarded to brapi (see CEP).

## Conventions

```sh
curl -H 'Authorization: Bearer <api key>' 'https://lojadados.com/api/cnpj/v1/establishments/<cnpj>'
```

- **Addresses** follow `/api/<domain>/v<N>/<resource>`: each domain (`cnpj`, `procurement`, `health`, `sanctions`, `pgfn`, `mte`, `cvm`, `anp`, `reference`, `catalog`) is versioned on its own. A breaking change in one domain becomes `v2` of that domain only. The `domain` field of the dataset catalog keeps the names of the data's database schemas (`compras`, `saude`, `sancoes`, …), not the address segment. Addresses of the earlier naming are 404 `NOT_FOUND` (table below).
- **Earlier address prefixes** (before 2026-11-25; 404 `NOT_FOUND`, no forwarding):

  | Earlier prefix | Current prefix |
  | --- | --- |
  | `/api/compras/v1` | `/api/procurement/v1` |
  | `/api/saude/v1` | `/api/health/v1` |
  | `/api/sancoes/v1` | `/api/sanctions/v1` |
  | `/api/divida/v1` | `/api/pgfn/v1` |
  | `/api/trabalho/v1` | `/api/mte/v1` |
  | `/api/mercado/v1` | `/api/cvm/v1` |
  | `/api/energia/v1` | `/api/anp/v1` |
  | `/api/cep/v1/{cep}` | `/api/reference/v1/cep/{cep}` |

- **Earlier parameter names** (before 2026-11-26): resource path segments, query parameter names and program-defined values were renamed from Portuguese to English (for example purchase notices moved from `editais` to `notices`, and their `situacao=aberta` is now `status=open`). Earlier paths are 404 `NOT_FOUND`, earlier parameter names 400 `INVALID_QUERY` and earlier values 400, with no aliases. Response field names did not change: the `query` echo of a response still uses the internal (often Portuguese) names and values, so do not expect it to repeat the request parameters.
- **Keys**: send `Authorization: Bearer <key>` (the scheme is case-insensitive, the key is not). Never put a key in a URL. Missing or unknown key: 401 with `WWW-Authenticate: Bearer`. A service without configured keys, or with a malformed configured key hash, answers 503 `SERVICE_UNAVAILABLE` to every request. The key is checked before anything else, so an unauthenticated request learns nothing about which paths exist.
- **Methods**: `GET` and `HEAD` only; other methods are 405 `METHOD_NOT_ALLOWED` with an `Allow` header.
- **Errors** always have one shape: `{"error":{"code":"…","message":"…"}}`, sometimes with extra fields named below (for example `reason`). Unknown paths are 404 `NOT_FOUND`; URLs whose percent-encoding cannot be decoded are 400 `INVALID_QUERY`.
- **Parameters**: unknown parameters and repeated single-value parameters are 400 `INVALID_QUERY` (a misspelt `pagesize` is never silently ignored). An empty value (`?uf=`) means "not given". Spaces around a company number in a path (`/establishments/%2011111111000101`) are ignored, and an echoed `input` comes back without them.
- **Outer fields are English** (`source`, `items`, `next_cursor`, `count`, …). **Data fields keep the official Portuguese names** of each source's data dictionary in lower snake case (`razao_social`, `situacao_cadastral`, `cnae_fiscal_principal`, `data_inicio_sancao`, …). Official values stay strings as published, including codes, `YYYYMMDD` dates, empty strings and decimal commas, unless an endpoint says otherwise.
- **Timestamps** (instants such as `detected_at`, `published_at`, `fetched_at`) are ISO 8601 in the `America/Sao_Paulo` time zone with its offset, e.g. `2026-11-19T10:03:24-03:00`, whatever the server's zone. Calendar dates (`YYYY-MM-DD`) carry no zone. Date-times copied from a source record (procurement results and PNCP purchase notices) stay the official local date-time without an offset, as those sections say. Timestamps copied from release manifests written before 2026-11-19 keep their original UTC offset (`+00:00`); both forms denote exact instants.
- **Company numbers in lists**: every list looked up by company number (CEIS, CNEP, CEPIM, leniency agreements, CNES, Anvisa AFE, the Anvisa certificates and irregular products, the ANP stations and fines, PGFN, CVM, the MTE registers, procurement results, and the `cnpj` lookup of CMED prices and of Anvisa medicine and medical device registrations) takes `cnpj` as a complete CNPJ (formatted input such as `11.111.111/0001-01` is accepted, URL-encoded) or an 8-character base. On the lists where `cnpj` is the only lookup, a missing or empty `cnpj` is 400 `INVALID_CNPJ`; on CMED, medicines and medical devices it is one of several lookups, and giving none of them is 400 `INVALID_QUERY`. Numbers in the source files were read by one rule when loaded: by their shape (14 characters: a CNPJ, punctuation removed; 11 digits: a CPF, stored masked as `***NNNNNN**`), never by a type column, so a CNPJ published with a blank person type is still found. Except for lists that match two company columns, a complete CNPJ looks up its base, and `match` is `exact_cnpj` when the record's number equals the given CNPJ, else `same_base_number`. Lists that match two company columns (CNES, the Anvisa certificates and irregular products) match a complete CNPJ exactly and a base by prefix, and name the matched column(s) instead (`matched_by`, `role`; see Health facilities).
- **Text fragments** (`description` and `name` of procurement, `subject` of PNCP notices, the name lookups of CMED and Anvisa registrations) have at most 200 characters and no control characters (tabs and line breaks count as spaces); otherwise 400 `INVALID_QUERY`. Accents are ignored by removing combining marks after Unicode NFKD decomposition; the stored procurement and notice texts remove only the marks U+0300–U+036F (every accent of Portuguese), so a fragment carrying a mark outside that range (for example a Hebrew or Arabic vowel sign) may find nothing.
- **`interpretation`** in those lists has one vocabulary: `listed_records` when the answer has items, `no_listed_record_is_not_a_clearance` when it has none. Absence from an open-data list proves nothing about the company.
- **Caching**: every response is `Cache-Control: no-store`. Responses that belong to one monthly CNPJ release carry `X-Data-Month: YYYY-MM`.

### Releases

- Every dataset publishes numbered releases. `source.release` is the release label (CNPJ: `<official month>-<12 hex digits>`), `source.seq` its sequence number and `source.reference` the official period (CNPJ: the month).
- **A month is not a release**: one month can have revisions, and the service can roll back to an earlier release, so compare `source.release`, never the month.
- Each request reads exactly one release of each dataset it uses. Content of releases that are still building, not yet published, or withdrawn by a rollback is never visible.
- `GET /api/catalog/v1/datasets` lists every registered dataset in (`domain`, `id`) order, with `current_release: null` when none is published yet. `kind` is `registry` for snapshots and `stream` for the datasets loaded by date range (`compras`, `compras_editais`, `ptax`). The 30 datasets by domain: `aduana`: `aduana_aliquotas`, `aduana_ncm`, `aduana_tabelas`, `ptax`; `cnefe`; `cnpj`; `compras`: `compras`, `compras_catalogo`, `compras_editais`; `divida`: `pgfn`; `energia`: `anp_multas`, `anp_revendedores`; `ibge`: `ibge_pib`, `ibge_populacao`; `mercado`: `cvm_cia_aberta`; `municipios`; `regimes`; `sancoes`: `ceis`, `cnep`, `cepim`, `leniencia`; `saude`: `anvisa_afe`, `anvisa_cbpf`, `anvisa_irregulares`, `anvisa_medicamentos`, `anvisa_produtos_saude`, `cmed`, `cnes`, `pmpf_pr`; `trabalho`: `mte_trabalho_escravo` (where only one name is given, the domain and the id are the same). The CEP supplement is not a dataset and is not listed.

```json sample=catalog
{"count":30,"items":[{"id":"cnefe","domain":"cnefe","title":"Cadastro Nacional de Endereços para Fins Estatísticos (Censo 2022)","kind":"registry","publisher":"IBGE","source_url":"…","description":"Census 2022 address points, used as the reference for establishment map locations.","published_releases":1,"current_release":{"release":"…","seq":1,"reference":"…","coverage":"full","published_at":"2026-11-18T22:10:41-03:00"}},{"id":"cnpj","domain":"cnpj","title":"Cadastro Nacional da Pessoa Jurídica (CNPJ)","kind":"registry","publisher":"Receita Federal do Brasil","source_url":"…","description":"…","published_releases":2,"current_release":{"release":"2026-09-2ce13719f437","seq":2,"reference":"2026-09","coverage":"full","published_at":"2026-11-20T00:31:07-03:00"}}]}
```

### Pages and cursors

| Endpoints | Paging | End | After a publish, revision or rollback |
| --- | --- | --- | --- |
| every list (search, history, same phone, same address, phone lookup, subject establishments, members, candidates, statistics breakdown, map lists, sanctions, health facilities, Anvisa operating authorisations, Anvisa medicine and medical device registrations, Anvisa good-practice certificates `/api/health/v1/cbpf` and irregular products `/api/health/v1/irregular-products`, CMED prices, federal debts, CVM register, the MTE registers `/api/mte/v1/forced-labor-employers` and `/api/mte/v1/ceac`, procurement results, prices and catalogue, PNCP purchase notices, the customs releases, tables and records `/api/customs/v1/…`) | `page_size` (default 20, max 100) and `cursor`: pass the response's `next_cursor` back unchanged | `next_cursor` is `null` | an old `cursor` is 409 `RELEASE_CHANGED`: drop it and start again |

- A cursor is bound to one endpoint, one normalized query and one release (a search with list conditions: the CNPJ release and every list release it uses). A cursor of another endpoint or query, an empty `cursor=`, a damaged one, or one whose position was altered (a missing, empty or out-of-range position included) is 400 `INVALID_CURSOR`; it never restarts at the first page. Do not join pages of different releases into one list.
- `count` is the number of items on this page, never a total. Where a total is known cheaply it is given as `total`.
- Some reads have a time budget (about 300–400 ms). When it runs out the page carries what was found, `partial: true` and a `next_cursor` positioned after the scanned range, so nothing is skipped or repeated; such a page can be short or even empty. Only `next_cursor: null` ends a read.

### Error codes

| Status | Code | Meaning | What to do |
| --- | --- | --- | --- |
| 400 | `INVALID_QUERY` | invalid or missing condition, unknown or repeated parameter, undecodable URL | fix the request |
| 400 | `INVALID_PAGE` | `page_size` outside 1–100 | fix it |
| 400 | `INVALID_CURSOR` | damaged cursor, empty `cursor=`, a cursor of another endpoint or query, or one whose position was altered | query again without `cursor` |
| 400 | `INVALID_CNPJ` | not a complete CNPJ (12 letters or digits plus 2 check digits; formatted input must be URL-encoded) or not an 8-character base number | fix the number |
| 400 | `INVALID_CHECKPOINT` | history checkpoint that cannot be decoded, was changed, is empty or belongs to another CNPJ | send the checkpoint exactly as received |
| 400 | `INVALID_PHONE` | phone lookup input that is not area code + number (no country code, nothing repaired) | fix the phone |
| 400 | `INVALID_MEMBER` | member query without masked CPF or name, malformed, a full CPF, or a `name` longer than 200 characters or with control characters | send only the masked form `***NNNNNN**` and a plain name |
| 400 | `INVALID_RELEASE` | malformed or repeated `release` parameter (a release label, or a release seq in the customs reads) | use `source.release` (customs: `source.seq`) as received |
| 400 | `INVALID_CEP` | not a complete 8-digit CEP, or all zeros | fix the CEP |
| 400 | `QUERY_TOO_BROAD` | procurement price `description` fragment matching too many results to answer in time | use a longer fragment, or add `uf` / `year` |
| 400 | `AREA_TOO_LARGE` | map groups bbox covers more than 1024 cells at that zoom (at zoom ≥ 15: more than 1024 level-16 tiles); a map list's bbox or cell covers more than 1024 level-16 tiles | zoom in |
| 401 | `UNAUTHORIZED` | missing or unknown key | send a valid key |
| 404 | `NOT_FOUND` | not present in the current release, or unknown path | absent from the release is not "deregistered" |
| 404 | `RELEASE_NOT_FOUND` | the `release` seq of a customs read was never published, or was withdrawn | list the releases (`/api/customs/v1/releases`) |
| 404 | `TABLE_NOT_FOUND` | the customs table is not part of the release read | list its tables (`/api/customs/v1/tables`) |
| 404 | `CEP_NOT_FOUND` | the CEP source explicitly says the CEP does not exist | its current answer only |
| 405 | `METHOD_NOT_ALLOWED` | method other than GET/HEAD | use GET |
| 409 | `RELEASE_CHANGED` | the release changed between pages (also map group ids of an older release) | drop the pages read and start again |
| 409 | `CHECKPOINT_RESTART_REQUIRED` | the history checkpoint cannot continue; `reason`: `checkpoint_ahead`, `release_withdrawn` or `event_withdrawn` | see "Change history" |
| 409 | `LOCATION_CHANGED` | the map locations of the same release were rebuilt | request the groups again |
| 503 | `SERVICE_UNAVAILABLE` | keys not configured or invalid | contact the operator |
| 503 | `DATA_UNAVAILABLE` | a dataset is not published yet, or the database cannot answer (including no free database connection within the server's connect timeout; any unexpected failure is answered with this code and logged); a search is affected only when it uses a condition on that list (`debt`, `sanctions`) or `member_name` while the release's member names are not checked yet, and "All lists of one company" marks only that section | retry later; never "no data" |
| 503 | `EXTRAS_UNAVAILABLE` | phone counts of the current release are missing; only phone searches are affected | search without the phone conditions |
| 503 | `STATISTICS_UNAVAILABLE` | statistics of the current release are missing or were counted under other rules | retry later; never a count of 0 |
| 503 | `SAME_ADDRESS_UNAVAILABLE` | the same-address data of the current release is missing, incomplete or built under other rules; only the same-address lookup is affected | retry later; never "no establishment at that door" |
| 503 | `LOCATION_UNAVAILABLE` | map locations of the current release are not built yet | retry later; never an empty area |
| 503 | `REGIMES_UNAVAILABLE` | the tax regime dataset is not loaded | never "no record" |
| 503 | `SUPPLEMENT_UNAVAILABLE` | the CEP supplement cannot be fetched now; `supplement.kind` says why | retry later; it does not mean the CEP does not exist |
| 503 | `GRAPH_BUSY` | too many relation graph queries at once | retry with your own back-off |

A request with no match is not an error: lists answer 200 with empty `items` and `next_cursor: null`.

```json sample=error-400
{"error":{"code":"INVALID_QUERY","message":"…"}}
```

## CNPJ

CNPJ (Cadastro Nacional da Pessoa Jurídica) numbers identify establishments: 14 characters, the first 8 (`cnpj_basico`) identify the subject (company) shared by its head office and branches. From July 2026 the first 12 characters may contain upper-case letters. Data comes from the monthly open files of the Receita Federal; every month since 2022-10 is kept as a release.

### Establishment detail

`GET /api/cnpj/v1/establishments/{cnpj}`

The registered data of one establishment in the current release. Formatted numbers (`00.123.456/0001-99`) must be URL-encoded (`%2F` for `/`). Check digits are not validated (the source is published as is).

| Field | Meaning |
| --- | --- |
| `empresa` | the subject's seven official fields; `null` when missing or conflicting |
| `empresa_candidates` | all distinct subject records when they conflict (never one picked) |
| `estabelecimento` | the establishment's thirty official fields |
| `socios` | member rows of the subject as published, duplicates kept, masked CPFs as published |
| `simples` / `simples_candidates` | Simples Nacional / MEI record; `null` with candidates when conflicting, `null` without them when there is none |
| `descriptions` | official descriptions of the codes, as of this release's code tables |
| `issues` | quality flags such as `empresa_conflict`, `simples_missing` |
| `supplement.municipio` | the Receita city code mapped to its IBGE code (see below); never fails the detail |

Absent from the current release (never seen, or missing since some release) is 404; the history of a missing number stays readable.

```json sample=detail
{"source":{"dataset":"cnpj","release":"2026-09-b0f837cc6c85","seq":3,"reference":"2026-09","coverage":"full"},"cnpj":"11111111000101","empresa":{"cnpj_basico":"11111111","razao_social":"Padaria São João Ltda","natureza_juridica":"2062","qualificacao_responsavel":"49","capital_social":"1,00","porte":"01","ente_federativo_responsavel":""},"empresa_candidates":[],"estabelecimento":{"cnpj_basico":"11111111","cnpj_ordem":"0001","cnpj_dv":"01","identificador_matriz_filial":"1","nome_fantasia":"Pão Quente Revisado","situacao_cadastral":"04","data_situacao_cadastral":"20260815","motivo_situacao_cadastral":"00","nome_cidade_exterior":"","pais":"","data_inicio_atividade":"20200101","cnae_fiscal_principal":"1091102","cnae_fiscal_secundaria":"4721102,6201501","tipo_logradouro":"RUA","logradouro":"SINTÉTICA","numero":"1","complemento":"","bairro":"","cep":"00000000","uf":"SP","municipio":"0001","ddd_1":"","telefone_1":"","ddd_2":"","telefone_2":"","ddd_fax":"","fax":"","correio_eletronico":"","situacao_especial":"","data_situacao_especial":""},"socios":[{"cnpj_basico":"11111111","identificador_socio":"2","nome_socio":"SÓCIA SINTÉTICA","cnpj_cpf_socio":"***000000**","qualificacao_socio":"49","data_entrada_sociedade":"20200101","pais":"","representante_legal":"","nome_representante":"","qualificacao_representante_legal":"00","faixa_etaria":"1","descriptions":{"pais":null,"qualificacao_socio":"Sócia","qualificacao_representante_legal":"Não informado"}}],"simples":null,"simples_candidates":[],"descriptions":{"municipio":"SAO PAULO SINTETICA","pais":null,"motivo_situacao_cadastral":"Sem motivo","cnae_fiscal_principal":"Atividade 1091102","cnae_fiscal_secundaria":{"4721102":"Atividade 4721102","6201501":"Atividade 6201501"},"natureza_juridica":"Natureza fictícia","qualificacao_responsavel":"Sócia"},"issues":["simples_missing"],"supplement":{"municipio":{"receita_code":"0001","uf":"SP","ibge_code":null,"status":"unavailable"}}}
```

#### City code mapping

`supplement.municipio` maps the Receita (SIAFI) 4-digit code to the IBGE 7-digit code with the Tesouro Nacional SIAFI table, by code and state only (never by name). `status`: `mapped` (with `ibge_code`), `missing` (no city code), `foreign` (state `EX` or code `9707`), `unknown_code` (not in the table), `no_ibge_code`, `conflict` (state differs, or the IBGE prefix contradicts the state; `candidates` lists the table rows), `multiple_candidates` (several IBGE codes; all listed, none picked), `unavailable` (mapping not loaded or not readable — not "no mapping"). `dataset` gives the mapping release, its acquisition time and the official file's last modification.

### Establishment search

`GET /api/cnpj/v1/establishments`

One item per complete CNPJ (head offices and branches are separate items), in CNPJ order unless `sort` says otherwise.

| Parameter | Rule |
| --- | --- |
| `name` | subject and establishment names; case and accents ignored; a continuous fragment of one name (no typo guessing, never across two names); at most 200 characters and no control characters (tabs and line breaks count as spaces), else 400 `INVALID_QUERY` |
| `uf` | state, two letters (`EX` abroad) |
| `city` | Receita city code, 4 digits (not IBGE) |
| `cnae` | 7-digit activity code (`-./` allowed); primary or secondary, `cnae_match` says which |
| `cnae_scope` | only `primary`, with `cnae`: primary activity only |
| `status` | registration status code, 2 digits; no status is hidden by default |
| `opened_from` / `opened_to` | opening date range `YYYY-MM-DD` (a real date with a year of at least 1000, else 400 `INVALID_QUERY`), both ends included; missing or impossible registered dates never match |
| `cep` | complete CEP, 8 digits (`NNNNN-NNN` allowed), exact match only |
| `establishment_type` | `head_office` or `branch`, the official flag `1` / `2` only |
| `phone` | `1` or `true`: at least one complete phone (`ddd_1`+`telefone_1` or `ddd_2`+`telefone_2`, fax excluded) |
| `phone_max_companies` | integer ≥ 1: at least one complete phone shared by at most this many active subjects nationwide; implies `phone` |
| `size` | subject size, one or more of `01` micro, `03` small, `05` other, `00` not filled, comma separated |
| `legal_nature` | subject legal nature, 4-digit codes, comma separated |
| `capital_min` / `capital_max` | subject share capital in reais (`1000.50`), both ends included, `0` is a value |
| `simples` / `mei` | `yes` (recorded S), `no` (recorded N) or `unknown` (no record, conflicting records, or an unreadable flag); separate, never inferred from each other |
| `email` | `1` or `true`: a registered e-mail of basic shape (`x@y.z`); not a verified mailbox |
| `debt` | PGFN federal debt of the establishment's base number in the current quarter: `any` (any debt record, including instalments, guarantees and court suspensions) or `in_collection` (at least one debt whose `tipo_situacao_inscricao` is `"Em cobrança"`) |
| `sanctions` | one or more of `ceis`, `cnep`, `cepim`, `forced_labor`, comma separated: the establishment's base number is on at least one of these lists in its current release (being on the list, whatever the sanction dates say). `forced_labor` is the Ministry of Labour's main forced-labour employer register (dataset `mte_trabalho_escravo`); CEAC (employers under a conduct adjustment agreement) and leniency agreements are not sanctions and are not conditions |
| `member_name` | member name: the subject has a current member whose one name holds every word (see "Member condition" below); every establishment of a matching subject is listed |
| `sort` | only `opened`: opening date (`data_inicio_atividade`), newest first (see "Opening-date order" below); without it, CNPJ order |

At least one of `name`, `uf`, `city`, `cnae`, `status`, `opened_from`, `opened_to`, `cep`, `establishment_type`, `member_name` is required: the other conditions (and `sort`) match most of the country and never stand alone. Conditions combine with AND. Results state missing or conflicting subjects instead of inventing a name (`empresa.status`: `ok`, `missing`, `conflict` with `candidates`). The `query` echo keeps the internal names and values: `municipio`, `situacao`, `cnae_tipo: "principal"`, `inicio_de`, `inicio_ate`, `matriz_filial: "matriz"` / `"filial"`, `telefone`, `telefone_max_empresas`, `porte`, `natureza_juridica`, `simples` / `mei` `"sim"` / `"nao"` / `"desconhecido"`, `debt: "em_cobranca"`, `sanctions` `"trabalho_escravo"`, `socio` and `sort: "inicio"`.

Fields added to each item by the conditions used: `cnae_match` (`cnae`), `data_inicio_atividade` and `cep` (date or CEP conditions), `telefones` (phone conditions: each complete phone, the official fields holding it and `empresas`, its share count), `porte`, `natureza_juridica`, `capital_social`, `simples` / `mei` (`{valor, motivo}`, `motivo` is `sem_registro`, `conflito` or `valor_invalido` when unknown) and `correio_eletronico`; with `sanctions`, `sanctions_match` lists the selected lists the item's base is on; with `sort`, `data_inicio_atividade`; with `member_name`, `socio_match` lists the matching current members of the item's subject (`nome_socio` as published and the `qualificacao_socio` code; member numbers are never returned).

**Opening-date order** (`sort=opened`). The whole match is ordered before it is paged: establishments with a usable opening date first, newest date first, and within one day the larger CNPJ first; establishments whose `data_inicio_atividade` is empty or not a real date (`data_inicio_atividade: null`) come after all of them, in CNPJ order. The cursor holds that position (date or none, plus CNPJ) and is bound to the conditions, to `sort` and to the release: a cursor of the CNPJ order used with `sort` (or the reverse) or with an altered position is 400 `INVALID_CURSOR`, any other `sort` value is 400 `INVALID_QUERY`, and a new release or rollback is 409 `RELEASE_CHANGED`. Like every search it runs under the time budget, so a rare combination can return short or `partial` pages; follow `next_cursor`. Calls without `sort` answer exactly as before (no `sort` or `socio` key in `query`, same items, same order). The order is not "newest in this archive": a company first seen this month can have an old opening date.

**Member condition** (`member_name`). The name follows the candidate rule: 1–10 whole words in any order, all required (a repeated word must repeat), accents and case ignored, at most 200 characters, no control characters, at least one word with a letter or digit; else 400 `INVALID_QUERY`. All words must be in the name of **one** member: words of two members never combine. Members are the subject's current entries of the official member file (`socios`, role `socio` in "Member relations"): people, legal entities (the name as written in the member file, which may differ from that company's own current name), foreign and unclassified members. A member is not the company's legal representative: the `nome_representante` of a member row never matches, and nothing is inferred about who represents or manages the company. Members who have left the subject in the release do not match. Names are not identities: the same name can belong to different people, so `member_name=maria souza` lists the subjects of every member with that name, and a match proves nothing about one person. Common names make the search slower and more likely to return `partial` pages; add region or activity conditions. A release whose member names are not checked yet answers 503 `DATA_UNAVAILABLE` to `member_name` searches only.

```json sample=search-sort-socio
{"source":{"dataset":"cnpj","release":"2026-10-6f1d1c3e9b2a","seq":2,"reference":"2026-10","coverage":"full"},"query":{"name":null,"uf":null,"municipio":null,"cnae":null,"situacao":null,"cnae_tipo":null,"inicio_de":null,"inicio_ate":null,"cep":null,"matriz_filial":null,"telefone":null,"telefone_max_empresas":null,"porte":null,"natureza_juridica":null,"capital_min":null,"capital_max":null,"simples":null,"mei":null,"email":null,"debt":null,"sanctions":null,"socio":"ALVORADA","sort":"inicio"},"count_unit":"establishment","count":1,"page_size":1,"partial":false,"next_cursor":"…","items":[{"cnpj":"94000000000101","cnpj_basico":"94000000","empresa":{"status":"ok","razao_social":"EMPRESA SINTÉTICA 94000000"},"nome_fantasia":"LOJA 94000000000101","matriz_filial":{"codigo":"1","tipo":"matriz"},"uf":"GO","municipio":{"codigo":"0010","nome":"GOIANIA SINTETICA"},"cnae_principal":{"codigo":"4711302","descricao":"Comércio sintético"},"situacao_cadastral":{"codigo":"02","data":"20200101"},"issues":["simples_missing"],"source_month":"2026-10","detail_path":"/api/cnpj/v1/establishments/94000000000101","data_inicio_atividade":"20251231","socio_match":[{"nome_socio":"Holding Alvorada S.A.","qualificacao_socio":"49"}]}]}
```

List conditions (`debt`, `sanctions`) read each list at its own published release, once per request; `list_sources` names those releases (same shape as `source` of the list endpoints). The cursor is bound to the CNPJ release and to every list release used, so a new release or a rollback of any of them is 409 `RELEASE_CHANGED`. A list the query needs that is not published is 503 `DATA_UNAVAILABLE` for that query only; searches without that condition are unaffected. Like every search they run under the time budget (see "Pages and cursors"): a rare combination can return short or `partial` pages, so follow `next_cursor`.

```json sample=search
{"source":{"dataset":"cnpj","release":"2026-09-b0f837cc6c85","seq":3,"reference":"2026-09","coverage":"full"},"query":{"name":"QUENTE REV","uf":null,"municipio":null,"cnae":null,"situacao":null,"cnae_tipo":null,"inicio_de":null,"inicio_ate":null,"cep":null,"matriz_filial":null,"telefone":null,"telefone_max_empresas":null,"porte":null,"natureza_juridica":null,"capital_min":null,"capital_max":null,"simples":null,"mei":null,"email":null,"debt":null,"sanctions":null},"count_unit":"establishment","count":1,"page_size":20,"partial":false,"next_cursor":null,"items":[{"cnpj":"11111111000101","cnpj_basico":"11111111","empresa":{"status":"ok","razao_social":"Padaria São João Ltda"},"nome_fantasia":"Pão Quente Revisado","matriz_filial":{"codigo":"1","tipo":"matriz"},"uf":"SP","municipio":{"codigo":"0001","nome":"SAO PAULO SINTETICA"},"cnae_principal":{"codigo":"1091102","descricao":"Atividade 1091102"},"situacao_cadastral":{"codigo":"04","data":"20260815"},"issues":["simples_missing"],"source_month":"2026-09","detail_path":"/api/cnpj/v1/establishments/11111111000101"}]}
```

Phone conditions; a shared phone is only a registered contact overlap (accountants and shared contacts cause most of it), never evidence of a group or owner:

```json sample=search-phone
{"source":{"dataset":"cnpj","release":"2026-02-bdab64400a18","seq":3,"reference":"2026-02","coverage":"full"},"query":{"name":null,"uf":"SP","municipio":null,"cnae":"4639701","situacao":null,"cnae_tipo":null,"inicio_de":null,"inicio_ate":null,"cep":null,"matriz_filial":null,"telefone":true,"telefone_max_empresas":1,"porte":null,"natureza_juridica":null,"capital_min":null,"capital_max":null,"simples":null,"mei":null,"email":null,"debt":null,"sanctions":null},"count_unit":"establishment","count":1,"page_size":1,"partial":false,"next_cursor":"…","items":[{"cnpj":"87100000000101","cnpj_basico":"87100000","empresa":{"status":"ok","razao_social":"EMPRESA SINTÉTICA 87100000"},"nome_fantasia":"LOJA 87100000000101","matriz_filial":{"codigo":"1","tipo":"matriz"},"uf":"SP","municipio":{"codigo":"0001","nome":"SAO PAULO SINTETICA"},"cnae_principal":{"codigo":"4639701","descricao":"Atividade 4639701"},"situacao_cadastral":{"codigo":"02","data":"20200101"},"issues":["simples_missing"],"source_month":"2026-02","detail_path":"/api/cnpj/v1/establishments/87100000000101","cnae_match":["principal"],"telefones":[{"phone":"1144445555","fields":["telefone_1"],"empresas":1}]}]}
```

Company conditions; size is not headcount or revenue, and "no tax record" is unknown, not "no":

```json sample=search-company
{"source":{"dataset":"cnpj","release":"2026-02-308aa13f1677","seq":2,"reference":"2026-02","coverage":"full"},"query":{"name":null,"uf":"MG","municipio":null,"cnae":"4711302","situacao":null,"cnae_tipo":null,"inicio_de":null,"inicio_ate":null,"cep":null,"matriz_filial":null,"telefone":null,"telefone_max_empresas":null,"porte":["01"],"natureza_juridica":null,"capital_min":null,"capital_max":null,"simples":"sim","mei":null,"email":null,"debt":null,"sanctions":null},"count_unit":"establishment","count":1,"page_size":1,"partial":false,"next_cursor":"…","items":[{"cnpj":"11000000000101","cnpj_basico":"11000000","empresa":{"status":"ok","razao_social":"EMPRESA SINTÉTICA 11000000"},"nome_fantasia":"LOJA 11000000000101","matriz_filial":{"codigo":"1","tipo":"matriz"},"uf":"MG","municipio":{"codigo":"0003","nome":"BELO HORIZONTE SINTETICO"},"cnae_principal":{"codigo":"4711302","descricao":"Comércio sintético"},"situacao_cadastral":{"codigo":"02","data":"20200101"},"issues":[],"source_month":"2026-02","detail_path":"/api/cnpj/v1/establishments/11000000000101","cnae_match":["principal"],"porte":"01","simples":{"valor":"sim","motivo":null}}]}
```

List conditions; a debt or sanction match is by base number (the head office's debt makes every branch match), and being listed is not by itself an irregularity:

```json sample=search-lists
{"source":{"dataset":"cnpj","release":"2026-09-2ce13719f437","seq":2,"reference":"2026-09","coverage":"full"},"list_sources":{"pgfn":{"dataset":"pgfn","release":"2026_trimestre_02-41ddc8c97994","seq":1,"reference":"2026-Q2","publisher":"Procuradoria-Geral da Fazenda Nacional (PGFN)"},"ceis":{"dataset":"ceis","release":"2026-11-18-08e2389dd2c5","seq":2,"reference":"2026-11-18","publisher":"Controladoria-Geral da União (CGU)"},"cnep":{"dataset":"cnep","release":"2026-11-19-d904cbb88db4","seq":1,"reference":"2026-11-19","publisher":"Controladoria-Geral da União (CGU)"},"trabalho_escravo":{"dataset":"mte_trabalho_escravo","release":"2026-11-20-888dd8ed3bd9","seq":2,"reference":"2026-11-20","publisher":"Ministério do Trabalho e Emprego (MTE)"}},"query":{"name":null,"uf":"SP","municipio":null,"cnae":null,"situacao":null,"cnae_tipo":null,"inicio_de":null,"inicio_ate":null,"cep":null,"matriz_filial":null,"telefone":null,"telefone_max_empresas":null,"porte":null,"natureza_juridica":null,"capital_min":null,"capital_max":null,"simples":null,"mei":null,"email":null,"debt":"em_cobranca","sanctions":["ceis","cnep","trabalho_escravo"]},"count_unit":"establishment","count":1,"page_size":1,"partial":false,"next_cursor":"…","items":[{"cnpj":"11111111000101","cnpj_basico":"11111111","empresa":{"status":"ok","razao_social":"Padaria São João Ltda"},"nome_fantasia":"Pão Quente Novo","matriz_filial":{"codigo":"1","tipo":"matriz"},"uf":"SP","municipio":{"codigo":"0001","nome":"SAO PAULO SINTETICA"},"cnae_principal":{"codigo":"1091102","descricao":"Atividade 1091102"},"situacao_cadastral":{"codigo":"04","data":"20260815"},"issues":["simples_missing"],"source_month":"2026-09","detail_path":"/api/cnpj/v1/establishments/11111111000101","sanctions_match":["ceis","cnep","trabalho_escravo"]}]}
```

Share counts: a phone's `empresas` is the number of distinct base numbers with an active (`situacao` `02`) establishment registering it in this release; branches of one subject count once.

### Change history

`GET /api/cnpj/v1/establishments/{cnpj}/history`

First observation, field changes, release gaps and reappearances, oldest first. Without `checkpoint` it returns the whole published history; with a saved `checkpoint` only newer events.

| Parameter | Rule |
| --- | --- |
| `checkpoint` | optional, a `checkpoint` from an earlier response, unchanged |
| `page_size`, `cursor` | as everywhere |

- `event_id` is `<release>:<cnpj>`: one event per number per release, stable across retries, pages and later releases.
- `type`: `first_seen` (first observation, not registration), `changed`, `missing` (absent from a release; not deregistration), `reappeared`.
- `changes` lists field changes `{"kind":"field","path":[…],"before":…,"after":…}` and member row count changes `{"kind":"member_row","row":{…},"count_before":n,"count_after":m}`. `detected_at` is when the service observed the release, not when the change happened; `event_date` appears only when a status and its official date changed together.
- `coverage.unobserved_months` lists months without any release (the source has gaps).
- Checkpoints: save the `checkpoint` of each page; it acknowledges events up to that page only, and the last page's (`complete: true`) up to the release. Reading again with it returns only newer events (`complete: true` with no events means "no new events"). A checkpoint newer than the published release (the operator rolled back) is 409 `CHECKPOINT_RESTART_REQUIRED` with `reason: "checkpoint_ahead"`; one whose release was withdrawn is `release_withdrawn`; one whose last acknowledged event is no longer published is `event_withdrawn`. These are never reported as "no change".

```json sample=history
{"source":{"dataset":"cnpj","release":"2026-09-b0f837cc6c85","seq":3,"reference":"2026-09","coverage":"full"},"cnpj":"11111111000101","query":{"checkpoint":null},"present_in_release":true,"missing_since_month":null,"total_events":3,"page_size":2,"count":2,"complete":false,"next_cursor":"…","checkpoint":"…","coverage":{"from_month":"2026-08","to_month":"2026-09","unobserved_months":[]},"events":[{"event_id":"2026-08-c9214541585b:11111111000101","seq":1,"batch":"2026-08-c9214541585b","source_month":"2026-08","detected_at":"2026-11-01T21:00:00-03:00","type":"first_seen"}]}
```

### Establishments of a subject

`GET /api/cnpj/v1/companies/{number}/establishments`

`number` is a complete CNPJ or a base number. Lists the subject's establishments present in the release with `total`, and `matriz`: the numbers flagged as head office (`listed` with one or more numbers, or `not_listed`); a head office is never inferred from the order number `0001`.

```json sample=company
{"source":{"dataset":"cnpj","release":"2026-09-b0f837cc6c85","seq":3,"reference":"2026-09","coverage":"full"},"query":{"input":"22222222000202","cnpj_basico":"22222222"},"scope":"same_base_number","count_unit":"establishment","total":1,"matriz":{"status":"not_listed","cnpjs":[]},"count":1,"page_size":20,"next_cursor":null,"items":[{"cnpj":"22222222000202","cnpj_basico":"22222222","empresa":{"status":"ok","razao_social":"Oficina do José"},"nome_fantasia":"Oficina Filial","matriz_filial":{"codigo":"2","tipo":"filial"},"uf":"MG","municipio":{"codigo":"0003","nome":"BELO SINTETICO"},"cnae_principal":{"codigo":"4520001","descricao":"Atividade 4520001"},"situacao_cadastral":{"codigo":"03","data":"20200101"},"issues":["simples_missing"],"source_month":"2026-09","detail_path":"/api/cnpj/v1/establishments/22222222000202"}]}
```

### All lists of one company

`GET /api/cnpj/v1/companies/{number}/lists` (`number`: complete CNPJ or 8-character base)

The government lists of one company number in one answer: `ceis`, `cnep`, `cepim`, `leniencia`, `cnes`, `anvisa_afe` (Anvisa operating authorisations), `anvisa_produtos_saude` (Anvisa medical device registrations held by the company), `anvisa_cbpf` (Anvisa good-practice certificate petitions, as applicant or inspected company), `anvisa_irregulares` (Anvisa enforcement measures on irregular products, as registration holder or investigated company), `anp_revendedores` (ANP active retail fuel stations), `anp_multas` (ANP fines, one record per yearly file), `pgfn`, `regimes` (annual tax regimes), `cvm`, `trabalho_escravo` (the MTE forced-labour employer register), `ceac` (MTE employers under a conduct adjustment agreement) and `compras` (awarded procurement results of the federal platform Compras.gov.br), in that order under `lists`. The CNPJ registry record itself is not included (use the establishment detail). Each section keeps its list's own matching rule (base number for the CGU lists, Anvisa AFE, Anvisa devices, ANP stations and fines, PGFN, CVM, both MTE registers and procurement results; own or maintainer CNPJ for CNES; applicant or inspected company for Anvisa certificates; registration holder or investigated company for Anvisa irregular products; exact complete number for tax regimes). `trabalho_escravo` and `ceac` come from one dataset release (`mte_trabalho_escravo`), so when it is not loaded exactly those two sections are `unavailable`.

- `status: "available"`: `source` (that list's release), `count_unit`, `total` (every record the list's own endpoint would return for this input, counted at the same release), `items` (at most `preview_size` = 5, with exactly the fields of the list's own endpoint), `more` (`total` > items shown), `interpretation` and `detail_path`: the list's own endpoint at `page_size=100`; follow its `next_cursor` for the rest. PGFN's, the Anvisa and the ANP sections also carry their `notes`; `anp_multas` keeps `source.files` (each yearly file and its report title); `anvisa_irregulares` also carries `by_role` (`registrant`, `investigated_company`: rows matched in each role, a row can count in both), because a registration holder may be the company recalling its own product or a brand whose product was counterfeited, not the offender; the `compras` section carries `coverage` (federal platform only, not all government procurement).
- `status: "unavailable"` with `error` (`code`, `message`): that list is not loaded or cannot be read now. Only that section is affected; the answer is still 200, and `unavailable` names the sections in this state. Never read it as "no record".
- `status: "not_applicable"`: tax regimes with a base number (they are recorded per complete CNPJ).

```json sample=lists
{"query":{"cnpj":"11111111000101","cnpj_basico":"11111111"},"preview_size":5,"unavailable":[],"lists":{"ceis":{"dataset":"ceis","status":"available","source":{"dataset":"ceis","release":"2026-11-18-fb0cc9ea247c","seq":2,"reference":"2026-11-18","publisher":"Controladoria-Geral da União (CGU)"},"count_unit":"sanction","total":2,"more":false,"detail_path":"/api/sanctions/v1/ceis?cnpj=11111111000101&page_size=100","interpretation":"listed_records","items":[]},"cnep":{"dataset":"cnep","status":"available","source":{"dataset":"cnep","release":"2026-11-19-191e510ac0e7","seq":1,"reference":"2026-11-19","publisher":"Controladoria-Geral da União (CGU)"},"count_unit":"sanction","total":1,"more":false,"detail_path":"/api/sanctions/v1/cnep?cnpj=11111111000101&page_size=100","interpretation":"listed_records","items":[]},"cepim":{"dataset":"cepim","status":"available","source":{"dataset":"cepim","release":"2026-11-18-7269bf1b62b7","seq":1,"reference":"2026-11-18","publisher":"Controladoria-Geral da União (CGU)"},"count_unit":"agreement","total":1,"more":false,"detail_path":"/api/sanctions/v1/cepim?cnpj=11111111000101&page_size=100","interpretation":"listed_records","items":[{"numero_convenio":"700001","cnpj_entidade":"11111111000101","nome_entidade":"ASSOCIAÇÃO SINTÉTICA","orgao_concedente":"Ministério Sintético","motivo_do_impedimento":"INSTAURACAO DE TOMADA DE CONTAS ESPECIAL","match":"exact_cnpj"}]},"leniencia":{"dataset":"leniencia","status":"available","source":{"dataset":"leniencia","release":"2026-11-19-5d354fec0646","seq":1,"reference":"2026-11-19","publisher":"Controladoria-Geral da União (CGU)"},"count_unit":"agreement_party","total":1,"more":false,"detail_path":"/api/sanctions/v1/leniency-agreements?cnpj=11111111000101&page_size=100","interpretation":"listed_records","items":[]},"cnes":{"dataset":"cnes","status":"available","source":{"dataset":"cnes","release":"2026-11-19-9fdc332f2663","seq":1,"reference":"2026-11-19","publisher":"Ministério da Saúde (DATASUS)"},"count_unit":"facility","total":3,"more":false,"detail_path":"/api/health/v1/cnes?cnpj=11111111000101&page_size=100","interpretation":"listed_records","items":[]},"anvisa_afe":{"dataset":"anvisa_afe","status":"available","source":{"dataset":"anvisa_afe","release":"2026-11-20-96d7c99e01f1","seq":1,"reference":"2026-11-20","publisher":"Agência Nacional de Vigilância Sanitária (Anvisa)"},"count_unit":"authorization","total":2,"more":false,"detail_path":"/api/health/v1/afe?cnpj=11111111000101&page_size=100","interpretation":"listed_records","notes":["Only federal operating authorisations (AFE/AE) of domestic companies, …"],"items":[]},"anvisa_produtos_saude":{"dataset":"anvisa_produtos_saude","status":"available","source":{"dataset":"anvisa_produtos_saude","release":"2026-11-20-bcb80095b6bc","seq":1,"reference":"2026-11-20","publisher":"Agência Nacional de Vigilância Sanitária (Anvisa)"},"count_unit":"device_registration","total":3,"more":false,"detail_path":"/api/health/v1/health-products?cnpj=11111111000101&page_size=100","interpretation":"listed_records","notes":["Medical device registrations as Anvisa publishes them (one l …"],"items":[]},"anvisa_cbpf":{"dataset":"anvisa_cbpf","status":"available","source":{"dataset":"anvisa_cbpf","release":"2026-11-20-6448d03389b4","seq":1,"reference":"2026-11-20","publisher":"Agência Nacional de Vigilância Sanitária (Anvisa)","file_dates":{"cbpf":"2026-11-20","cbpf_medicamento":"2026-05-18","cbpf_detalhe":"2026-05-15","cbpf_medicamento_detalhe":"2026-05-15"}},"count_unit":"certificate_petition","total":3,"more":false,"detail_path":"/api/health/v1/cbpf?cnpj=11111111000101&page_size=100","interpretation":"listed_records","notes":["Certificate petitions as Anvisa publishes them: status is th …"],"items":[]},"anvisa_irregulares":{"dataset":"anvisa_irregulares","status":"available","source":{"dataset":"anvisa_irregulares","release":"2026-11-20-007e97d03aa2","seq":1,"reference":"2026-11-20","publisher":"Agência Nacional de Vigilância Sanitária (Anvisa)"},"count_unit":"measure_line","total":3,"more":false,"detail_path":"/api/health/v1/irregular-products?cnpj=11111111000101&page_size=100","interpretation":"listed_records","by_role":{"registrant":2,"investigated_company":2},"notes":["role registrant = NU_CNPJ, the registration holder Anvisa na …"],"items":[]},"anp_revendedores":{"dataset":"anp_revendedores","status":"available","source":{"dataset":"anp_revendedores","release":"2026-11-19-21e2c7cd3e0b","seq":1,"reference":"2026-11-19","publisher":"Agência Nacional do Petróleo, Gás Natural e Biocombustíveis (ANP)"},"count_unit":"station","total":2,"more":false,"detail_path":"/api/anp/v1/resellers?cnpj=11111111000101&page_size=100","interpretation":"listed_records","notes":["The ANP file lists active retail fuel stations only; a CNPJ  …"],"items":[]},"anp_multas":{"dataset":"anp_multas","status":"available","source":{"dataset":"anp_multas","release":"2026-08-24-a41e012b2395","seq":1,"reference":"2026-08-24","publisher":"Agência Nacional do Petróleo, Gás Natural e Biocombustíveis (ANP)","files":[{"arquivo":"2016a2019","file":"multas-aplicadas-2016a2019.csv","title":"ANP - Agência Nacional do Petroleo, Gás Natural e Biocombustíveis | Data: 06/02/2020 | SICOM | Financeiro (GRM)"}]},"count_unit":"fine_record","total":6,"more":true,"detail_path":"/api/anp/v1/fines?cnpj=11111111000101&page_size=100","interpretation":"listed_records","notes":["One item per record of one yearly ANP file (`arquivo`); a fi …"],"items":[]},"pgfn":{"dataset":"pgfn","status":"available","source":{"dataset":"pgfn","release":"2026_trimestre_02-5c70cb4fba64","seq":1,"reference":"2026-Q2","publisher":"Procuradoria-Geral da Fazenda Nacional (PGFN)"},"count_unit":"company_debtor_row","total":3,"more":false,"detail_path":"/api/pgfn/v1/pgfn?cnpj=11111111000101&page_size=100","interpretation":"listed_records","notes":["Being listed is not by itself an irregularity: …"],"items":[]},"regimes":{"dataset":"regimes","status":"available","source":{"dataset":"regimes","release":"20261105-bbbbbbbbbbbb","seq":1,"acquired_at":"2026-11-05T00:00:00+00:00","publisher":"Receita Federal","files":[{"name":"Lucro Presumido.zip","label":"lucro_presumido","published_last_modified":null,"sha256":"0000000000000000000000000000000000000000000000000000000000000000"}]},"count_unit":"regime_record","total":2,"more":false,"detail_path":"/api/cnpj/v1/establishments/11111111000101/tax-regimes","interpretation":"public_records_for_listed_years_only","items":[]},"cvm":{"dataset":"cvm_cia_aberta","status":"available","source":{"dataset":"cvm_cia_aberta","release":"2026-11-19-9f9f2437d75b","seq":1,"reference":"2026-11-19","publisher":"Comissão de Valores Mobiliários (CVM)"},"count_unit":"company_market_row","total":3,"more":false,"detail_path":"/api/cvm/v1/listed-companies?cnpj=11111111000101&page_size=100","interpretation":"listed_records","items":[]},"trabalho_escravo":{"dataset":"mte_trabalho_escravo","status":"available","source":{"dataset":"mte_trabalho_escravo","release":"2026-11-20-888dd8ed3bd9","seq":2,"reference":"2026-11-20","publisher":"Ministério do Trabalho e Emprego (MTE)"},"count_unit":"employer_row","total":2,"more":false,"detail_path":"/api/mte/v1/forced-labor-employers?cnpj=11111111000101&page_size=100","interpretation":"listed_records","items":[{"row_key":"091580eb4e7dcca3bfc8b59a6f4b2382374457e02b33e3d7aa3eafb7e60969ab","ano_da_acao_fiscal":"2024","uf":"SP","empregador":"PADARIA SÃO JOÃO LTDA","cnpj_cpf":"11.111.111/0001-01","estabelecimento":"FAZENDA SINTÉTICA – ZONA RURAL, SÃO PAULO/SP","trabalhadores_envolvidos":"3","cnae":"0151-2/01","decisao_administrativa_de_procedencia":"15/05/2025","inclusao_no_cadastro_de_empregadores":"06/10/2025","match":"exact_cnpj"}]},"ceac":{"dataset":"mte_trabalho_escravo","status":"available","source":{"dataset":"mte_trabalho_escravo","release":"2026-11-20-888dd8ed3bd9","seq":2,"reference":"2026-11-20","publisher":"Ministério do Trabalho e Emprego (MTE)"},"count_unit":"employer_row","total":0,"more":false,"detail_path":"/api/mte/v1/ceac?cnpj=11111111000101&page_size=100","interpretation":"no_listed_record_is_not_a_clearance","items":[]},"compras":{"dataset":"compras","status":"available","source":{"dataset":"compras","release":"2025-11-04_2025-11-04-82a0e50688ad","seq":2,"reference":"2025-11-04/2025-11-04","publisher":"Ministério da Gestão e da Inovação em Serviços Públicos (Compras.gov.br)"},"count_unit":"procurement_result","total":6,"more":false,"detail_path":"/api/procurement/v1/awards?cnpj=11111111000101&page_size=100","interpretation":"listed_records","coverage":{"scope":"federal_platform_only","platforms":["Compras.gov.br"],"note":"Only purchases run on the federal platform Compras.gov.br (Law 14.133) are included: about a quarter of the electronic bidding processes published in PNCP (1,543 of 6,773 on 2026-11-02 to 2026-11-06). This is not all government procurement, and absence here does not mean a company had no public contract.","published_ranges":["2024-05-01/2025-11-04","2025-11-04/2025-11-04"]},"items":[{"id_contratacao_pncp":"00038166000105-1-000001/2025","numero_item_pncp":1,"sequencial_resultado":1,"id_compra":"92513407000012025","id_compra_item":"9251340700001202500001","unidade_orgao_codigo_unidade":"925134","unidade_orgao_uf_sigla":"RS","orgao_entidade_cnpj":"00038166000105","ni_fornecedor":"11111111000101","tipo_pessoa":"PJ","nome_razao_social_fornecedor":"PADARIA SINTÉTICA LTDA","uf_fornecedor":null,"codigo_pais":"BRA","porte_fornecedor_nome":"ME","natureza_juridica_nome":"Sociedade Empresária Limitada","ordem_classificacao_srp":1,"quantidade_homologada":10,"valor_unitario_homologado":1.25,"valor_total_homologado":12.5,"percentual_desconto":0,"situacao_compra_item_resultado_id":1,"situacao_compra_item_resultado_nome":"Informado","motivo_cancelamento":null,"data_resultado_pncp":"2025-11-03T00:00:00","data_inclusao_pncp":"2025-11-03T10:00:00","data_atualizacao_pncp":"2025-11-03T10:00:00","data_cancelamento_pncp":null,"match":"exact_cnpj","item":{"material_ou_servico":"M","cod_item_catalogo":621836,"descricao_resumida":"Ponteira Laboratório material: plástico","unidade_medida":"Unidade","quantidade":10,"valor_unitario_estimado":1.5,"criterio_julgamento_nome":"Menor preço","situacao_compra_item_nome":"Homologado","nome_pdm":"PONTEIRA LABORATÓRIO"}}]}}}
```

### Same phone

`GET /api/cnpj/v1/establishments/{cnpj}/same-phone`

Other establishments of the release registering one of this establishment's complete phones; `phone_match` is the evidence. Phones are compared as area code + number after removing spaces, `-`, `.`, `(`, `)`: a 2-digit area code without 0 and an 8 or 9-digit number starting 2–9 that is not one repeated digit. Placeholders and malformed values never match; 8 and 9 digits are different numbers.

```json sample=same-phone
{"source":{"dataset":"cnpj","release":"2026-02-bdab64400a18","seq":3,"reference":"2026-02","coverage":"full"},"query":{"cnpj":"40000000000101","phones":[{"phone":"1133334444","fields":["telefone_1"]}]},"scope":"registered_phone_overlap","count_unit":"establishment","count":2,"page_size":20,"partial":false,"next_cursor":null,"items":[{"cnpj":"40000000000202","cnpj_basico":"40000000","empresa":{"status":"ok","razao_social":"EMPRESA SINTÉTICA 40000000"},"nome_fantasia":"LOJA 40000000000202","matriz_filial":{"codigo":"2","tipo":"filial"},"uf":"SP","municipio":{"codigo":"0001","nome":"SAO PAULO SINTETICA"},"cnae_principal":{"codigo":"1111111","descricao":"Atividade 1111111"},"situacao_cadastral":{"codigo":"02","data":"20200101"},"issues":["simples_missing"],"source_month":"2026-02","detail_path":"/api/cnpj/v1/establishments/40000000000202","phone_match":[{"phone":"1133334444","fields":["telefone_1"]}]}]}
```

### Same address

`GET /api/cnpj/v1/establishments/{cnpj}/same-address`

Other establishments of the release registered at **the same door**: same state, same Receita city code, same street type, same street name and same door number. Parameters: `status` (a two-digit status code, or `all` for every status; default `02`, also when sent empty), `page_size`, `cursor`. A shared door is only an overlap of registered addresses: office buildings, coworking spaces and accountants' addresses put many companies at one door, so it never shows shared ownership, a group, or that anyone operates there now.

```json sample=same-address
{"source":{"dataset":"cnpj","release":"2026-02-ea6eb218e727","seq":2,"reference":"2026-02","coverage":"full"},"query":{"cnpj":"21000000000101","situacao":"02","situacao_padrao":true},"scope":"registered_address_overlap","reference":{"cnpj":"21000000000101","uf":"SP","municipio":{"codigo":"7107","nome":"SAO PAULO SINTETICO"},"endereco":{"tipo_logradouro":"RUA","logradouro":"ANTONIO PAIS","numero":"147","complemento":"SALA  4A","bairro":"CENTRO","cep":"01027020"}},"match":{"status":"comparable","reason":null,"rules_version":"same-address-2","basis":{"uf":"SP","municipio":"7107","tipo_logradouro":"RUA","logradouro":"ANTONIO PAIS","numero":"147"},"ignored":["complemento","bairro","cep"]},"count_unit":"establishment","count":1,"page_size":1,"partial":false,"next_cursor":"…","items":[{"cnpj":"21000000000202","cnpj_basico":"21000000","empresa":{"status":"ok","razao_social":"EMPRESA SINTÉTICA 21000000"},"nome_fantasia":"LOJA 21000000000202","matriz_filial":{"codigo":"2","tipo":"filial"},"uf":"SP","municipio":{"codigo":"7107","nome":"SAO PAULO SINTETICO"},"cnae_principal":{"codigo":"4781400","descricao":"Comércio sintético"},"situacao_cadastral":{"codigo":"02","data":"20200101"},"issues":["simples_missing"],"source_month":"2026-02","detail_path":"/api/cnpj/v1/establishments/21000000000202","endereco":{"tipo_logradouro":"RUA","logradouro":"ANTONIO PAIS","numero":"147","complemento":"SALA 9","bairro":"CENTRO","cep":"01027020"},"endereco_diferencas":["complemento"]}]}
```

- `query.situacao` echoes the scope used (under the internal name, `todas` for `all`) and `query.situacao_padrao` is `true` when it is the default. Any other `status` form, an unknown or repeated parameter is 400 `INVALID_QUERY`. The subject's own status does not matter.
- `reference` is the subject's registered address as written; `match.basis` holds the five compared parts after normalization, `match.ignored` the fields never compared, and `match.rules_version` the matching rules (`same-address-2`). Because a repeated street type is dropped, `basis.logradouro` can be shorter than the registered name (`RUA DO COMERCIO` under type `RUA` is compared as `DO COMERCIO`) and `basis.tipo_logradouro` can be filled when the registered type is blank.
- Results: one per complete CNPJ in CNPJ order, without the subject but with the subject's other establishments (compare `cnpj_basico`). `endereco` is each result's registered address as written; `endereco_diferencas` lists the fields whose text differs from the subject's (another room, another postal code, or just another spelling). Nothing is rewritten.
- `match.status: "comparable"` with empty `items` means the door was checked and nobody else in the scope is registered there. `not_comparable` means the subject's address cannot be compared, which is not "nobody": `reason` is `no_number` (blank, `0`, `-`, `S/N`, `SN`, `SEM NUMERO` and similar), `number_unparsed` (forms that cannot be read safely, such as `1.234`, `12-34`, `12/14`, `KM 5`), `no_street` (blank street name), `no_municipality` (state or city code missing or malformed) or `foreign_address` (state `EX`).
- A number absent from the release is 404. The cursor is bound to the number, the status scope, the release and the matching rules: after a publish, a rollback or a rebuild under other rules an old cursor is 409 `RELEASE_CHANGED`.
- When the current release has no complete, checked same-address data (for example right after a rollback to a release built before this lookup existed) the answer is 503 `SAME_ADDRESS_UNAVAILABLE`; every other endpoint keeps working. Any other failure (for example the database not answering) is 503 `DATA_UNAVAILABLE`.

| Item | Rule |
| --- | --- |
| Compared | `uf`, `municipio` (Receita city code), `tipo_logradouro`, `logradouro`, `numero`; all five must be equal |
| Never compared | `complemento` (room, floor, shop), `bairro`, `cep`, coordinates; the same postal code or neighbourhood never replaces the same street and door |
| Street type and name | accents removed, upper case, punctuation and repeated spaces become one space (`Antônio  Pais.` = `ANTONIO PAIS`, `PRAÇA` = `PRACA`) |
| Street type repeated in the name | when the name starts with the address's own street type and more words follow, that first word is dropped: the full type `RUA`, `AVENIDA`, `TRAVESSA`, `PRACA`, `ALAMEDA`, `ESTRADA`, `RODOVIA` always (`RUA` + `RUA DO COMERCIO` = `RUA` + `DO COMERCIO`, `RUA` + `RUA 48` = `RUA` + `48`), the abbreviation `R`, `AV`, `TV`, `PCA`, `ROD` only when the next word starts with two letters (`AVENIDA` + `AV BRASIL` = `AVENIDA` + `BRASIL`, but `RUA` + `R 13` ≠ `RUA` + `13`: streets such as `R-13` exist). A blank type takes the full type of that word (blank + `TV JOAO DIAS` = `TRAVESSA` + `JOAO DIAS`) |
| Not merged | different types stay different addresses (`RUA X` ≠ `AVENIDA X`, and `AVENIDA` + `RUA X` keeps `RUA X`); an abbreviated type field is not expanded (`R` ≠ `RUA`); titles are not expanded (`DR` ≠ `DOUTOR`); an ordinal type in the name stays (`10A RUA`); spelling differences are not corrected; a blank type otherwise only meets other blank types |
| Door number | leading zeros dropped (`0147` = `147`); a letter after the number is part of the door (`147` ≠ `147A`) while a space or hyphen before it is only spelling (`147A` = `147 A` = `147-A`); at most 6 digits plus 1–2 letters |
| Not comparable | blank, zero, punctuation-only and `S/N`-like doors never share an artificial door; unreadable forms are not guessed; foreign addresses and missing city codes take no part |

Basis (2026-10 release, base-number prefixes 12 and 58, 2,050,240 establishments, not a national figure): 89.4% comparable, 9.3% without a door number or with a placeholder, 1.1% with an unreadable number, 5,003 foreign, 11 without a street name. Street types are almost always whole words whose variants differ by accents only; abbreviations appear only in a few compound types and in names, and were not verified as equivalent, so they are not merged. Within those two prefixes the busiest door holds 2,202 establishments. A 1% sample of the 2026-11 release (652,055 comparable addresses) found no abbreviated street type at all, while 1.9% of the names started with their own type or its abbreviation (`RUA` + `RUA ...`, blank + `TV ...`); about half of those meet an existing door once the word is dropped, which is why `same-address-2` drops it.

### Phone lookup

`GET /api/cnpj/v1/phones/{phone}/establishments`

Every establishment of the release registering one complete phone (any status). Input: area code + number, separators allowed (URL-encoded); a country code or an incomplete number is 400 `INVALID_PHONE` (nothing is repaired). Registering a phone is not owning or using it.

```json sample=phone-lookup
{"source":{"dataset":"cnpj","release":"2026-02-bdab64400a18","seq":3,"reference":"2026-02","coverage":"full"},"query":{"telefone":"1133334444","ddd":"11","numero":"33334444"},"scope":"registered_phone","count_unit":"establishment","count":1,"page_size":1,"partial":false,"next_cursor":"…","items":[{"cnpj":"40000000000101","cnpj_basico":"40000000","empresa":{"status":"ok","razao_social":"EMPRESA SINTÉTICA 40000000"},"nome_fantasia":"LOJA 40000000000101","matriz_filial":{"codigo":"1","tipo":"matriz"},"uf":"SP","municipio":{"codigo":"0001","nome":"SAO PAULO SINTETICA"},"cnae_principal":{"codigo":"1111111","descricao":"Atividade 1111111"},"situacao_cadastral":{"codigo":"02","data":"20200101"},"issues":["simples_missing"],"source_month":"2026-02","detail_path":"/api/cnpj/v1/establishments/40000000000101","phone_match":[{"phone":"1133334444","fields":["telefone_1"]}]}]}
```

### Member relations

`GET /api/cnpj/v1/members/person?masked_cpf=***NNNNNN**&name=…` and `GET /api/cnpj/v1/members/company/{base}`

Subjects related to one member, one layer, in base-number order, with every relation's `role` (`socio`, `representante`), `active`, current `attributes` and `history` (`first_seen`, `joined`, `changed`, `left`; `official_date` is the official entry date). People are identified approximately by masked CPF plus normalized name (`identity: "approximate"`): different people can merge and one person can split. A full CPF is refused. `name` is the member's exact name (accents, case and repeated spaces ignored), not search words, so it has no word limit; like a candidate name it has at most 200 characters and no control characters (tabs and line breaks count as spaces), else 400 `INVALID_MEMBER`. `{base}` is an 8-character base number or a complete CNPJ, whose base is used (legal-entity members are recorded by base); anything else is 400 `INVALID_CNPJ`. Pages use `page_size` and `cursor`, bound to the release (409 `RELEASE_CHANGED` after a switch).

The person answer adds `procurement`: the awarded procurement results (Compras.gov.br, federal platform only) whose supplier has the same masked CPF and normalised name, counted at that dataset's current release: `status: "available"` with `source`, `count_unit` (`"procurement_result"`), `total`, `coverage` and `detail_path` (`/api/procurement/v1/awards?masked_cpf=…&name=…&page_size=100`, which lists them). The same approximate identity applies. When procurement data is not loaded or cannot be read, `procurement` is `status: "unavailable"` with `error` (`code`, `message`) and the answer is still 200; it never means the person had no award. A person who won awards but is no company member is 404 here; use the procurement endpoint directly.

```json sample=member-company
{"source":{"dataset":"cnpj","release":"2026-02-bdab64400a18","seq":3,"reference":"2026-02","coverage":"full"},"member":{"type":"company","cnpj_basico":"99887766","identity":"base_number"},"count_unit":"subject","total":6,"count":1,"page_size":1,"partial":false,"next_cursor":"…","items":[{"cnpj_basico":"10000000","establishments_path":"/api/cnpj/v1/companies/10000000/establishments","relations":[{"role":"socio","active":true,"attributes":{"rows":[{"cnpj_cpf_socio":"99887766","data_entrada_sociedade":"20200101","faixa_etaria":"0","identificador_socio":"1","nome_representante":"","nome_socio":"HOLDING SINTÉTICA","pais":"","qualificacao_representante_legal":"00","qualificacao_socio":"22","representante_legal":""}]},"history":[{"seq":1,"batch":"2026-01-e148d47041b7","source_month":"2026-01","detected_at":"2026-11-01T21:00:00-03:00","type":"first_seen","attributes":{"rows":[{"cnpj_cpf_socio":"99887766","data_entrada_sociedade":"20200101","faixa_etaria":"0","identificador_socio":"1","nome_representante":"","nome_socio":"HOLDING SINTÉTICA","pais":"","qualificacao_representante_legal":"00","qualificacao_socio":"22","representante_legal":""}]},"official_date":"2020-01-01","official_date_field":"data_entrada_sociedade"}]}]}]}
```

### Person candidates

`GET /api/cnpj/v1/members/candidates`

| Parameter | Rule |
| --- | --- |
| `name` | 1–10 whole words in any order, all required (repeated words must repeat); accents and case ignored; at most 200 characters, no control characters (tabs and line breaks count as spaces) |
| `masked_cpf` | `***NNNNNN**` (or `***.NNN.NNN-**`), exact; a full CPF is 400 `INVALID_MEMBER` |
| `relations` | `all` (default) or `current` (at least one relation active in the release; with the filters below, the matching relation itself must be active) |

Candidates are not verified people. `kind`: `person` (masked CPF; `relations_path` opens its relations), `foreign` or `unclassified` (no usable number; `evidence` lists up to 10 related subjects). Counts are subjects of the release (all of the candidate's relations, whatever the filters).

**Filters.** Optional; all combine with AND. Establishment and company conditions have the names and meaning of "Establishment search", except that `cnae` and `cep` take several values:

| Parameter | Rule |
| --- | --- |
| `uf` | state of the establishment, two letters |
| `city` | Receita city code, 4 digits; needs `uf` |
| `cnae` | 1–20 activity codes of 7 digits (`-./` allowed), comma separated: any of them, primary or secondary |
| `cnae_scope` | only `primary`, with `cnae`: primary activity only |
| `status` | registration status code, 2 digits; no status is hidden by default |
| `role` | `partner` (member) or `representative` (legal representative of a member) |
| `cep` | 1–20 complete CEPs of 8 digits (`NNNNN-NNN` allowed, not all zeros), comma separated: the establishment's CEP is one of them, exact match only; `query` echoes them as a sorted list |
| `opened_from` / `opened_to`, `size`, `legal_nature`, `capital_min` / `capital_max`, `simples`, `mei`, `establishment_type`, `phone`, `email` | as in "Establishment search" |
| `debt`, `sanctions` | as in "Establishment search": the subject's base number is on the list in its current release; `list_sources` names those releases |
| `age_bracket` | member age-bracket codes `0`–`9`, comma separated; `socio` relations only (representative rows carry no age bracket) |
| `qualification` | qualification codes, 2 digits, comma separated: `qualificacao_socio` of a `socio` relation, `qualificacao_representante_legal` of a `representante` relation |
| `joined_from` / `joined_to` | `data_entrada_sociedade` range `YYYY-MM-DD`, both ends included; missing or impossible dates never match; `representante` relations carry no entry date and never match |
| `country` | Receita country codes, 3 digits, comma separated: only `foreign` candidates whose member record names one of these countries; may be used with the name alone |

`age_bracket`, `qualification`, `joined_from` and `joined_to` (member conditions) need `uf`, `city` or `cnae`. Invalid values, `city` without `uf`, `cnae_scope` without `cnae`, more than 20 codes or CEPs and member conditions without a region or activity are 400 `INVALID_QUERY`, and the message names the parameter.

**One relation, one establishment.** A candidate is listed when **one** of its relations to a subject satisfies `role`, `relations` and every member condition, and that subject has **one** establishment in the release that satisfies every establishment and company condition (list conditions test that subject's base number). Two relations, or two establishments, never complete each other: a person who is a member of a company in São Paulo and of another company with the activity asked for is not a match for "São Paulo and that activity". Member conditions read the relation's latest row in the release, and all of them must hold on one member row; a relation that ended (left the subject) has no member record in the release, so member conditions never match it. Without member conditions, an ended relation still matches through the release's establishments of its subject (`relation_match` says `active: false`).

**Matched establishments.** With any establishment, company or list condition, each candidate carries `establishment_match`: its matching establishments in CNPJ order, at most 10, each once, with `cnae_match` (the requested codes it has, `{codigo, tipo}` with `tipo` `principal` or `secundaria`; empty without `cnae`), `relation_match` (the matching relations to its subject, `{role, active}`, with `qualificacao: [{codigo, nome}]` when `qualification` is given) and `detail_path`; `establishment_match_complete` is `false` when there are more. With `country` each candidate carries `pais: {codigo, nome}`. Country and qualification names are the Receita tables of the release (`null` when the release has no name for the code). `role`, `country` or member conditions without an establishment condition add no `establishment_match`.

**Query path.** Without filters, or with conditions that match a large part of the country, candidates are found by name first and each is checked. With `city`, `cnae` or `cep`, when at most 20,000 establishments match the establishment conditions, the candidates are found from those establishments instead, so a common name with a narrow condition (`name=silva&uf=SP&city=7107&cnae=2740601`) answers quickly. Choosing this path is a pre-check that runs before the page's time budget: counting the matching establishments (at most 1 second) and then collecting their members (at most 3 seconds), so a query with `city`, `cnae` or `cep` can spend up to about 4 seconds there; when the count is over the limit or either step runs out of time, the name-first path is used. Both paths give the same items in the same order with the same cursor; like every list they run under the time budget, so broad conditions can return short or empty `partial` pages: follow `next_cursor`.

`query` echoes only the filters that were given, under the internal names and values (`municipio`, `situacao`, `cnae_tipo`, `role: "socio"` / `"representante"`, `faixa_etaria`, `qualificacao`, `entrada_de`, `entrada_ate`, `pais`, and the search's internal names for the shared conditions); without filters the answer, the query echo and the cursors are exactly those of earlier versions. The cursor is bound to every filter and to the releases used (CNPJ and lists): another filter value is 400 `INVALID_CURSOR`, a new release or rollback is 409 `RELEASE_CHANGED`.

```json sample=candidates
{"source":{"dataset":"cnpj","release":"2026-06-2746960cd8f0","seq":2,"reference":"2026-06","coverage":"full"},"query":{"masked_cpf":null,"name":"MARIA SANTOS","words":["MARIA","SANTOS"],"relations":"all"},"match":{"name":"all_whole_words_any_order","masked_cpf":null,"identity":"approximate"},"count_unit":"candidate","count":2,"page_size":2,"partial":false,"next_cursor":"…","items":[{"kind":"foreign","natural_person":null,"identity":"none","masked_cpf":null,"name":"MARIA SILVA SANTOS HOLDINGS","relations":{"unit":"subject","current":1,"historical_only":0,"total":1,"roles":{"socio":{"current":1,"total":1},"representante":{"current":0,"total":0}}},"source_record":{"identificador_socio":"3","pais":"249","number":"not_applicable"},"relations_path":null,"evidence":[{"cnpj_basico":"51000000","roles":["socio"],"current":true,"establishments_path":"/api/cnpj/v1/companies/51000000/establishments"}],"evidence_complete":true}]}
```

```json sample=candidates-filters
{"source":{"dataset":"cnpj","release":"2026-06-33c318785c97","seq":2,"reference":"2026-06","coverage":"full"},"query":{"masked_cpf":null,"name":"ZHOU WEI","words":["ZHOU","WEI"],"relations":"all","uf":"SP","municipio":"7107","cnae":["2740601","4711302"],"qualificacao":["49"]},"match":{"name":"all_whole_words_any_order","masked_cpf":null,"identity":"approximate"},"count_unit":"candidate","count":1,"page_size":1,"partial":false,"next_cursor":"…","items":[{"kind":"person","natural_person":true,"identity":"approximate","masked_cpf":"***100001**","name":"ZHOU WEI","relations":{"unit":"subject","current":2,"historical_only":0,"total":2,"roles":{"socio":{"current":1,"total":1},"representante":{"current":1,"total":1}}},"relations_path":"/api/cnpj/v1/members/person?masked_cpf=***100001**&name=ZHOU+WEI","evidence":null,"evidence_complete":null,"establishment_match":[{"cnpj":"71000001000101","cnpj_basico":"71000001","uf":"SP","municipio":{"codigo":"7107","nome":"SAO PAULO SINTETICO"},"situacao_cadastral":{"codigo":"02","data":"20200101"},"cnae_match":[{"codigo":"2740601","tipo":"principal"},{"codigo":"4711302","tipo":"secundaria"}],"relation_match":[{"role":"socio","active":true,"qualificacao":[{"codigo":"49","nome":"Sócio-Administrador"}]}],"detail_path":"/api/cnpj/v1/establishments/71000001000101"}],"establishment_match_complete":true}]}
```

### Network and shortest connection

`GET /api/cnpj/v1/companies/{number}/network` expands current member relations both ways, layer by layer: `depth` (default 2, max 6), `max_nodes` (500 / 5000), `max_edges` (1000 / 10000), `time_budget_ms` (2000 / 5000), optional `release`. `status`: `complete` (the whole reachable set), `depth_limited`, `truncated` (`stop_reason`: `max_nodes`, `max_edges`, `time_budget`). Each edge carries `evidence` (`since`, `last_event`, `attributes`).

`GET /api/cnpj/v1/relations/shortest-path?from=…&to=…` finds the shortest connection by number of current relation links: `max_length` (8 / 16), `max_nodes` (50000 / 200000), `max_edges` (200000 / 500000), `time_budget_ms` (3000 / 5000). `status`: `connected` (`shortest_proven: true`), `same_subject`, `not_connected` (component exhausted), `incomplete` (a limit was reached: no conclusion, `conclusion` and `minimum_possible_length` say how far it got).

Rules for both: only relations active in one release; foreign and unclassified members are end points and never connect two subjects (`not_traversed`); paths through people use approximate identity (`uses_approximate_identity`); `release=<label>` refuses another release with 409; too many concurrent queries is 503 `GRAPH_BUSY`.

### Registry statistics

`GET /api/cnpj/v1/statistics` with optional `uf`, `city` (needs `uf`) and `cnae` (primary activity): unrounded establishment counts of one scope, computed and checked when the release was built. `references` adds the larger scopes for comparison. `all_status` counts every status; `active` and its breakdowns count status `02`: size (`subject_missing`, `subject_conflict` explicit), Simples and MEI (unknown split by reason), opening age in completed years to the release month's first day, and opening decade (`before_1960`, `1960s` … `2010s`, `2020s` for 2020 and later, a date after the reference date included, `missing_or_invalid`), which does not move from one month to the next. Every group adds up to its parent; the age buckets and the decade buckets each add up to `active`. Counting rules: `statistics.rules` (`registry-stats-2`); a release counted under other rules answers 503 `STATISTICS_UNAVAILABLE` until it is recounted.

`supplements.population` (IBGE table 6579, estimated resident population) and `supplements.economy` (IBGE table 5938, GDP at current prices, in thousands of reais) give the scope's region figure: Brazil for the nation, the state for `uf`, the city for `uf`+`city` (its IBGE code comes from the city code mapping); with `cnae` the region's figure is given, not the activity's. Each has `value` and `unit` (the official integer and unit), `year`, `coverage` (level, IBGE code, official name) and `source` (table, variable, dataset release). When a figure cannot be given, `status` is `unavailable`, `value` is `null` (never 0) and `reason` says why: `dataset_not_loaded`, `dataset_unavailable` (the loaded dataset cannot be read), `municipio_not_mapped` (`detail.mapping_status`), `no_ibge_region` (for example `EX`), `region_not_in_table`, or `value_not_published` (IBGE gives a symbol, in `detail.official_symbol`). Supplements never change or block the counts.

```json sample=statistics
{"source":{"dataset":"cnpj","release":"2026-04-39c0a60a56cc","seq":2,"reference":"2026-04","coverage":"full"},"statistics":{"rules":"registry-stats-2","reference_date":"2026-04-01","count_unit":"establishment"},"query":{"uf":"MG","municipio":"0003","cnae":"4711302"},"scope":"city_activity","region":{"uf":"MG","municipio":{"codigo":"0003","nome":"BELO HORIZONTE SINTETICO","ibge":{"receita_code":"0003","uf":"MG","ibge_code":"3106200","status":"mapped","table_name":"BELO HORIZONTE SINTETICO","name_differs_from_receita":false,"dataset":{"name":"tesouro-siafi-municipios","version":"20261119-addda8070ff8","acquired_at":"2026-11-19T19:52:28-03:00","published_last_modified":"x"}}}},"activity":{"codigo":"4711302","descricao":"Comércio sintético"},"listed":true,"counts":{"all_status":{"total":9,"matriz":8,"filial":1,"flag_other":0},"active":{"total":9,"matriz":8,"filial":1,"flag_other":0,"porte":{"00":1,"01":3,"03":1,"05":1,"other":0,"subject_missing":2,"subject_conflict":1},"simples":{"sim":3,"nao":2,"desconhecido":{"total":4,"sem_registro":2,"conflito":1,"valor_invalido":1}},"mei":{"sim":1,"nao":4,"desconhecido":{"total":4,"sem_registro":2,"conflito":1,"valor_invalido":1}},"opening_age_years":{"under_1":0,"1_to_2":0,"2_to_5":0,"5_to_10":9,"10_to_20":0,"20_or_more":0,"after_reference_date":0,"missing_or_invalid":0},"opening_decade":{"before_1960":0,"1960s":0,"1970s":0,"1980s":0,"1990s":0,"2000s":0,"2010s":0,"2020s":9,"missing_or_invalid":0}}},"references":[{"scope":"state_activity","query":{"uf":"MG","municipio":null,"cnae":"4711302"},"listed":true,"counts":{"all_status":{"total":9,"matriz":8,"filial":1,"flag_other":0},"active":{"total":9,"matriz":8,"filial":1,"flag_other":0,"porte":{"00":1,"01":3,"03":1,"05":1,"other":0,"subject_missing":2,"subject_conflict":1},"simples":{"sim":3,"nao":2,"desconhecido":{"total":4,"sem_registro":2,"conflito":1,"valor_invalido":1}},"mei":{"sim":1,"nao":4,"desconhecido":{"total":4,"sem_registro":2,"conflito":1,"valor_invalido":1}},"opening_age_years":{"under_1":0,"1_to_2":0,"2_to_5":0,"5_to_10":9,"10_to_20":0,"20_or_more":0,"after_reference_date":0,"missing_or_invalid":0},"opening_decade":{"before_1960":0,"1960s":0,"1970s":0,"1980s":0,"1990s":0,"2000s":0,"2010s":0,"2020s":9,"missing_or_invalid":0}}}}],"supplements":{"population":{"status":"available","reason":null,"source":{"publisher":"IBGE","table":"6579","variable":"9324","title":"População residente estimada","dataset":{"name":"ibge_populacao","release":"20261119-78baef2b807e","seq":1,"acquired_at":"2026-11-19T10:00:00-03:00","period_modified":"28/08/2026"}},"year":2026,"coverage":{"level":"municipio","ibge_code":"3106200","name":"Belo Horizonte (MG)"},"value":2400000,"unit":"Pessoas","detail":null},"economy":{"status":"available","reason":null,"source":{"publisher":"IBGE","table":"5938","variable":"37","title":"Produto Interno Bruto a preços correntes","dataset":{"name":"ibge_pib","release":"20261119-155765a7e69a","seq":1,"acquired_at":"2026-11-19T10:00:00-03:00","period_modified":"19/12/2025"}},"year":2023,"coverage":{"level":"municipio","ibge_code":"3106200","name":"Belo Horizonte (MG)"},"value":2400000,"unit":"Mil Reais","detail":null}}}
```

`GET /api/cnpj/v1/statistics/breakdown?by=uf|city|cnae` lists the child rows of a scope in code order; every page repeats `parent`, and all pages add up to it. `by=uf` takes only `cnae`; `by=city` takes `uf` and `cnae` (not `city`); `by=cnae` takes `uf` or `uf`+`city`. The `query` echo of both statistics endpoints keeps the internal names: `municipio` for `city`, and `by: "municipio"` for `by=city`.

```json sample=breakdown
{"source":{"dataset":"cnpj","release":"2026-04-39c0a60a56cc","seq":2,"reference":"2026-04","coverage":"full"},"statistics":{"rules":"registry-stats-2","reference_date":"2026-04-01","count_unit":"establishment"},"query":{"uf":null,"municipio":null,"cnae":"4711302","by":"uf"},"parent":{"scope":"activity","listed":true,"region":{"uf":null,"municipio":null},"activity":{"codigo":"4711302","descricao":"Comércio sintético"},"counts":{"all_status":{"total":11,"matriz":10,"filial":1,"flag_other":0},"active":{"total":10,"matriz":9,"filial":1,"flag_other":0,"porte":{"00":1,"01":4,"03":1,"05":1,"other":0,"subject_missing":2,"subject_conflict":1},"simples":{"sim":4,"nao":2,"desconhecido":{"total":4,"sem_registro":2,"conflito":1,"valor_invalido":1}},"mei":{"sim":1,"nao":5,"desconhecido":{"total":4,"sem_registro":2,"conflito":1,"valor_invalido":1}},"opening_age_years":{"under_1":0,"1_to_2":0,"2_to_5":0,"5_to_10":10,"10_to_20":0,"20_or_more":0,"after_reference_date":0,"missing_or_invalid":0},"opening_decade":{"before_1960":0,"1960s":0,"1970s":0,"1980s":0,"1990s":0,"2000s":0,"2010s":0,"2020s":10,"missing_or_invalid":0}}}},"page_size":1,"count":1,"next_cursor":"…","items":[{"key":"MG","uf":"MG","counts":{"all_status":{"total":9,"matriz":8,"filial":1,"flag_other":0},"active":{"total":9,"matriz":8,"filial":1,"flag_other":0,"porte":{"00":1,"01":3,"03":1,"05":1,"other":0,"subject_missing":2,"subject_conflict":1},"simples":{"sim":3,"nao":2,"desconhecido":{"total":4,"sem_registro":2,"conflito":1,"valor_invalido":1}},"mei":{"sim":1,"nao":4,"desconhecido":{"total":4,"sem_registro":2,"conflito":1,"valor_invalido":1}},"opening_age_years":{"under_1":0,"1_to_2":0,"2_to_5":0,"5_to_10":9,"10_to_20":0,"20_or_more":0,"after_reference_date":0,"missing_or_invalid":0},"opening_decade":{"before_1960":0,"1960s":0,"1970s":0,"1980s":0,"1990s":0,"2000s":0,"2010s":0,"2020s":9,"missing_or_invalid":0}}}}]}
```

- `by=city` without `uf` lists every city of the nation in state, then city code order; each row then has `uf` and the key `<uf>/<city code>`. With `uf` the rows keep their shape (key = city code, no `uf`).
- `sort=active` (only with `by=city`, with or without `uf` and `cnae`) orders the cities by `active` count, highest first; ties follow the state, then the city code. The cursor carries the full sort key and is bound to `sort` as well, so a ranking cursor is 400 `INVALID_CURSOR` in code order. Calls without `sort` answer exactly as before.

```json sample=ranking
{"source":{"dataset":"cnpj","release":"2026-04-39c0a60a56cc","seq":2,"reference":"2026-04","coverage":"full"},"statistics":{"rules":"registry-stats-2","reference_date":"2026-04-01","count_unit":"establishment"},"query":{"uf":null,"municipio":null,"cnae":null,"by":"municipio","sort":"active"},"parent":{"scope":"national","listed":true,"region":{"uf":null,"municipio":null},"activity":null,"counts":{"all_status":{"total":25,"matriz":22,"filial":2,"flag_other":1},"active":{"total":23,"matriz":20,"filial":2,"flag_other":1,"porte":{"00":1,"01":15,"03":1,"05":1,"other":2,"subject_missing":2,"subject_conflict":1},"simples":{"sim":4,"nao":2,"desconhecido":{"total":17,"sem_registro":15,"conflito":1,"valor_invalido":1}},"mei":{"sim":1,"nao":5,"desconhecido":{"total":17,"sem_registro":15,"conflito":1,"valor_invalido":1}},"opening_age_years":{"under_1":2,"1_to_2":2,"2_to_5":1,"5_to_10":14,"10_to_20":1,"20_or_more":1,"after_reference_date":0,"missing_or_invalid":2},"opening_decade":{"before_1960":0,"1960s":0,"1970s":0,"1980s":0,"1990s":0,"2000s":1,"2010s":1,"2020s":19,"missing_or_invalid":2}}}},"page_size":1,"count":1,"next_cursor":"…","items":[{"key":"MG/0003","uf":"MG","municipio":{"codigo":"0003","nome":"BELO HORIZONTE SINTETICO"},"counts":{"all_status":{"total":21,"matriz":18,"filial":2,"flag_other":1},"active":{"total":20,"matriz":17,"filial":2,"flag_other":1,"porte":{"00":1,"01":12,"03":1,"05":1,"other":2,"subject_missing":2,"subject_conflict":1},"simples":{"sim":3,"nao":2,"desconhecido":{"total":15,"sem_registro":13,"conflito":1,"valor_invalido":1}},"mei":{"sim":1,"nao":4,"desconhecido":{"total":15,"sem_registro":13,"conflito":1,"valor_invalido":1}},"opening_age_years":{"under_1":2,"1_to_2":2,"2_to_5":1,"5_to_10":11,"10_to_20":1,"20_or_more":1,"after_reference_date":0,"missing_or_invalid":2},"opening_decade":{"before_1960":0,"1960s":0,"1970s":0,"1980s":0,"1990s":0,"2000s":1,"2010s":1,"2020s":16,"missing_or_invalid":2}}}}]}
```

### Map

Locations are reference points of the **registered address**, matched against the IBGE CNEFE 2022 census address base; they do not prove the establishment operates there. `tier`: `precise` (one door with real coordinates), `street` (representative point of the street in the CEP), `approximate` (representative point of the CEP in the city); unlocated establishments only appear in coverage. Coordinates are SIRGAS 2000 (EPSG:4674).

- `GET /api/cnpj/v1/map/groups?bbox=west,south,east,north&zoom=0..22`: `zoom` ≤ 14 returns cells of Web Mercator level `zoom + 2`, counted over the whole cell (`count`, `tiers`, `center` as the mean position); `zoom` ≥ 15 returns points with identical coordinates in the bbox (at most 5000 per page; a full page is `partial: false` with a `next_cursor`). Cell pages have a time budget: when it runs out the page ends after the cells read so far, at least one, with `partial: true` and a `next_cursor` at the next cell (an empty cell counts, so a partial page may have no groups). More than 1024 cells, or at `zoom` ≥ 15 a bbox wider than 1024 level-16 tiles (about 20 × 20 km at the equator), is 400 `AREA_TOO_LARGE`.
- `GET /api/cnpj/v1/map/establishments?group=…|bbox=…`: the members of a group id (cell or point) or of a bbox, as search items plus `location` (`lat`, `lon`, `tier`, `reason`, `representative_points`, `spread_m`). The area has the same ceiling as point groups: a bbox wider than 1024 level-16 tiles, or a cell coarser than level 11 (groups of `zoom` ≤ 8), is 400 `AREA_TOO_LARGE`; zoom in or list a smaller box. Exactly one of `group` and `bbox`; an empty value counts as not given.
- `GET /api/cnpj/v1/map/coverage?uf&city`: establishments by tier and reason, unlocated included (`municipality_<status>` when the city code does not map).
- The search conditions `name`, `uf`, `city`, `cnae`, `cnae_scope`, `status`, `opened_from`, `opened_to`, `cep`, `establishment_type` and `tier` (comma list) apply to groups and lists; phone, company and list conditions (`debt`, `sanctions`) are 400 `INVALID_QUERY` whose message names the parameter as not supported by the map APIs (locations do not carry them). A `group` that is not a group id returned by `/map/groups` is 400 `INVALID_QUERY`, an altered cursor 400 `INVALID_CURSOR`. A group id is bound to its conditions (other conditions are 400), its release (409 `RELEASE_CHANGED`) and its location build (409 `LOCATION_CHANGED`). Before a release's locations are built the map answers 503 `LOCATION_UNAVAILABLE`.

### Address supplement and tax regimes

- `GET /api/cnpj/v1/establishments/{cnpj}/address-supplement`: the registered address next to the CEP supplement (see CEP) for its registered CEP; a supplement failure is reported inside the 200 response and never replaces the registered address.
  The answer has `source` (the CNPJ release, as in the detail), `cnpj`, `registered_address` (`tipo_logradouro`, `logradouro`, `numero`, `complemento`, `bairro`, `cep`, `uf`, `municipio` as registered, `null` when absent) and `supplement`: the CEP body (see CEP) with `status` `found`, `not_found` or `unavailable` (with `kind`), always inside a 200 answer; when the registered CEP is not a usable 8-digit CEP (missing, malformed or all zeros) brapi is not asked and `supplement` is `{"status":"no_usable_cep"}`. 404 when the CNPJ is not in the current release.

```json
{"source":{"dataset":"cnpj","release":"2026-10-6f1d1c3e9b2a","seq":2,"reference":"2026-10","coverage":"full"},"cnpj":"11111111000101","registered_address":{"tipo_logradouro":"RUA","logradouro":"DAS FLORES","numero":"100","complemento":"SALA 2","bairro":"CENTRO","cep":"01001000","uf":"SP","municipio":"7107"},"supplement":{"status":"found","cep":"01001000","freshness":"fresh","address":{"state":"SP","city":"São Paulo","neighborhood":"Sé","street":"Praça da Sé","service":"open-cep"},"location":{"latitude":-23.5503,"longitude":-46.6339,"precision":"postal_code_reference"},"location_status":"available","source":{"provider":"BrasilAPI","interface":"cep/v2","via":"brapi","acquired_at":"2026-11-22T10:15:03-03:00"}}}
```

```json
{"source":{"dataset":"cnpj","release":"2026-10-6f1d1c3e9b2a","seq":2,"reference":"2026-10","coverage":"full"},"cnpj":"22222222000202","registered_address":{"tipo_logradouro":"AVENIDA","logradouro":"CENTRAL","numero":"S/N","complemento":null,"bairro":"CENTRO","cep":null,"uf":"MG","municipio":"4123"},"supplement":{"status":"no_usable_cep"}}
```
- `GET /api/cnpj/v1/establishments/{cnpj}/tax-regimes?year=YYYY`: Receita ECF annual taxation regime records (lucro real, presumido, arbitrado, imunes e isentas) of this exact number. No record means unknown; a year says nothing about the current regime.

## CEP

`GET /api/reference/v1/cep/{cep}`

The BrasilAPI CEP v2 address of a complete CEP, fetched through brapi (a BrasilAPI-compatible proxy) on every request; this service stores nothing, so two requests may give different answers. `source` is `{"provider":"BrasilAPI","interface":"cep/v2","via":"brapi","acquired_at":…}`. `freshness` is `fresh` when brapi answered from BrasilAPI (`x-brapi-source: upstream`), `acquired_at` being the time of the request; it is `stale` when BrasilAPI failed and brapi answered from its stored copy (`x-brapi-source: d1-fallback`), `acquired_at` being when that copy was last confirmed at BrasilAPI (`x-brapi-verified-at`). 404 `CEP_NOT_FOUND` only when a source explicitly says the CEP does not exist ("não encontrado"; `supplement.source.checked_at` is the time of the request). Any other failure is 503 `SUPPLEMENT_UNAVAILABLE` with `supplement.kind`: `timeout` (no answer within the request timeout), `rate_limited` (brapi answered 429), `upstream_error` (5xx, or a 404 without an explicit "not found"), `network_error` or `invalid_response` (an unusable body, an `x-brapi-source` other than `upstream` or `d1-fallback`, or a stored copy without a valid confirmation time); it never means the CEP does not exist. Concurrent requests for the same CEP share one brapi request. Coordinates are a postal-code reference, never an establishment location.

A found CEP (200) has `status: "found"`, `cep`, `freshness`, `address` (`state`, `city`, `neighborhood`, `street`, `service`: the BrasilAPI backend that answered; `neighborhood` and `street` may be `null`), `location` (`latitude`, `longitude`, `precision: "postal_code_reference"`, or `null`), `location_status` (`available`, `absent` when the source gives no coordinates, `invalid` when they are not numbers inside Brazil) and `source`. The 404 and 503 answers carry the same body under `error.supplement`: `{"status":"not_found","cep",…,"source":{…,"checked_at"}}` or `{"status":"unavailable","cep",…,"kind",…,"source":{…}}` (no time: nothing was acquired).

```json
{"status":"found","cep":"01001000","freshness":"stale","address":{"state":"SP","city":"São Paulo","neighborhood":"Sé","street":"Praça da Sé","service":"open-cep"},"location":null,"location_status":"absent","source":{"provider":"BrasilAPI","interface":"cep/v2","via":"brapi","acquired_at":"2026-11-20T08:00:00-03:00"}}
```

```json
{"error":{"code":"SUPPLEMENT_UNAVAILABLE","message":"The address supplement is temporarily unavailable; this does not mean the CEP does not exist.","supplement":{"status":"unavailable","cep":"01001000","kind":"timeout","source":{"provider":"BrasilAPI","interface":"cep/v2","via":"brapi"}}}}
```

## Sanctions (CEIS, CNEP, CEPIM, leniency agreements)

`GET /api/sanctions/v1/ceis?cnpj=<CNPJ or base>`, `GET /api/sanctions/v1/ceis/{code}`, `GET /api/sanctions/v1/cnep?cnpj=<CNPJ or base>`, `GET /api/sanctions/v1/cnep/{code}`, `GET /api/sanctions/v1/cepim?cnpj=<CNPJ or base>` and `GET /api/sanctions/v1/leniency-agreements?cnpj=<CNPJ or base>`

Four CGU lists, each loaded from its daily open file as its own dataset (`ceis`, `cnep`, `cepim`, `leniencia`); `source.reference` is the file date. They answer only by company number: a complete CNPJ matches its own records (`match: "exact_cnpj"`) and those of other numbers of the same base (`same_base_number`, sanctions often name the head office); a base number matches all of them. Fields are the official CSV headers in snake case without accents, official misspellings kept (`abragencia_da_sancao`, `situacao_do_acordo_de_lenienica`); dates are ISO `YYYY-MM-DD` (`null` when blank or not a date). No listed record is not a clearance (`interpretation: "no_listed_record_is_not_a_clearance"`), and each list covers only itself.

- **CEIS** (Cadastro de Empresas Inidôneas e Suspensas, restrictions on contracting with the public administration): one item per sanction, `count_unit: "sanction"`. Natural persons appear only with the masked CPF `***NNNNNN**`.

```json sample=ceis
{"source":{"dataset":"ceis","release":"2026-11-18-fb0cc9ea247c","seq":2,"reference":"2026-11-18","publisher":"Controladoria-Geral da União (CGU)"},"query":{"cnpj":"11111111000101","cnpj_basico":"11111111"},"count_unit":"sanction","count":1,"page_size":1,"next_cursor":"…","interpretation":"listed_records","items":[{"codigo_da_sancao":"100","cadastro":"CEIS","tipo_de_pessoa":"J","cpf_ou_cnpj_do_sancionado":"11111111000101","nome_do_sancionado":"PADARIA SINTÉTICA LTDA","nome_informado_pelo_orgao_sancionador":"PADARIA SINTÉTICA LTDA","razao_social_cadastro_receita":"PADARIA SINTÉTICA LTDA","nome_fantasia_cadastro_receita":"","numero_do_processo":"0001","categoria_da_sancao":"Impedimento/proibição de contratar com prazo determinado","data_inicio_sancao":"2021-12-16","data_final_sancao":"2026-12-16","data_publicacao":null,"publicacao":"Sem Informação","detalhamento_do_meio_de_publicacao":"","data_do_transito_em_julgado":null,"abragencia_da_sancao":"Sem Informação","orgao_sancionador":"Órgão Sintético","uf_orgao_sancionador":"SP","esfera_orgao_sancionador":"FEDERAL","fundamentacao_legal":"LEI SINTÉTICA","data_origem_informacao":"2026-01-01","origem_informacoes":"Origem Sintética","observacoes":"","match":"exact_cnpj"}]}
```


- **CNEP** (Cadastro Nacional de Empresas Punidas, companies punished under the Clean Company Act): one item per sanction, `count_unit: "sanction"`, the CEIS fields plus `valor_da_multa` as published (decimal comma, e.g. `"15000,5"`). Natural persons appear only with the masked CPF `***NNNNNN**`.

```json sample=cnep
{"source":{"dataset":"cnep","release":"2026-11-19-191e510ac0e7","seq":1,"reference":"2026-11-19","publisher":"Controladoria-Geral da União (CGU)"},"query":{"cnpj":"11111111000101","cnpj_basico":"11111111"},"count_unit":"sanction","count":1,"page_size":1,"next_cursor":null,"interpretation":"listed_records","items":[{"codigo_da_sancao":"200","cadastro":"CNEP","tipo_de_pessoa":"J","cpf_ou_cnpj_do_sancionado":"11111111000101","nome_do_sancionado":"PADARIA SINTÉTICA LTDA","nome_informado_pelo_orgao_sancionador":"PADARIA SINTÉTICA LTDA","razao_social_cadastro_receita":"PADARIA SINTÉTICA LTDA","nome_fantasia_cadastro_receita":"","numero_do_processo":"0002","categoria_da_sancao":"Multa - Lei Anticorrupção","valor_da_multa":"15000,5","data_inicio_sancao":"2025-03-01","data_final_sancao":null,"data_publicacao":"2025-03-02","publicacao":"Diário Oficial","detalhamento_do_meio_de_publicacao":"","data_do_transito_em_julgado":null,"abragencia_da_sancao":"Nacional","orgao_sancionador":"Órgão Sintético","uf_orgao_sancionador":"DF","esfera_orgao_sancionador":"FEDERAL","fundamentacao_legal":"LEI 12.846/2013","data_origem_informacao":"2026-01-01","origem_informacoes":"Origem Sintética","observacoes":"","match":"exact_cnpj"}]}
```

- **CEPIM** (non-profit entities barred from federal voluntary transfers): one item per barred transfer agreement (`numero_convenio`, the only official identifier), `count_unit: "agreement"`.

```json sample=cepim
{"source":{"dataset":"cepim","release":"2026-11-18-7269bf1b62b7","seq":1,"reference":"2026-11-18","publisher":"Controladoria-Geral da União (CGU)"},"query":{"cnpj":"11111111000101","cnpj_basico":"11111111"},"count_unit":"agreement","count":1,"page_size":1,"next_cursor":null,"interpretation":"listed_records","items":[{"numero_convenio":"700001","cnpj_entidade":"11111111000101","nome_entidade":"ASSOCIAÇÃO SINTÉTICA","orgao_concedente":"Ministério Sintético","motivo_do_impedimento":"INSTAURACAO DE TOMADA DE CONTAS ESPECIAL","match":"exact_cnpj"}]}
```

- **Leniency agreements**: one item per row of the official agreements file, that is per (agreement, party): `id_do_acordo` repeats for each company of one agreement, `count_unit: "agreement_party"`. `cnpj_do_sancionado` is as published (foreign parties have non-CNPJ values and are never matched). `efeitos` lists every effect of that agreement (`efeito_do_acordo_de_leniencia`, `complemento`).

```json sample=leniencia
{"source":{"dataset":"leniencia","release":"2026-11-19-5d354fec0646","seq":1,"reference":"2026-11-19","publisher":"Controladoria-Geral da União (CGU)"},"query":{"cnpj":"11111111000101","cnpj_basico":"11111111"},"count_unit":"agreement_party","count":1,"page_size":1,"next_cursor":null,"interpretation":"listed_records","items":[{"id_do_acordo":"900001","cnpj_do_sancionado":"11111111000101","razao_social_cadastro_receita":"PADARIA SINTÉTICA LTDA","nome_fantasia_cadastro_receita":"","data_de_inicio_do_acordo":"2017-08-14","data_de_fim_do_acordo":"2019-12-31","situacao_do_acordo_de_lenienica":"Cumprido","data_da_informacao":"2026-01-01","numero_do_processo":"0004","termos_do_acordo":"Termos sintéticos","orgao_sancionador":"CGU","efeitos":[{"efeito_do_acordo_de_leniencia":"Isenção da publicação extraordinária","complemento":""}],"match":"exact_cnpj"}]}
```

## Health facilities (CNES)

`GET /api/health/v1/cnes?cnpj=<CNPJ or base>` and `GET /api/health/v1/cnes/{cnes}`

The Ministry of Health Cadastro Nacional de Estabelecimentos de Saúde, loaded from its daily open file (dataset `cnes`, `source.reference` is the file date). A complete CNPJ matches facilities whose own CNPJ (`nu_cnpj`) or maintainer CNPJ (`nu_cnpj_mantenedora`) is exactly that number; an 8-character base matches either column by its base (a complete CNPJ never widens to its base: chains have hundreds of facilities). `matched_by` names the column(s) that matched. `query` echoes the input: with a complete CNPJ `query.cnpj` is that number and `query.cnpj_basico` is `null` (the lookup does not widen to the base, unlike the other lists); with a base `query.cnpj` is `null` and `query.cnpj_basico` is the base. Every field is the official text as published, including codes with trailing blanks (`co_esfera_administrativa: "M "`), coordinates and `st_*` flags (`"1.0"`). Deactivated facilities stay listed: `co_motivo_desab` is the official deactivation code as published and `deactivated` is `true` when it is not blank. `interpretation` follows the shared vocabulary (see "Conventions"). `GET /api/health/v1/cnes/{cnes}` returns one facility (404 when the code is not in the current release); `co_cnes` is the code as published, without leading zeros.

```json sample=cnes
{"source":{"dataset":"cnes","release":"2026-11-19-9fdc332f2663","seq":1,"reference":"2026-11-19","publisher":"Ministério da Saúde (DATASUS)"},"query":{"cnpj":"11111111000101","cnpj_basico":null},"count_unit":"facility","count":1,"page_size":1,"next_cursor":"…","interpretation":"listed_records","items":[{"co_cnes":"1000001","co_unidade":"3550301000001","co_uf":"35","co_ibge":"355030","nu_cnpj_mantenedora":"","no_razao_social":"CLINICA SINTÉTICA","no_fantasia":"CLINICA SINTÉTICA","co_natureza_organizacao":"","ds_natureza_organizacao":"","tp_gestao":"M","co_nivel_hierarquia":"","ds_nivel_hierarquia":"","co_esfera_administrativa":"M ","ds_esfera_administrativa":"MUNICIPAL","co_atividade":"04","tp_unidade":"22","co_cep":"01001000","no_logradouro":"RUA SINTÉTICA","nu_endereco":"1","no_bairro":"CENTRO","nu_telefone":"(11) 3333–4444","nu_latitude":"-23.5","nu_longitude":"-46.6","co_turno_atendimento":"03","ds_turno_atendimento":"ATENDIMENTOS NOS TURNOS DA MANHA E A TARDE","nu_cnpj":"11111111000101","no_email":"","co_natureza_jur":"2062","st_centro_cirurgico":"0.0","st_centro_obstetrico":"0.0","st_centro_neonatal":"0.0","st_atend_hospitalar":"0.0","st_servico_apoio":"1.0","st_atend_ambulatorial":"0.0","co_motivo_desab":"","co_ambulatorial_sus":"NAO","deactivated":false,"matched_by":["nu_cnpj"]}]}
```

## Anvisa operating authorisations (AFE)

`GET /api/health/v1/afe?cnpj=<CNPJ or base>` and `GET /api/health/v1/afe/{authorization_number}`

Operating authorisations (Autorização de Funcionamento de Empresa, AFE, and the special authorisation AE for controlled substances) that the national health surveillance agency Anvisa granted to domestic companies: pharmacies, and manufacturers, distributors, importers and carriers of medicines, medical devices, cosmetics, cleaning products, food and port services. Loaded from Anvisa's daily open file `TA_CONSULTA_FUNCIONAMENTO_EMPRESA_NACIONAL.CSV` (dataset `anvisa_afe`; `source.reference` is the file date, and the file holds data up to the day before). The international companies file, the good manufacturing practice (CBPF) certificates and state or municipal sanitary licences are not included.

- **Matching**: like the CGU lists, a complete CNPJ or a base looks up the 8-character base, because pharmacy branches hold their own authorisations; `match` is `exact_cnpj` when `nu_cnpj` is the given CNPJ, else `same_base_number`. Pages follow `nu_autorizacao`.
- **Items**: one per authorisation, active and cancelled ones, with every official column as published text: `ativo` is `SIM`/`NAO` (valid now or not), `st_autorizacao_especial` is `S`/`N`, dates (`dt_autorizacao`, `dt_publicacao`, `dt_cancelamento`) keep the source's `MM/DD/YYYY HH:MM:SS` text and are not corrected (some years are malformed in the source, such as `0012`); an empty value is `""`. `representante_tecnico` (technical responsible, often a pharmacist employee) and `representante_legal` are names as published; a CPF-shaped number inside them is masked as `***NNNNNN**`. The daily load date of the source (`DT_CARGA_ETL`) is not a field.
- **`notes`** state the limits: only federal authorisations of domestic companies, and no authorisation listed does not mean that the company needs none or is irregular. `interpretation` follows the shared vocabulary (see "Conventions").
- `GET /api/health/v1/afe/{authorization_number}` returns one authorisation with `source` and `notes` (404 when the number is not in the current release, 400 when it is not a number). Not loaded: 503 `DATA_UNAVAILABLE`.

```json sample=anvisa-afe
{"source":{"dataset":"anvisa_afe","release":"2026-11-20-96d7c99e01f1","seq":1,"reference":"2026-11-20","publisher":"Agência Nacional de Vigilância Sanitária (Anvisa)"},"notes":["Only federal operating authorisations (AFE/AE) of domestic companies, as published in Anvisa open data (data up to the day before the file date); state and municipal sanitary licences are not included.","No authorisation listed does not mean that the company needs none or that it is irregular."],"query":{"cnpj":"11111111000101","cnpj_basico":"11111111"},"count_unit":"authorization","count":1,"page_size":1,"next_cursor":"…","interpretation":"listed_records","items":[{"nu_autorizacao":"1000001","nu_cnpj":"11111111000101","no_razao_social":"PADARIA SINTÉTICA LTDA","nu_autorizacao_novo":"Y3H4X0H00001","nu_processo":"25351000001000001","dt_autorizacao":"01/13/2014 00:00:00","ativo":"SIM","tipo_produto":"Farmácia - 28","co_tipo_atividades":"Comércio,Dispensação de medicamentos","st_autorizacao_especial":"N","dt_cancelamento":"","no_fantasia":"FARMÁCIA SINTÉTICA","ds_homepage":"","nu_sac":"","dt_publicacao":"01/13/2014 00:00:00","cidade":"SÃO PAULO","uf":"SP","nu_cep":"01001000","ds_endereco":"RUA SINTÉTICA, 1","bairro":"CENTRO","representante_tecnico":"FARMACÊUTICA SINTÉTICA","representante_legal":"JOSÉ SINTÉTICO ***456789**","co_municipio_ibge":"355030","atividades":"Comércio - Cosméticos; Dispensação de medicamentos - -","match":"exact_cnpj"}]}
```

## CMED medicine prices

`GET /api/health/v1/cmed?ggrem=<code>|registration=<number>|ean=<code>|cnpj=<CNPJ or base>|substance=<fragment>|product=<fragment>|laboratory=<fragment>`

Price ceilings of medicine presentations from the monthly CMED price lists (Câmara de Regulação do Mercado de Medicamentos, published by Anvisa; dataset `cmed`): the list with factory price (PF) and maximum consumer price (PMC), and the list with PF and maximum price for sales to government (PMVG). `reference_period` is the list's publication date. These are legal ceilings, not prices paid.

- **Lookup** (exactly one): `ggrem` (CMED's 15-digit presentation code), `registration` (the 13-digit Anvisa registration number as CMED lists it, exact; 9 digits match its first 9, the product registration, so every presentation of the product; other lengths are 400 `INVALID_QUERY`), `ean` (any of the presentation's EAN 1-3), `cnpj` (registration holder, complete CNPJ or base; a complete CNPJ is looked up by its base number, and each item then carries `match`: `exact_cnpj` or `same_base_number`), or a contiguous fragment (accents and case ignored, at least 3 characters) of `substance` (active ingredients), `product` (brand name) or `laboratory` (holder name). One item per presentation, in `codigo_ggrem` order (`count_unit`: `"presentation"`). The cursor is also bound to the PMPF release behind `pmpf_pr`: a new PMPF release, or PMPF withdrawn, is 409 `RELEASE_CHANGED` like a new CMED release.
- **Items**: the official presentation fields as published text (`cnpj` keeps its punctuation; EAN cells without a code are published as `"    -     "`; `comercializacao` answers whether the product was sold in `comercializacao_ano`). `precos.lista_pmc` has `pf` and `pmc`, `precos.lista_pmvg` has `pf` and `pmvg`: each a map from the official column label (`"PF 18 %"`, `"PMC 17 %  ALC"`, `"PMVG Sem Impostos"`, every ICMS rate the list publishes) to the official text (`"27,44"`: decimal comma; a trailing `*` marks a price the list flags as ICMS-exempt; `null` is a blank cell, e.g. no PMC for hospital-only presentations). No rate is chosen for the caller: the applicable one depends on the state and the buyer (see `notes`). A list that does not carry the presentation is `null`. The PF of the two lists is given separately because they differ by those marks.
- **`pmpf_pr`**: Paraná's PMPF list of medicines (state tax-base consumer price, half-yearly; dataset `pmpf_pr`; Paraná's fuel PMPF is not loaded), as a separate section: the PMPF rows whose GTIN equals one of the presentation's EAN codes (compared without leading zeros, so a GTIN-14 `0789…` matches the EAN `789…`), `[]` when none matches. It is never derived from CMED prices. `supplements.pmpf_pr` gives its `source` and `reference_period` (the list's date), or `status: "unavailable"` with every `pmpf_pr` `null` when that list is not loaded. Other states publish their own lists.
- No match is 200 with no items; CMED not loaded is 503 `DATA_UNAVAILABLE`.

```json sample=cmed
{"source":{"dataset":"cmed","release":"2026-11-09-9f4c0db39ee3","seq":1,"reference":"2026-11-09","publisher":"Câmara de Regulação do Mercado de Medicamentos (CMED) / Anvisa"},"query":{"ean":"7891106000956"},"count_unit":"presentation","count":1,"page_size":20,"next_cursor":null,"interpretation":"listed_records","items":[{"codigo_ggrem":"538912020009303","substancia":"CLOTRIMAZOL","cnpj":"11.111.111/0001-01","laboratorio":"LABORATÓRIO SINTÉTICO S.A.","registro":"1705600230032","ean_1":"7891106000956","ean_2":"    -     ","ean_3":"    -     ","produto":"BAYCUTEN N","apresentacao":"10 MG/G CREM DERM CT BG AL X 40 G","classe_terapeutica":"N2B - ANALGÉSICOS NÃO NARCÓTICOS","tipo_de_produto_status_do_produto":"Novo","regime_de_preco":"Regulado","restricao_hospitalar":"Não","cap":"Não","confaz_87":"Sim","icms_0":"Não","analise_recursal":"","lista_de_concessao_de_credito_tributario_pis_cofins":"Negativa","comercializacao_ano":2025,"comercializacao":"Sim","tarja":"Tarja Vermelha","destinacao_comercial":"","precos":{"lista_pmc":{"pf":{"PF 0%":"27,44","PF 12 %":"27,44","PF 17 %":"27,44","PF 18 %":"27,44","PF 20 %":"27,44","PF 12 %  ALC":"27,44","PF 17 %  ALC":"27,44","PF 18 %  ALC":"27,44","PF 20 %  ALC":"27,44","PF Sem Impostos":"27,44"},"pmc":{"PMC 0 %":"37,93","PMC 12 %":"37,93","PMC 17 %":"37,93","PMC 18 %":"37,93","PMC 20 %":"37,93","PMC 12 %  ALC":"37,93","PMC 17 %  ALC":"37,93","PMC 18 %  ALC":"37,93","PMC 20 %  ALC":"37,93","PMC Sem Impostos":"37,93"}},"lista_pmvg":{"pf":{"PF 0%":"27,44*","PF 12 %":"27,44*","PF 17 %":"27,44*","PF 18 %":"27,44*","PF 20 %":"27,44*","PF 12 %  ALC":"27,44*","PF 17 %  ALC":"27,44*","PF 18 %  ALC":"27,44*","PF 20 %  ALC":"27,44*","PF Sem Impostos":"27,44*"},"pmvg":{"PMVG 0 %":"37,93","PMVG 12 %":"37,93","PMVG 17 %":"37,93","PMVG 18 %":"37,93","PMVG 20 %":"37,93","PMVG 12 %  ALC":"37,93","PMVG 17 %  ALC":"37,93","PMVG 18 %  ALC":"37,93","PMVG 20 %  ALC":"37,93","PMVG Sem Impostos":"37,93"}}},"pmpf_pr":[{"gtin":"7891106000956","produto":"BAYCUTEN N","apresentacao":"10mg/g - bisnaga 40g ","multiplo":"1","pmpf":"44.80"}]}],"reference_period":"2026-11-09","notes":["CMED prices are legal ceilings (factory price PF, maximum consumer price PMC, maximum price for sales to government PMVG), not prices paid.","Every ICMS rate column is given as published; the applicable one depends on the state and the buyer. A trailing * marks a price CMED lists as ICMS-exempt.","PMPF is Paraná's tax-base price list (other states publish their own); it is matched by GTIN only and is empty when no GTIN matches."],"supplements":{"pmpf_pr":{"status":"available","source":{"dataset":"pmpf_pr","release":"2026-09-22-2ff64b6d9d81","seq":1,"reference":"2026-09-22","publisher":"Secretaria de Estado da Fazenda do Paraná (SEFA-PR)"},"reference_period":"2026-09-22"}}}
```

## Anvisa product registrations

`GET /api/health/v1/medicines?cnpj=<CNPJ or base>|registration=<number>|product=<fragment>|company=<fragment>` and `GET /api/health/v1/health-products?cnpj=<CNPJ or base>|registration=<number>|product=<fragment>|manufacturer=<fragment>|holder=<fragment>`

Product registrations from Anvisa's open data, active and inactive, every official value as published text (dates `dd/mm/yyyy`, as published).

- **Medicines** (`medicines`, dataset `anvisa_medicamentos`, file `TA_CONSULTA_MEDICAMENTOS.CSV`): registrations and notifications with the holder (`nu_cnpj_empresa`, `no_razao_social_empresa`), product, registration number, regulatory category, status (`validade_situacao`) and dates. The source has no record number and repeats the same line many times; identical lines are one item, keyed by `conteudo_sha256` (a digest of the official values). The file names the registration holder, not the manufacturer, so there is no manufacturer filter. Lookup by exactly one of `cnpj` (holder; base lookup with `match` like the other company lists), `registration` (1 to 13 digits, exact: Anvisa publishes shorter numbers for notifications), `product` or `company` (name fragments, at least 3 characters). `count_unit`: `"medicine_record"`.
- **Medical devices** (`health-products`, dataset `anvisa_produtos_saude`, file `TA_PRODUTO_SAUDE_SITE.csv`): one item per registration and manufacturer (a registration listing several manufacturers has several items), with technical and brand name, risk class (`I`-`IV`), holder, manufacturer and country, publication date and validity (`VIGENTE` or the expiry date). Lookup by exactly one of `cnpj` (holder, base lookup with `match`), `registration` (the registration number, 10 or 11 digits, exact; other shapes are 400), or a fragment of `product` (brand name), `manufacturer` or `holder` (holder name). `count_unit`: `"device_registration"`. A company's devices also appear in "All lists of one company".
- Not included: cosmetics, sanitising products, food and the device model file. No match is 200 with no items; not loaded is 503 `DATA_UNAVAILABLE`.

```json sample=medicamentos
{"source":{"dataset":"anvisa_medicamentos","release":"2026-11-20-a85d4709a71b","seq":1,"reference":"2026-11-20","publisher":"Agência Nacional de Vigilância Sanitária (Anvisa)"},"notes":["Registrations and notifications as Anvisa publishes them, active and inactive (validade_situacao); the file names the registration holder, not the manufacturer."],"query":{"cnpj":"11111111000101","cnpj_basico":"11111111"},"count_unit":"medicine_record","count":1,"page_size":1,"next_cursor":"…","interpretation":"listed_records","items":[{"conteudo_sha256":"298fb3e86ba0c496297ace379f552f8bba6efcbc210d4ec57b8a1acbd4b34d65","nu_processo":"25351042184202592","co_tipo_produto":"1","no_razao_social_empresa":"PADARIA SINTÉTICA FARMA LTDA","dt_vencimento_produto":"25/08/2035 00:00:00","vencimento_mes_ano":"082035","nu_cnpj_empresa":"11111111000101","no_produto":"dipirona sódica","vencimento":"082035","nu_registro_produto":"100000001","co_seq_produto":"3835718","st_rotulo":"","co_situacao_assunto_doc":"29","tp_grau":"","data_publicacao":"25/08/2025 00:00:00","co_seq_tipo_cat_regulatoria":"5","ds_tipo_categoria_regulatoria":"Genérico","ds_referencia":"NOVALGINA","co_seq_tipo_priorizacao":"","no_tipo_priorizacao":"","ds_produto_notificado":"","co_categoria_produto":"0706027","tipo_autorizacao":"REGISTRADO","co_seq_notificacao":"","sinonimos":"","indicacoes":"","tp_situacao_apresentacao":"DE","data_cancelamento":"","dt_inicio_analise":"","co_atc":"","co_substancia":"8431","co_tipo_cat_regulatoria":"5","co_forma_fisica":"","co_restricao":"","co_tarja":"3","co_seq_apresentacao_produto":"429897894, 429897895","st_dispensa_fracionada":"N","complemento":"","autorizacao_medicamento":"1044938","situacao_assunto":"","substancias_medicamentos":"dipirona","validade_situacao":"Inativo","numero_apresentacoes":"2","data_ultima_atualizacao":"20/11/2026 00:02:38","match":"exact_cnpj"}]}
```

```json sample=produtos-saude
{"source":{"dataset":"anvisa_produtos_saude","release":"2026-11-20-bcb80095b6bc","seq":1,"reference":"2026-11-20","publisher":"Agência Nacional de Vigilância Sanitária (Anvisa)"},"notes":["Medical device registrations as Anvisa publishes them (one line per registration and manufacturer); validade_registro_cadastro is VIGENTE or the expiry date."],"query":{"cnpj":"11111111000101","cnpj_basico":"11111111"},"count_unit":"device_registration","count":1,"page_size":1,"next_cursor":"…","interpretation":"listed_records","items":[{"numero_registro_cadastro":"10330710009","numero_processo":"2500010330710009","nome_tecnico":"Agulhas","classe_risco":"II","nome_comercial":"AGULHA PARA PUNÇÃO RENAL","cnpj_detentor_registro_cadastro":"11111111000101","detentor_registro_cadastro":"PADARIA SINTÉTICA MÉDICA LTDA","nome_fabricante":"COOK INCORPORATED","nome_pais_fabric":"ESTADOS UNIDOS DA AMÉRICA","dt_pub_registro_cadastro":"09/05/2000","validade_registro_cadastro":"VIGENTE","match":"exact_cnpj"}]}
```

## Anvisa good-practice certificates (CBPF / CBPDA)

`GET /api/health/v1/cbpf?cnpj=<CNPJ or base>`

Petitions for Anvisa's good manufacturing practice (CBPF) and good distribution and storage practice (CBPDA) certificates, from four open files loaded as one release (dataset `anvisa_cbpf`): the general certificate file `TA_CONSULTA_CBPF.CSV` (replaced daily), the medicine certificate file `TA_CONSULTA_CBPF_MEDICAMENTO.CSV`, and the two detail files `TA_CONSULTA_CBPF_DETALHE.CSV` and `TA_CONSULTA_CBPF_MEDICAMENTO_DETALHE.CSV` with the certified production lines. The detail and medicine files are updated far less often; `source.file_dates` gives each file's date (`cbpf`, `cbpf_medicamento`, `cbpf_detalhe`, `cbpf_medicamento_detalhe`; null when unknown) and `source.reference` is the general file's date.

- **Matching**: a complete CNPJ matches the applicant (`nu_cnpj_solicitante`) or the inspected company (`nu_cnpj_empresa_inspecionada`) exactly; a base matches either by its first 8 characters. Foreign inspected sites have no CNPJ (they carry `codigounico_inspecionada` and the country).
- **Items**: one per petition (`co_documento_peticao`) that matches in any of the four files, in petition order: `role` (`applicant`, `inspected_company` or both), `certificados` (the petition's lines of the certificate files, each with `tabela`: `cbpf` or `cbpf_medicamento`) and `detalhes` (every production line of the petition in the detail files, each with `tabela` and its key `conteudo_sha256`, a digest of the official values, because the detail files have no line number). A petition without detail lines has `detalhes: []`; one found only in a detail file has `certificados: []`. `count_unit`: `"certificate_petition"`.
- **Values** are the official text: `status` is `VALIDO`, `VENCIDO`, `INDEFERIDO`, `CANCELADO` or `""` exactly as published (validity is never recomputed from `dt_validade`), dates keep the source's `MM/DD/YYYY HH:MM:SS`. The source's load date (`DT_CARGA_ETL`) is not a field.
- No match is 200 with no items and `interpretation: "no_listed_record_is_not_a_clearance"`; not loaded is 503 `DATA_UNAVAILABLE`. The company's petitions also appear in "All lists of one company".

```json sample=anvisa-cbpf
{"source":{"dataset":"anvisa_cbpf","release":"2026-11-20-6448d03389b4","seq":1,"reference":"2026-11-20","publisher":"Agência Nacional de Vigilância Sanitária (Anvisa)","file_dates":{"cbpf":"2026-11-20","cbpf_medicamento":"2026-05-18","cbpf_detalhe":"2026-05-15","cbpf_medicamento_detalhe":"2026-05-15"}},"query":{"cnpj":"11111111000101","cnpj_basico":null},"count_unit":"certificate_petition","count":1,"page_size":1,"next_cursor":"…","interpretation":"listed_records","items":[{"co_documento_peticao":"1001","role":["applicant"],"certificados":[{"tabela":"cbpf","co_documento_peticao":"1001","razaosocial_solicitante":"PADARIA SINTÉTICA FARMA LTDA","nu_cnpj_solicitante":"11111111000101","razaosocial_inspecionada":"","codigounico_inspecionada":"","nu_cnpj_empresa_inspecionada":"","no_pais_inspecionada":"","no_tipo_certificado":"CBPF","assunto":"70429 - PRODUTOS PARA SAÚDE – Renovação de Certificação de Boas Práticas de FABRICAÇÃO","dt_publicacao":"12/08/2025 00:00:00","dt_validade":"12/08/2027 00:00:00","ds_tp_emissao_certificado":"","situacao":"Publicado deferimento","nu_processo":"25351062246201754","status":"VALIDO"}],"detalhes":[{"tabela":"cbpf_detalhe","conteudo_sha256":"662cc8afccd76b95fe29b5bd53bb65e75b4d2ce650a32e2ab99c2eb2b20fafbb","co_documento_peticao":"1001","empresasolicitante":"PADARIA SINTÉTICA FARMA LTDA","nu_cnpj_solicitante":"11111111000101","enderecosolicitante":"RUA SINTÉTICA, Nº 10","cidadesolicitante":"PORTO ALEGRE","ufsolicitante":"RS","razaosocial":"","codigounico_inspecionada":"","nu_cnpj_empresa_inspecionada":"","endereco":"","pais":"","co_uf_inspecionada":"","cidade_inspecionada":"","no_tipo_certificado":"CBPF","assunto":"70505 - MEDICAMENTOS - RENOVAÇÃO (Certificação de BPF)","dt_publicacao":"02/27/2023 00:00:00","dt_validade":"02/27/2025 00:00:00","nu_resolucao":"630","dt_resolucao":"02/24/2023 00:00:00","nu_dou":"39","linhacertificacao":"Líquidos não estéreis: Soluções","linhacbpf":"Líquidos não estéreis","classecertificacao":"Comum","etapasfabricacao":"Embalagem primária,Granel","formafarmaceutica":"Solução ","st_liberacao_parametrica":"N","tipopeticao":"Medicamentos sintéticos","ds_tp_emissao_certificado":"INSPEÇÃO","ds_motivo_cancelamento":"","nu_processo":"25351011808201735","status":"VALIDO"}]}],"notes":["Certificate petitions as Anvisa publishes them: status is the official text (VALIDO, VENCIDO, INDEFERIDO, CANCELADO or blank) and validity is never recomputed.","role: applicant = NU_CNPJ_SOLICITANTE, inspected_company = NU_CNPJ_EMPRESA_INSPECIONADA (foreign inspected sites have no CNPJ).","The detail and medicine files are updated less often than the certificate file: see source.file_dates."]}
```

## Anvisa irregular products

`GET /api/health/v1/irregular-products?cnpj=<CNPJ or base>|registration=<number>`

Enforcement measures Anvisa published on irregular products (prohibition, suspension, seizure, recall and others, for medicines, cosmetics, medical devices, food and sanitising products), from the daily file `TA_CONSULTA_PRODUTOS_IRREGULARES_RESULTADO.CSV` (dataset `anvisa_irregulares`; `source.reference` is the file date). One line of the source is one investigation x measure x activity x product; it has no line number, so each distinct line is one item keyed by `conteudo_sha256` (a digest of the official values).

- **Lookup**: exactly one of `cnpj` or `registration` (the product registration number, 1 to 13 digits, exact); neither, both, or a `registration` of another shape is 400 `INVALID_QUERY`.
- **By company number**: a complete CNPJ matches `nu_cnpj` or `nu_cnpj_empresa_investigada` exactly; a base matches either by its first 8 characters. Each item carries `role`: `registrant` (`nu_cnpj`, the registration holder Anvisa names: it may be the company recalling its own product, a brand whose product was counterfeited, or Anvisa itself, so it is not necessarily the offender) and/or `investigated_company` (`nu_cnpj_empresa_investigada`). The body adds `by_role` with the rows matched in each role at the same release (a row can count in both). Texts in `nu_cnpj_empresa_investigada` such as `DESCONHECIDO` or `Não se aplica` are kept as published and never match a number; an 11-digit (CPF) value is stored masked as `***NNNNNN**`.
- **Values** are the official text, dates `MM/DD/YYYY HH:MM:SS`. Only the publication dates (`dt_publicacao_medida`, `dt_publicacao`) are given: the source has no end or withdrawal field, so nothing says whether a measure is still in force. `count_unit`: `"measure_line"`, in key order.
- No match is 200 with no items; not loaded is 503 `DATA_UNAVAILABLE`. A company's measures also appear in "All lists of one company".

```json sample=anvisa-irregulares
{"source":{"dataset":"anvisa_irregulares","release":"2026-11-20-007e97d03aa2","seq":1,"reference":"2026-11-20","publisher":"Agência Nacional de Vigilância Sanitária (Anvisa)"},"by_role":{"registrant":2,"investigated_company":2},"query":{"cnpj":"11111111000101","cnpj_basico":null},"count_unit":"measure_line","count":1,"page_size":1,"next_cursor":"…","interpretation":"listed_records","items":[{"conteudo_sha256":"2a77c4333ef934e66c9cd3a7862b4282c7c24629112ac9f817bde6f5f6de56c8","co_seq_dossie_investig_med":"12268","nu_processo":"25351265698201895","nu_cnpj":"11111111000101","no_razao_social":"PADARIA SINTÉTICA FARMA LTDA","co_tipo_produto":"1","ds_tipo_produto":"Dispositivos Médicos para Diagnóstico in Vitro","co_risco":"19","ds_risco_produto":"Risco I","total_medida_cautelar":"1","no_empresa_investigada":"","nu_cnpj_empresa_investigada":"","co_assunto":"70284","dt_publicacao_medida":"11/04/2019 00:00:00","co_acao_fiscalizacao":"2","co_atividade_fiscalizacao":"2","dt_publicacao":"11/04/2019 00:00:00","produtos_concatenados":"NEGATIVE CONTROL MICRO. ","ds_acao_fiscalizacao":"Recolhimento","ds_atividade_fiscalizacao":"Comercialização","acao_atividade":"Recolhimento: Comercialização. ","produto":"NEGATIVE CONTROL MICRO","registro":"10077090102","role":["registrant"]}],"notes":["role registrant = NU_CNPJ, the registration holder Anvisa names: it may be the company recalling its own product, a brand whose product was counterfeited, or Anvisa itself; it is not necessarily the offender.","role investigated_company = NU_CNPJ_EMPRESA_INVESTIGADA; texts such as DESCONHECIDO are kept as published and never match a number.","Only the official publication dates are given: the file has no end or withdrawal field, so whether a measure is still in force is not stated."]}
```

## Federal debt (PGFN)

`GET /api/pgfn/v1/pgfn?cnpj=<CNPJ or base>`

The PGFN Dívida Ativa da União open data (dataset `pgfn`): debts registered by the federal tax (`sistema: "SIDA"`), social security (`PREV`) and FGTS (`FGTS`) systems, one quarterly file set per release. **Only the current quarter is kept**: `quarter` (also `source.reference`, e.g. `2026-Q3`) names it, and there is no history or rollback for this dataset. Its `published_releases` in `/api/catalog/v1/datasets` still counts the earlier quarters, whose rows were deleted when the next quarter was published. At the moment a new quarter is published, a request that read the pointer just before the switch can answer the previous `quarter` with no items (its rows were just deleted), and cursors of the previous quarter are 409 `RELEASE_CHANGED` from then on. Ask again without the cursor: the next answer is the new quarter. Both a complete CNPJ and a base look up the base (almost every debt is registered on the head office number); `match` says whether the debtor number equals the given CNPJ.

- Each item is one company debtor row (key `sistema`, `numero_inscricao`, `cpf_cnpj`), `count_unit: "company_debtor_row"`. Fields are the official headers in lower case; columns a system does not publish are `null` (`entidade_responsavel` and `unidade_inscricao` only for FGTS, `tipo_credito` only for PREV, `receita_principal` not for PREV). `data_inscricao` is ISO (`null` when blank or not a date; placeholder dates such as `1000-01-01` are kept as published); `valor_consolidado` is a decimal string with a point, the consolidated value on the extraction date.
- `status_group` is `em_cobranca` when `tipo_situacao_inscricao` is `"Em cobrança"` (actively collected) and `other_status` otherwise (tax benefit such as instalments, guaranteed, suspended by a court, under negotiation).
- `summary` covers every debt of the base in the quarter, each (`sistema`, `numero_inscricao`) once: `debts` and the sum of `valor_consolidado` for both groups.
- `corresponsaveis` lists the natural persons the file names on the same debt (usually jointly liable): masked number as published (or `***NNNNNN**`), name, `tipo_devedor`. People are never searchable here, and persons on debts without any company are not kept.
- **Being listed is not an irregularity**, and this is not the official real-time [Dívida Aberta](https://www.dividaaberta.pgfn.gov.br/) query: that query shows only actively collected debts and removes paid debts within days (FGTS debts within up to 75 days), while this file lists every registered debt as of the extraction date. `notes` repeats this in every answer. No listed debt is not a clearance certificate: `interpretation` is `listed_records` or `no_listed_record_is_not_a_clearance` like every list, and the status split is in `summary` and `status_group`.

```json sample=pgfn
{"source":{"dataset":"pgfn","release":"2026_trimestre_02-5c70cb4fba64","seq":1,"reference":"2026-Q2","publisher":"Procuradoria-Geral da Fazenda Nacional (PGFN)"},"quarter":"2026-Q2","summary":{"em_cobranca":{"debts":1,"valor_consolidado":"1000.50"},"other_status":{"debts":2,"valor_consolidado":"320.25"}},"notes":["Being listed is not by itself an irregularity: …"],"query":{"cnpj":"11111111000101","cnpj_basico":"11111111"},"count_unit":"company_debtor_row","count":1,"page_size":1,"next_cursor":"…","interpretation":"listed_records","items":[{"sistema":"PREV","numero_inscricao":"9001","cpf_cnpj":"11.111.111/0001-01","tipo_pessoa":"Pessoa jurídica","tipo_devedor":"Principal","nome_devedor":"PADARIA SINTÉTICA LTDA","uf_devedor":"SP","unidade_responsavel":"UNIDADE SINTÉTICA","entidade_responsavel":null,"unidade_inscricao":null,"tipo_situacao_inscricao":"Garantia","situacao_inscricao":"ATIVA EM COBRANCA","receita_principal":null,"tipo_credito":"OUTROS","data_inscricao":"2022-12-21","indicador_ajuizado":"NAO","valor_consolidado":"300.25","status_group":"other_status","match":"exact_cnpj","corresponsaveis":[]}]}
```

## Publicly held companies (CVM)

`GET /api/cvm/v1/listed-companies?cnpj=<CNPJ or base>` and `GET /api/cvm/v1/listed-companies/{cvm_code}`

The CVM register of publicly held companies (Cadastro de Companhias Abertas, dataset `cvm_cia_aberta`, catalog domain `mercado`, the database schema name), loaded from its daily open file; `source.reference` is the file date. Active, suspended and cancelled registrations are all listed (`sit`, `dt_cancel`, `motivo_cancel`).

- One item per official row, that is per (`cd_cvm`, `tp_merc`), `count_unit: "company_market_row"`: a company listed on several markets has one item per market (`BOLSA`, `BALCÃO ORGANIZADO`, `BALCÃO NÃO ORGANIZADO`, or `""` when the file leaves it blank), and a company re-registered under a new CVM code has items under each code. Items are in the byte order of the text `cd_cvm|tp_merc`: the markets of one code are together in `tp_merc` order, codes compare as text (not as numbers), and a code that is a prefix of another (`123`, `1234`) comes after it, because `|` sorts after every digit and letter.
- Both a complete CNPJ and a base look up the base; `cnpj_cia` is as published (formatted) and `match` compares it without punctuation.
- Fields are the 47 official columns in lower case with their official values (`cep` without its leading zero, as published); the seven `dt_*` columns are ISO `YYYY-MM-DD` (`null` when blank or not a real date). `resp` and the `*_resp` fields are the company's registered officer contact as published.
- `GET /api/cvm/v1/listed-companies/{cvm_code}` returns every market row of one CVM code (404 when the code is not in the current release).

```json sample=cvm
{"source":{"dataset":"cvm_cia_aberta","release":"2026-11-19-9f9f2437d75b","seq":1,"reference":"2026-11-19","publisher":"Comissão de Valores Mobiliários (CVM)"},"query":{"cnpj":"11111111000101","cnpj_basico":"11111111"},"count_unit":"company_market_row","count":1,"page_size":1,"next_cursor":"…","interpretation":"listed_records","items":[{"cd_cvm":"1716","tp_merc":"","cnpj_cia":"11.111.111/0001-01","denom_social":"PADARIA SINTÉTICA S.A.","denom_comerc":"PADARIA SINTÉTICA S.A.","dt_reg":"2010-03-08","dt_const":"2009-11-03","dt_cancel":"2015-12-18","motivo_cancel":"CANCELAMENTO VOLUNTÁRIO","sit":"CANCELADA","dt_ini_sit":"2015-12-18","setor_ativ":"Securitização de Recebíveis","categ_reg":"","dt_ini_categ":null,"sit_emissor":"FASE OPERACIONAL","dt_ini_sit_emissor":"2010-03-08","controle_acionario":"PRIVADO","tp_ender":"SEDE","logradouro":"RUA SINTÉTICA, 1","compl":"","bairro":"CENTRO","mun":"SÃO PAULO","uf":"SP","pais":"BRASIL","cep":"1001000","ddd_tel":"11","tel":"33334444","ddd_fax":"","fax":"","email":"ri@sintetica.example","tp_resp":"DIRETOR DE RELAÇÕES COM INVESTIDORES","resp":"RESPONSÁVEL SINTÉTICO","dt_ini_resp":null,"logradouro_resp":"RUA SINTÉTICA, 1","compl_resp":"","bairro_resp":"CENTRO","mun_resp":"SÃO PAULO","uf_resp":"SP","pais_resp":"","cep_resp":"1001000","ddd_tel_resp":"11","tel_resp":"33334444","ddd_fax_resp":"","fax_resp":"","email_resp":"juridico@sintetica.example","cnpj_auditor":"10.830.108/0001-65","auditor":"AUDITORES SINTÉTICOS LTDA","match":"exact_cnpj"}]}
```

## Forced-labour employer registers (MTE)

`GET /api/mte/v1/forced-labor-employers?cnpj=<CNPJ or base>` and `GET /api/mte/v1/ceac?cnpj=<CNPJ or base>`

Two registers of the Ministry of Labour and Employment's labour inspection (dataset `mte_trabalho_escravo`, catalog domain `trabalho`, the database schema name), published together as one release; `source.reference` is the day the files were fetched (the Ministry keeps only its current files, updated about twice a year).

- **Cadastro de Empregadores** (`forced-labor-employers`): employers whose inspection found workers in conditions analogous to slavery, after a final administrative decision. This is a transparency register, not a sanction list.
- **CEAC** (`ceac`): employers who signed a conduct adjustment agreement or similar settlement; `inclusao_no_cadastro_de_empregadores` is the period they spent on the main register (e.g. `"05/04/2024 a 26/05/2025"`), `inclusao_no_ceac` the inclusion in CEAC and `termo_de_ajustamento_de_conduta_mte` a link or note about the agreement, as published.

Both answer only by company number, like the CGU lists: a complete CNPJ matches its own rows (`match: "exact_cnpj"`) and rows of other numbers of the same base (`same_base_number`); a base number matches all of them. `count_unit` is `"employer_row"`, one item per official row; only rows whose number is a complete CNPJ are kept (individual employers identified by CPF are not stored and never returned). Fields are the official columns in snake case without accents, every value as published text: `cnpj_cpf` formatted, `inclusao_no_cadastro_de_empregadores` may be a date range with court suspensions (`"09/04/2025 a 05/09/2025, 18/11/2026"`), never parsed. The official `ID` column is the line number of the edition and is not returned; `row_key` (sha256 of the row's official content) identifies the row across editions, so a row whose content changes appears under a new `row_key`. Items are in `row_key` order. No score or verdict is derived, and no listed row is not a clearance (`interpretation` as in every list).

```json sample=mte-cadastro
{"source":{"dataset":"mte_trabalho_escravo","release":"2026-11-20-888dd8ed3bd9","seq":2,"reference":"2026-11-20","publisher":"Ministério do Trabalho e Emprego (MTE)"},"query":{"cnpj":"11111111000101","cnpj_basico":"11111111"},"count_unit":"employer_row","count":1,"page_size":1,"next_cursor":"…","interpretation":"listed_records","items":[{"row_key":"091580eb4e7dcca3bfc8b59a6f4b2382374457e02b33e3d7aa3eafb7e60969ab","ano_da_acao_fiscal":"2024","uf":"SP","empregador":"PADARIA SÃO JOÃO LTDA","cnpj_cpf":"11.111.111/0001-01","estabelecimento":"FAZENDA SINTÉTICA – ZONA RURAL, SÃO PAULO/SP","trabalhadores_envolvidos":"3","cnae":"0151-2/01","decisao_administrativa_de_procedencia":"15/05/2025","inclusao_no_cadastro_de_empregadores":"06/10/2025","match":"exact_cnpj"}]}
```

```json sample=mte-ceac
{"source":{"dataset":"mte_trabalho_escravo","release":"2026-11-20-888dd8ed3bd9","seq":2,"reference":"2026-11-20","publisher":"Ministério do Trabalho e Emprego (MTE)"},"query":{"cnpj":"33333333000101","cnpj_basico":"33333333"},"count_unit":"employer_row","count":1,"page_size":1,"next_cursor":null,"interpretation":"listed_records","items":[{"row_key":"cdebf9c4f681939d8d5e0efc3faa66dc71827a7c4b7dcfb8377d5cd88f7f9143","ano_da_acao_fiscal":"2021","uf":"PA","empregador":"ALFA COMERCIO","cnpj_cpf":"33.333.333/0001-01","estabelecimento":"FAZENDA AJUSTADA, NOVO REPARTIMENTO/PA","inclusao_no_cadastro_de_empregadores":"05/04/2024 a 26/05/2025","inclusao_no_ceac":"26/05/2025","termo_de_ajustamento_de_conduta_mte":"https://www.gov.br/trabalho-e-emprego/pt-br/assuntos/inspecao-do-trabalho/acordos-celebrados","match":"exact_cnpj"}]}
```

## Public procurement (Compras.gov.br)

`GET /api/procurement/v1/awards?cnpj=<CNPJ or base>|masked_cpf=***NNNNNN**&name=<name>`, `GET /api/procurement/v1/prices[?catmat=<code>|catser=<code>|description=<fragment>][&uf=<state>][&year=<year>]`, `GET /api/procurement/v1/prices/trend?catmat=<code>|catser=<code>|description=<fragment>[&uf=<state>]`, `GET /api/procurement/v1/suppliers[?uf=<state>][&year=<year>][&name=<fragment>][&sort=awards|value]`, `GET /api/procurement/v1/suppliers/{cnpj}/summary`, `GET /api/procurement/v1/summary` and `GET /api/procurement/v1/catalog?type=catmat|catser[&name=<fragment>]`

Item-level awarded prices of public purchases under Law 14.133 (2021 onwards), from the open API of the federal procurement platform Compras.gov.br (dataset `compras`, catalog domain `compras`, the database schema name): purchase items and their results (one result per awarded supplier). Purchases and items are keyed by PNCP numbers: `id_contratacao_pncp` (the PNCP control number of the purchase), `numero_item_pncp` and, for a result, `sequencial_resultado`.

**Coverage.** Every answer carries `coverage`. Only purchases run on the federal platform Compras.gov.br are included, about a quarter of the electronic bidding processes published in PNCP (`coverage.note`); purchases run on other platforms (states, municipalities, private platforms) are not. This is not all government procurement: no record here never means a company had no public contract. The result endpoints (`awards`, `prices`, `prices/trend`, `suppliers`, `suppliers/{cnpj}/summary`, `summary`, and `catalog` without `name`) also give `coverage.published_ranges`: the date range (`"YYYY-MM-DD/YYYY-MM-DD"`) of every batch in effect at the answer's release, in date order; a period missing from this list has not been loaded.

**Releases.** The data is loaded by date range, one release per batch (usually one calendar month), and the batches add up: every published batch up to the current release stays in effect, and they need not be loaded in date order. `source.reference` is the date range of the **most recently published batch only** (the release the answer is read at), not the period the data covers; use `coverage.published_ranges` for that. A later batch adds new records and new versions of corrected or cancelled ones; a record not in that batch is kept as it was. Results are often published months after their result date, so recent months grow as older ranges are loaded again.

Field names are the official JSON keys in snake case (`idContratacaoPNCP` → `id_contratacao_pncp`), values as published: date-times are the official local date-times `YYYY-MM-DDTHH:MM:SS` without an offset; quantities and amounts are numbers (`unidade_medida` is the buyer's free text). A supplier number (`ni_fornecedor`) is an unformatted CNPJ, a masked CPF (`***NNNNNN**`, individual suppliers, `tipo_pessoa: "PF"`) or a foreign identifier (`tipo_pessoa: "PE"`) as published; complete CPFs are never stored or returned.

- **Results by supplier** (`awards`): every result of the CNPJ's base (a complete CNPJ also matches its own number, `match` as in the other lists), cancelled ones included (`situacao_compra_item_resultado_id: 2`, `situacao_compra_item_resultado_nome: "Cancelado"`, `motivo_cancelamento`, `data_cancelamento_pncp`). `count_unit` is `"procurement_result"`; items are in PNCP key order. `item` holds the purchase item's catalogue code (`cod_item_catalogo`, CATMAT for `material_ou_servico: "M"`, CATSER for `"S"`), description, unit, estimated quantity and price, or `null` when that item is not loaded. Masked-CPF and foreign suppliers have no base number and are never found by `cnpj`.
- **Results by person** (`awards?masked_cpf=***NNNNNN**&name=…`, instead of `cnpj`): the results whose supplier is an individual with this masked CPF (`***NNNNNN**` or `***.NNN.NNN-**`) and this name (accents, case and repeated spaces ignored; at most 200 characters, no control characters). Masked CPF plus normalised name is also the key of a CNPJ person member (`/api/cnpj/v1/members/person`, which links here in `procurement`), so the same person can be followed between the registry and the awards. It is an approximate identity (`match: {"masked_cpf": "exact", "name": "normalized_exact", "identity": "approximate"}`, each item `match: "masked_cpf_and_name"`): two people can share the six digits and the name, and one person spelt two ways is two keys. A complete CPF is 400 `INVALID_QUERY` and is never echoed; `cnpj` together with `masked_cpf` or `name`, or only one of the two, is 400 `INVALID_QUERY`. Items, order, `page_size`, `cursor` and `coverage` are those of results by supplier; no match is an empty list.
- **Prices** (`prices`): one of `catmat` (goods code), `catser` (services code) or `description` (without any of them, see **Latest results** below). With a code: results of items with that code. With `description`: results of items whose short description (`item.descricao_resumida`) contains it as a contiguous fragment, accents, case and repeated spaces ignored, at least 3 characters (`query.normalized` echoes the normalized form); goods and services alike. Use `description` for recent purchases: most items published in 2026 carry no catalogue code (`cod_item_catalogo: null`), so a code finds few of them. A fragment also matches inside longer descriptions (`seringa` finds "Filtro … para seringa"); check `item.descricao_resumida` and the unit. A result whose item is not loaded is found neither way. A description fragment so common that the query does not finish in time is 400 `QUERY_TOO_BROAD`: use a longer fragment or add `uf` / `year`. Either way cancelled results are left out, newest result first; `uf` keeps one state of the buying unit (`unidade_orgao_uf_sigla`), `year` one result year. `summary.by_unit` covers every matching result, not only the page: per `unidade_medida` (up to the 10 most frequent units) `count`, `min`, `median` and `max` of `valor_unitario_homologado`; prices of different units are never mixed.
- **Latest results** (`prices` without `catmat`, `catser` or `description`): every result of the current release, newest `data_resultado_pncp` first (results of one date by PNCP key, descending), optionally one buying-unit state (`uf`) and one result year (`year`), with `page_size` and `cursor`. The matching rules are those of a goods query: cancelled results are left out, and only results whose purchase item is loaded are listed, each with its `item`. Results whose item is not loaded (about 5% in 2026-11) never appear in this list; they are still in `awards`, `suppliers` and `summary`. `summary` is `null` (a unit summary over all goods would mix unrelated prices) and `query` echoes `catmat`, `catser` and `description` (the echo's name for `description`) as `null`. A cursor of this list never pages a goods query, and the reverse (400 `INVALID_CURSOR`).
- **Price trend** (`prices/trend`): the same matching results as `prices` (same `catmat` / `catser` / `description` rules, optional `uf`; no `year` and no pages), per unit of measure and result year. `by_unit` lists up to the 10 most frequent units ranked exactly like `prices`' `summary.by_unit`, and each unit's top-level `count`, `min`, `median` and `max` equal that summary row; `by_year` gives the same four figures per year of `data_resultado_pncp`, ascending. Units are never mixed (`unidade_medida` is the buyer's free text, so "Caixa" and "Unidade" prices stay apart), cancelled results are left out, and there is no suggested price or outlier removal: callers that estimate a reference price apply their own rule to these figures. `total` counts every matching result; `other_units` counts the units and results not shown; a blank (`null`) `unidade_medida` is one unit of its own, here and in the supplier summary's `units`. A trend is only as long as the loaded date ranges: `coverage.published_ranges` lists every batch in effect (`source.reference` is only the newest batch's range); missing months look like missing years.
- **Supplier summary** (`suppliers/{cnpj}/summary`): the awards of one supplier CNPJ or base in one answer, from the same rows `awards` lists for that base and release (`results_path`), cancelled results left out. `totals` (`count`, sum of `valor_total_homologado`, `first_result` and `last_result` dates, `item_unknown`: results whose purchase item is not loaded); `by_match` (`exact_cnpj` / `same_base_number` counts, `null` for a base input); `by_year` (count and amount per result year); `top_items` (up to 10 most frequent goods: grouped by catalogue code when the item has one, `group_by: "catalogue_code"`, else by the normalised short description, `"description"`; results without a loaded item form one `"item_unknown"` group and still count everywhere else), each with count, amount, `median_unit_price` (only when the group has a single unit of measure, a blank unit counting as one, else `null`), `units` and `precos_path` (the prices query of that code or description; `null` for `item_unknown` and for a description the prices endpoint would refuse: shorter than 3 or longer than 200 characters, or holding a control character); `top_buyers` (up to 10 buying bodies by `orgao_entidade_cnpj`, the source has no name: follow `buyer_path` to the registry, with their buying-unit states); `by_uf` (every buying-unit state). Amounts are sums of the published `valor_total_homologado`.
- **Overview** (`summary`, no parameters): figures of the whole loaded result set at the current release, cancelled results left out. `totals`: `count` (results), sum of `valor_total_homologado`, `buyers` (distinct `orgao_entidade_cnpj`), `suppliers` (distinct supplier base numbers; masked CPFs and foreign suppliers have none and are counted in `results_without_cnpj` instead), `first_result` and `last_result` dates; `by_year` gives the same figures (without dates) per result year, and its counts add up to `totals.count`. The figures describe only the loaded periods (`coverage.published_ranges`), never all procurement. They are computed once per release on the first request (a few seconds), then served from memory until the next release.
- **Catalogue codes by name** (`catalog`): codes of the federal goods (CATMAT, `type=catmat`) or services (CATSER, `type=catser`) catalogue (dataset `compras_catalogo`, a complete snapshot) whose name contains `name` as a contiguous fragment, accents, case and repeated spaces ignored, at least 3 characters. Matches `descricao_item` (goods) or `nome_servico` (services); inactive codes are included (`status_item` / `status_servico`). Items are in code order, each with `precos_path`. The catalogue is national; the prices behind `precos_path` cover only the federal platform.
- **Catalogue codes by result count** (`catalog` without `name`; `type` still required): the codes of that kind with at least one result, by `result_count` descending, equal counts by code ascending. `result_count` counts exactly what the code's `precos_path` lists in total (`prices?catmat=` or `catser=`): cancelled results left out, the result's item loaded and carrying that code. Each item has the catalogue fields read at the current `compras_catalogo` release (inactive codes included), `result_count` and `precos_path`; a code found in the results but not in the catalogue is still listed, with every catalogue field `null` except the code. `source` is the catalogue release and `results_source` the `compras` release the counts belong to; a cursor is bound to both (409 `RELEASE_CHANGED` when either changes). The counts are computed once per `compras` release on the first request (a few seconds), then served from memory until the next release. With `name`, the answer is unchanged (no `result_count`).
- **Suppliers** (`suppliers`): the supplier base numbers of the current release with their awards, cancelled results left out (the same rows as `suppliers/{cnpj}/summary`). Only suppliers with a company base number are listed: masked-CPF suppliers and foreign suppliers without a complete CNPJ have none (`summary`'s `results_without_cnpj`); a foreign supplier that has one is listed. Each item: `cnpj_basico`, `nome_razao_social_fornecedor` (the name on the base's newest non-cancelled result of the release, whatever the filters; the source spells one company in several ways), `count`, `valor_total_homologado`, `last_result` and `resumo_path`. Optional filters: `uf` (state of the buying unit, as in `prices`), `year` (result year) and `name` (a fragment of the listed name, rules as in `catalog`: accents, case and repeated spaces ignored, at least 3 characters); `count`, the amount and `last_result` follow `uf` and `year`. `sort=awards` (default): by `count`, then amount, then base number; `sort=value`: by amount, then `count`, then base number. Without filters each item's figures equal `totals` of its `resumo_path`; with `uf` or `year` they equal that summary's `by_uf` or `by_year` row. The amount is the exact sum of the published `valor_total_homologado` values: some published amounts are plainly mistyped (the largest single result in 2026-11 is R$ 347 billion), this API does not correct them, so the top of `sort=value` can be decided by one such record; `sort=awards` is the default for that reason. The list is computed once per release on the first request (a few seconds), then filtered and sorted in memory until the next release.
- No match is 200 with no items; a dataset that is not loaded is 503 `DATA_UNAVAILABLE`. Cursors are bound to the query and the release (409 `RELEASE_CHANGED`).
- The `query` echo keeps the internal parameter names and values (`descricao`, `ano`, `nome`, `tipo: "material"` / `"servico"`, `sort: "resultados"` / `"valor"`); do not rely on it matching the request parameters.

```json sample=compras-resultados
{"source":{"dataset":"compras","release":"2025-11-04_2025-11-04-82a0e50688ad","seq":2,"reference":"2025-11-04/2025-11-04","publisher":"Ministério da Gestão e da Inovação em Serviços Públicos (Compras.gov.br)"},"query":{"cnpj":"11111111000101","cnpj_basico":"11111111"},"count_unit":"procurement_result","count":1,"page_size":1,"next_cursor":"…","interpretation":"listed_records","items":[{"id_contratacao_pncp":"00038166000105-1-000001/2025","numero_item_pncp":1,"sequencial_resultado":1,"id_compra":"92513407000012025","id_compra_item":"9251340700001202500001","unidade_orgao_codigo_unidade":"925134","unidade_orgao_uf_sigla":"RS","orgao_entidade_cnpj":"00038166000105","ni_fornecedor":"11111111000101","tipo_pessoa":"PJ","nome_razao_social_fornecedor":"PADARIA SINTÉTICA LTDA","uf_fornecedor":null,"codigo_pais":"BRA","porte_fornecedor_nome":"ME","natureza_juridica_nome":"Sociedade Empresária Limitada","ordem_classificacao_srp":1,"quantidade_homologada":10,"valor_unitario_homologado":1.25,"valor_total_homologado":12.5,"percentual_desconto":0,"situacao_compra_item_resultado_id":1,"situacao_compra_item_resultado_nome":"Informado","motivo_cancelamento":null,"data_resultado_pncp":"2025-11-03T00:00:00","data_inclusao_pncp":"2025-11-03T10:00:00","data_atualizacao_pncp":"2025-11-03T10:00:00","data_cancelamento_pncp":null,"match":"exact_cnpj","item":{"material_ou_servico":"M","cod_item_catalogo":621836,"descricao_resumida":"Ponteira Laboratório material: plástico","unidade_medida":"Unidade","quantidade":10,"valor_unitario_estimado":1.5,"criterio_julgamento_nome":"Menor preço","situacao_compra_item_nome":"Homologado","nome_pdm":"PONTEIRA LABORATÓRIO"}}],"coverage":{"scope":"federal_platform_only","platforms":["Compras.gov.br"],"note":"Only purchases run on the federal platform Compras.gov.br (Law 14.133) are included: about a quarter of the electronic bidding processes published in PNCP (1,543 of 6,773 on 2026-11-02 to 2026-11-06). This is not all government procurement, and absence here does not mean a company had no public contract.","published_ranges":["2024-05-01/2025-11-04","2025-11-04/2025-11-04"]}}
```

```json sample=compras-precos
{"source":{"dataset":"compras","release":"2025-11-04_2025-11-04-82a0e50688ad","seq":2,"reference":"2025-11-04/2025-11-04","publisher":"Ministério da Gestão e da Inovação em Serviços Públicos (Compras.gov.br)"},"coverage":{"scope":"federal_platform_only","platforms":["Compras.gov.br"],"note":"Only purchases run on the federal platform Compras.gov.br (Law 14.133) are included: about a quarter of the electronic bidding processes published in PNCP (1,543 of 6,773 on 2026-11-02 to 2026-11-06). This is not all government procurement, and absence here does not mean a company had no public contract.","published_ranges":["2024-05-01/2025-11-04","2025-11-04/2025-11-04"]},"summary":{"by_unit":[{"unidade_medida":"Unidade","count":2,"min":1.25,"median":1.325,"max":1.4},{"unidade_medida":"Caixa","count":1,"min":27.5,"median":27.5,"max":27.5}],"excluded":"cancelled results (situacao_compra_item_resultado_id 2)"},"query":{"catmat":621836,"catser":null,"descricao":null,"uf":"RS","ano":2025},"count_unit":"procurement_result","count":1,"page_size":1,"next_cursor":"…","interpretation":"listed_records","items":[{"id_contratacao_pncp":"00038166000105-1-000005/2025","numero_item_pncp":1,"sequencial_resultado":1,"id_compra":"92513407000052025","id_compra_item":"9251340700005202500001","unidade_orgao_codigo_unidade":"925134","unidade_orgao_uf_sigla":"RS","orgao_entidade_cnpj":"00038166000105","ni_fornecedor":"***456789**","tipo_pessoa":"PF","nome_razao_social_fornecedor":"PESSOA FÍSICA SINTÉTICA","uf_fornecedor":null,"codigo_pais":"BRA","porte_fornecedor_nome":"ME","natureza_juridica_nome":"Sociedade Empresária Limitada","ordem_classificacao_srp":1,"quantidade_homologada":10,"valor_unitario_homologado":1.4,"valor_total_homologado":14,"percentual_desconto":0,"situacao_compra_item_resultado_id":1,"situacao_compra_item_resultado_nome":"Informado","motivo_cancelamento":null,"data_resultado_pncp":"2025-11-04T00:00:00","data_inclusao_pncp":"2025-11-04T10:00:00","data_atualizacao_pncp":"2025-11-04T10:00:00","data_cancelamento_pncp":null,"item":{"material_ou_servico":"M","cod_item_catalogo":621836,"descricao_resumida":"Ponteira Laboratório material: plástico","unidade_medida":"Unidade","quantidade":10,"valor_unitario_estimado":1.5,"criterio_julgamento_nome":"Menor preço","situacao_compra_item_nome":"Homologado","nome_pdm":"PONTEIRA LABORATÓRIO"}}]}
```

```json sample=compras-precos-recentes
{"source":{"dataset":"compras","release":"2025-11-04_2025-11-04-e640b0a0776e","seq":2,"reference":"2025-11-04/2025-11-04","publisher":"Ministério da Gestão e da Inovação em Serviços Públicos (Compras.gov.br)"},"coverage":{"scope":"federal_platform_only","platforms":["Compras.gov.br"],"note":"…","published_ranges":["2024-05-01/2025-11-04","2025-11-04/2025-11-04"]},"summary":null,"query":{"catmat":null,"catser":null,"descricao":null,"uf":"SP","ano":null},"count_unit":"procurement_result","count":1,"page_size":1,"next_cursor":"…","interpretation":"listed_records","items":[{"id_contratacao_pncp":"00038166000105-1-000006/2025","numero_item_pncp":1,"sequencial_resultado":1,"id_compra":"92513407000062025","id_compra_item":"9251340700006202500001","unidade_orgao_codigo_unidade":"925134","unidade_orgao_uf_sigla":"SP","orgao_entidade_cnpj":"00038166000105","ni_fornecedor":"33333333000133","tipo_pessoa":"PJ","nome_razao_social_fornecedor":"SERINGAS SINTÉTICAS LTDA","uf_fornecedor":null,"codigo_pais":"BRA","porte_fornecedor_nome":"ME","natureza_juridica_nome":"Sociedade Empresária Limitada","ordem_classificacao_srp":1,"quantidade_homologada":10,"valor_unitario_homologado":0.48,"valor_total_homologado":4.8,"percentual_desconto":0,"situacao_compra_item_resultado_id":1,"situacao_compra_item_resultado_nome":"Informado","motivo_cancelamento":null,"data_resultado_pncp":"2025-11-04T00:00:00","data_inclusao_pncp":"2025-11-04T10:00:00","data_atualizacao_pncp":"2025-11-04T10:00:00","data_cancelamento_pncp":null,"item":{"material_ou_servico":"M","cod_item_catalogo":null,"descricao_resumida":"Seringa material: polipropileno, capacidade: 10","unidade_medida":"Unidade","quantidade":10,"valor_unitario_estimado":1.5,"criterio_julgamento_nome":"Menor preço","situacao_compra_item_nome":"Homologado","nome_pdm":"PONTEIRA LABORATÓRIO"}}]}
```

```json sample=compras-catalogo
{"source":{"dataset":"compras_catalogo","release":"2026-11-20-5113559e4bba","seq":1,"reference":"2026-11-20","publisher":"Ministério da Gestão e da Inovação em Serviços Públicos (Compras.gov.br)"},"coverage":{"scope":"federal_platform_only","platforms":["Compras.gov.br"],"note":"Only purchases run on the federal platform Compras.gov.br (Law 14.133) are included: about a quarter of the electronic bidding processes published in PNCP (1,543 of 6,773 on 2026-11-02 to 2026-11-06). This is not all government procurement, and absence here does not mean a company had no public contract.","catalogue":"The catalogue itself is national; prices behind precos_path cover only the federal platform."},"query":{"tipo":"material","nome":"cadeira escritorio","normalized":"CADEIRA ESCRITORIO"},"count_unit":"catalogue_code","count":1,"page_size":1,"next_cursor":"…","interpretation":"listed_records","items":[{"codigo_item":206504,"descricao_item":"CADEIRA ESCRITÓRIO, MATERIAL ESTRUTURA: TUBO AÇO","codigo_pdm":11016,"nome_pdm":"CADEIRA ESCRITÓRIO","codigo_classe":6640,"nome_classe":"EQUIPAMENTOS E ARTIGOS DE LABORATÓRIO","codigo_grupo":66,"nome_grupo":"INSTRUMENTOS E EQUIPAMENTOS DE LABORATÓRIO","status_item":true,"item_sustentavel":false,"codigo_ncm":null,"descricao_ncm":null,"precos_path":"/api/procurement/v1/prices?catmat=206504"}]}
```

```json sample=compras-catalogo-ranking
{"source":{"dataset":"compras_catalogo","release":"2026-11-20-5113559e4bba","seq":1,"reference":"2026-11-20","publisher":"Ministério da Gestão e da Inovação em Serviços Públicos (Compras.gov.br)"},"results_source":{"dataset":"compras","release":"2025-11-04_2025-11-04-e640b0a0776e","seq":2,"reference":"2025-11-04/2025-11-04","publisher":"Ministério da Gestão e da Inovação em Serviços Públicos (Compras.gov.br)"},"excluded":"cancelled results (situacao_compra_item_resultado_id 2)","coverage":{"scope":"federal_platform_only","platforms":["Compras.gov.br"],"note":"…","published_ranges":["2024-05-01/2025-11-04","2025-11-04/2025-11-04"],"catalogue":"The catalogue itself is national; prices behind precos_path cover only the federal platform."},"query":{"tipo":"material","nome":null,"normalized":null},"count_unit":"catalogue_code","count":1,"page_size":1,"next_cursor":"…","interpretation":"listed_records","items":[{"codigo_item":621836,"descricao_item":"PONTEIRA LABORATÓRIO, MATERIAL: PLÁSTICO , ESTERILIDADE*: ESTÉRIL","codigo_pdm":11016,"nome_pdm":"PONTEIRA LABORATÓRIO","codigo_classe":6640,"nome_classe":"EQUIPAMENTOS E ARTIGOS DE LABORATÓRIO","codigo_grupo":66,"nome_grupo":"INSTRUMENTOS E EQUIPAMENTOS DE LABORATÓRIO","status_item":true,"item_sustentavel":false,"codigo_ncm":null,"descricao_ncm":null,"result_count":4,"precos_path":"/api/procurement/v1/prices?catmat=621836"}]}
```

```json sample=compras-fornecedores
{"source":{"dataset":"compras","release":"2025-11-04_2025-11-04-e640b0a0776e","seq":2,"reference":"2025-11-04/2025-11-04","publisher":"Ministério da Gestão e da Inovação em Serviços Públicos (Compras.gov.br)"},"coverage":{"scope":"federal_platform_only","platforms":["Compras.gov.br"],"note":"…","published_ranges":["2024-05-01/2025-11-04","2025-11-04/2025-11-04"]},"excluded":"cancelled results (situacao_compra_item_resultado_id 2)","query":{"uf":null,"ano":null,"nome":null,"normalized":null,"sort":"resultados"},"count_unit":"supplier_base_number","count":1,"page_size":1,"next_cursor":"…","interpretation":"listed_records","items":[{"cnpj_basico":"55555555","nome_razao_social_fornecedor":"UNIDADES SINTÉTICAS LTDA","count":14,"valor_total_homologado":460,"last_result":"2025-11-04T00:00:00","resumo_path":"/api/procurement/v1/suppliers/55555555/summary"}]}
```

```json sample=compras-tendencia
{"source":{"dataset":"compras","release":"2025-11-04_2025-11-04-82a0e50688ad","seq":2,"reference":"2025-11-04/2025-11-04","publisher":"Ministério da Gestão e da Inovação em Serviços Públicos (Compras.gov.br)"},"coverage":{"scope":"federal_platform_only","platforms":["Compras.gov.br"],"note":"Only purchases run on the federal platform Compras.gov.br (Law 14.133) are included: about a quarter of the electronic bidding processes published in PNCP (1,543 of 6,773 on 2026-11-02 to 2026-11-06). This is not all government procurement, and absence here does not mean a company had no public contract.","published_ranges":["2024-05-01/2025-11-04","2025-11-04/2025-11-04"]},"query":{"catmat":621836,"catser":null,"descricao":null,"uf":null,"ano":null},"count_unit":"procurement_result","total":4,"other_units":{"units":0,"results":0},"excluded":"cancelled results (situacao_compra_item_resultado_id 2)","interpretation":"listed_records","by_unit":[{"unidade_medida":"Unidade","count":3,"min":1.1,"median":1.25,"max":1.4,"by_year":[{"ano":2024,"count":1,"min":1.1,"median":1.1,"max":1.1},{"ano":2025,"count":2,"min":1.25,"median":1.325,"max":1.4}]},{"unidade_medida":"Caixa","count":1,"min":27.5,"median":27.5,"max":27.5,"by_year":[{"ano":2025,"count":1,"min":27.5,"median":27.5,"max":27.5}]}]}
```

```json sample=compras-fornecedor
{"source":{"dataset":"compras","release":"2025-11-04_2025-11-04-82a0e50688ad","seq":2,"reference":"2025-11-04/2025-11-04","publisher":"Ministério da Gestão e da Inovação em Serviços Públicos (Compras.gov.br)"},"coverage":{"scope":"federal_platform_only","platforms":["Compras.gov.br"],"note":"Only purchases run on the federal platform Compras.gov.br (Law 14.133) are included: about a quarter of the electronic bidding processes published in PNCP (1,543 of 6,773 on 2026-11-02 to 2026-11-06). This is not all government procurement, and absence here does not mean a company had no public contract.","published_ranges":["2024-05-01/2025-11-04","2025-11-04/2025-11-04"]},"query":{"cnpj":"11111111000101","cnpj_basico":"11111111"},"count_unit":"procurement_result","excluded":"cancelled results (situacao_compra_item_resultado_id 2)","results_path":"/api/procurement/v1/awards?cnpj=11111111000101&page_size=100","interpretation":"listed_records","totals":{"count":5,"valor_total_homologado":1148.5,"first_result":"2024-05-06T00:00:00","last_result":"2025-11-04T00:00:00","item_unknown":1},"by_match":{"exact_cnpj":4,"same_base_number":1},"by_year":[{"ano":2024,"count":1,"valor_total_homologado":11},{"ano":2025,"count":4,"valor_total_homologado":1137.5}],"top_items":[{"group_by":"catalogue_code","count":3,"valor_total_homologado":78.5,"median_unit_price":null,"material_ou_servico":"M","cod_item_catalogo":621836,"descricao_resumida":"Ponteira Laboratório material: plástico","units":2,"precos_path":"/api/procurement/v1/prices?catmat=621836"},{"group_by":"catalogue_code","count":1,"valor_total_homologado":1050,"median_unit_price":350,"material_ou_servico":"S","cod_item_catalogo":9946,"descricao_resumida":"Reserva em hotéis nacionais","units":1,"precos_path":"/api/procurement/v1/prices?catser=9946"},{"group_by":"item_unknown","material_ou_servico":null,"cod_item_catalogo":null,"descricao_resumida":null,"count":1,"valor_total_homologado":20,"median_unit_price":null,"units":0,"precos_path":null}],"top_buyers":[{"orgao_entidade_cnpj":"00038166000105","count":5,"valor_total_homologado":1148.5,"ufs":["DF","RS","SP"],"buyer_path":"/api/cnpj/v1/establishments/00038166000105"}],"by_uf":[{"uf":"RS","count":3,"valor_total_homologado":87.5},{"uf":"DF","count":1,"valor_total_homologado":1050},{"uf":"SP","count":1,"valor_total_homologado":11}]}
```

```json sample=compras-resumo
{"source":{"dataset":"compras","release":"2025-11-04_2025-11-04-82a0e50688ad","seq":2,"reference":"2025-11-04/2025-11-04","publisher":"Ministério da Gestão e da Inovação em Serviços Públicos (Compras.gov.br)"},"coverage":{"scope":"federal_platform_only","platforms":["Compras.gov.br"],"note":"…","published_ranges":["2024-05-01/2025-11-04","2025-11-04/2025-11-04"]},"count_unit":"procurement_result","excluded":"cancelled results (situacao_compra_item_resultado_id 2)","interpretation":"listed_records","totals":{"count":10,"valor_total_homologado":1227.3,"buyers":1,"suppliers":3,"results_without_cnpj":1,"first_result":"2024-05-06T00:00:00","last_result":"2025-11-04T00:00:00"},"by_year":[{"ano":2024,"count":1,"valor_total_homologado":11,"buyers":1,"suppliers":1,"results_without_cnpj":0},{"ano":2025,"count":9,"valor_total_homologado":1216.3,"buyers":1,"suppliers":3,"results_without_cnpj":1}]}
```

## Purchase notices (PNCP)

`GET /api/procurement/v1/notices[?status=open|closed|all][&uf=<state>][&min_value=<reais>][&closes_by=YYYY-MM-DD][&published_since=YYYY-MM-DD][&procurement_method=<id>][&subject=<fragment>][&sort=closing|published|value]`

Purchase headers (notices) published in PNCP, the national public procurement portal, by every platform: federal, state and municipal systems, unlike the procurement results above (dataset `compras_editais`, catalog domain `compras`, the database schema name). Collected by a daily refresh of PNCP's open API: every purchase still taking bids, plus every purchase published on the recent days (PNCP publishes the previous day's notices late, so each refresh fetches the last days again). Collection started with the first refresh (`coverage.collected_since`); older purchases are not back-filled.

- **Freshness**: `data_as_of` is when the release's refresh started. A refresh reads PNCP page by page for up to about an hour and a half, so a purchase published or changed while it ran may or may not be included; anything published or changed after it finished is not. If refreshes stop, `data_as_of` stops moving. `checked_at` is the request time used for `status`.
- **Filters** (combined): `status` `open` (default: the bid deadline `data_encerramento_proposta` is after `checked_at`), `closed` (deadline passed) or `all` (also purchases without a bid deadline, such as direct contracting); `uf` (buying unit's state); `min_value` (estimated value at least this; zero or confidential estimates never match); `closes_by` (deadline on or before this day); `published_since` (published on or after this day; both dates `YYYY-MM-DD`, a real day of a year from 1000 on); `procurement_method` (PNCP modality id, e.g. 6 = Pregão - Eletrônico, 8 = Dispensa); `subject` (contiguous fragment of `objeto_compra`, accents and case ignored, at least 3 characters).
- **Order** `sort`: `closing` (deadline ascending, purchases without a deadline last; the default for `open`), `published` (newest first, purchases without a publication date last; the default otherwise) or `value` (estimated value descending, zero or confidential estimates last). Pages and cursors as usual (`count_unit`: `"purchase"`). The `query` echo keeps the internal names and values (`situacao: "aberta"`, `valor_min`, `encerramento_ate`, `publicacao_desde`, `modalidade`, `objeto`, `ordem: "encerramento"`).
- **Items**: the official fields in snake case (date-times are PNCP's local date-times without an offset), with `orgao_entidade`, `unidade_orgao` and `amparo_legal` as objects and `unidade_sub_rogada`, `orgao_sub_rogado`, `fontes_orcamentarias` as published JSON. `valor_total_estimado` is never shown as 0: PNCP sends 0 for confidential estimates too, so a 0 is `null` with `valor_total_estimado_status: "zero_or_confidential"` (`"informed"` otherwise, `"missing"` when absent). `open` is computed against `checked_at`; a suspended or annulled purchase whose deadline has not passed is still `open` by this rule, and `situacao_compra_nome` says `Suspensa` / `Anulada`. `pncp_url` is the purchase's public PNCP page. The publishing system's user name is not stored.
- Not loaded: 503 `DATA_UNAVAILABLE`.

```json sample=compras-editais
{"source":{"dataset":"compras_editais","release":"20261123T080000-a188fd6ab002","seq":3,"reference":"2026-11-23T08:00:00-03:00","publisher":"Portal Nacional de Contratações Públicas (PNCP)"},"data_as_of":"2026-11-23T08:00:00-03:00","checked_at":"2026-11-23T09:53:52-03:00","coverage":{"scope":"all_pncp_platforms","note":"Purchase headers published in PNCP by every platform (federal, state and municipal systems), collected by a daily refresh of the purchases taking bids and of the recent publication days. Older purchases are not back-filled; between refreshes, new publications and changes are missing (see data_as_of).","collected_since":"2026-11-21T08:00:00-03:00"},"query":{"situacao":"aberta","uf":null,"valor_min":100000,"encerramento_ate":null,"publicacao_desde":null,"modalidade":null,"objeto":null,"normalized":null,"ordem":"encerramento"},"count_unit":"purchase","count":1,"page_size":1,"next_cursor":"…","interpretation":"listed_records","items":[{"numero_controle_pncp":"00394460000141-1-000001/2026","objeto_compra":"Aquisição de seringas descartáveis","informacao_complementar":null,"modalidade_id":6,"modalidade_nome":"Pregão - Eletrônico","modo_disputa_id":1,"modo_disputa_nome":"Aberto","tipo_instrumento_convocatorio_codigo":1,"tipo_instrumento_convocatorio_nome":"Edital","situacao_compra_id":1,"situacao_compra_nome":"Divulgada no PNCP","srp":false,"valor_total_homologado":null,"ano_compra":2026,"sequencial_compra":1,"numero_compra":"00001","processo":"1/2026","data_publicacao_pncp":"2026-11-20T10:00:00","data_abertura_proposta":"2026-11-20T08:00:00","data_encerramento_proposta":"2099-01-10T09:00:00","data_inclusao":"2026-11-20T10:00:00","data_atualizacao":"2026-11-20T10:00:00","data_atualizacao_global":"2026-11-20T10:00:00","unidade_sub_rogada":null,"orgao_sub_rogado":null,"link_sistema_origem":"https://cnetmobile.estaleiro.serpro.gov.br/x","link_processo_eletronico":null,"justificativa_presencial":null,"emenda_parlamentar":null,"fontes_orcamentarias":[{"nome":"Federal","codigo":4,"descricao":"Recurso federal","dataInclusao":"2026-11-20T10:00:00"}],"aberta":true,"valor_total_estimado":150000,"valor_total_estimado_status":"informed","orgao_entidade":{"cnpj":"00394460000141","razao_social":"MINISTÉRIO SINTÉTICO","poder_id":"E","esfera_id":"F"},"unidade_orgao":{"uf_sigla":"SP","uf_nome":"São Paulo","municipio_nome":"São Paulo","codigo_ibge":"3550308","codigo_unidade":"170001","nome_unidade":"UNIDADE SINTÉTICA"},"amparo_legal":{"codigo":1,"nome":"Lei 14.133/2021, Art. 28, I","descricao":"pregão"},"pncp_url":"https://pncp.gov.br/app/editais/00394460000141/2026/1"}]}
```

## ANP fuel stations and fines

`GET /api/anp/v1/resellers?cnpj=<CNPJ or base>` and `GET /api/anp/v1/fines?cnpj=<CNPJ or base>`

Two open files of the national petroleum, natural gas and biofuels agency ANP (catalog domain `energia`, the database schema name), looked up by company number like the CGU lists: a complete CNPJ or a base looks up the 8-character base; `match` is `exact_cnpj` when the record's number is the given CNPJ, else `same_base_number`. No match is 200 with no items and `interpretation: "no_listed_record_is_not_a_clearance"`; not loaded is 503 `DATA_UNAVAILABLE`; a cursor of an earlier release is 409. Both also appear in "All lists of one company".

**Active retail fuel stations** (`resellers`, dataset `anp_revendedores`): the register of retail stations authorised by ANP, from `dados-cadastrais-revendedores-varejistas-combustiveis-automoveis.csv` (`source.reference` is the "updated on" date of the ANP page, because the file itself is undated).

- **Items**: one per station (`count_unit`: `"station"`), paged by `codigoisimp` (the ANP station code), with the official columns as published (`autorizacao`, `razaosocial`, `cnpj`, address, `uf`, `municipio`, `bandeira` = the fuel brand or `BANDEIRA BRANCA` for unbranded) except `datapublicacao` and `datavinculacao` (brand link date), which are ISO dates (`null` when blank in the source).
- The file lists **active stations only**: a station that leaves it is closed in the history, so it no longer appears here. `notes` state that a CNPJ without a station is not proven inactive or irregular, and that being listed is not an inspection result.

```json sample=anp-revendedores
{"source":{"dataset":"anp_revendedores","release":"2026-11-19-21e2c7cd3e0b","seq":1,"reference":"2026-11-19","publisher":"Agência Nacional do Petróleo, Gás Natural e Biocombustíveis (ANP)"},"notes":["The ANP file lists active retail fuel stations only; a CNPJ without a station here may be inactive, another kind of fuel agent, or not a fuel business.","Being listed shows an ANP authorisation as published in open data; it is not an inspection result."],"query":{"cnpj":"11111111000101","cnpj_basico":"11111111"},"count_unit":"station","count":1,"page_size":1,"next_cursor":"…","interpretation":"listed_records","items":[{"codigoisimp":"1001","autorizacao":"PR/SP1001","datapublicacao":"2005-07-26","razaosocial":"AUTO POSTO SINTÉTICO LTDA","cnpj":"11111111000101","endereco":"AVENIDA SINTÉTICA,  500","complemento":"","bairro":"CENTRO","cep":"01001000","uf":"SP","municipio":"SAO PAULO","bandeira":"VIBRA","datavinculacao":"2005-07-26","match":"exact_cnpj"}]}
```

**Fines** (`fines`, dataset `anp_multas`): fines from ANP inspection actions with due dates from 2016, one file per year (2016 to 2019 in one file); ANP extracts each file once, at the end of its year, and every file is loaded as one release (`source.reference` is the "updated on" date of the ANP page).

- **Items**: one per record of one yearly file (`count_unit`: `"fine_record"`), paged by (`arquivo`, `numero_do_processo`, `auto_de_infracao`, `numero_do_duf`). `arquivo` is the file's year label (`"2016a2019"`, `"2020"` … `"2025"`). The same fine can appear in several years' files, each with that year's status, so it can be more than one item.
- **Columns**: the infraction document is `auto_de_infracao` in the files of 2016 to 2021 and `numero_do_duf` from 2022 (the other is `""`). `vencimento` (due date; named `Vencimento`, `Vencimento da Multa` or `Vencimento GRM` in the files) and `data_transito_julgado` (final decision date, only in the files of 2016 to 2022, else `null`) are ISO dates. `status_processo`, `valor_da_multa` and `valor_total_pago` are the published text in each file's own format (`"33000,00"`, `"R$ 33.000,00"`, `"R$ -"`): the status is the one at that year's extraction and nothing is recomputed, so it does not say whether a fine is paid or still due today. `coluna_sem_titulo` is a column with an empty header in the 2024 file (`"SIM"` on some paid records; not documented by ANP), as published, `null` for the other files.
- **Individuals**: an 11-digit CPF in `cnpj_cpf` is stored and returned masked as `***NNNNNN**` and has no base, so it never matches a lookup.
- `source.files` lists each loaded file in `arquivo` order with its file name and report title, which carries the extraction date (such as `Relatório extraído em janeiro/2026`).

```json sample=anp-multas
{"source":{"dataset":"anp_multas","release":"2026-08-24-a41e012b2395","seq":1,"reference":"2026-08-24","publisher":"Agência Nacional do Petróleo, Gás Natural e Biocombustíveis (ANP)","files":[{"arquivo":"2024","file":"multas-aplicadas-2024.csv","title":"ANP - Agência Nacional do Petroleo, Gás Natural e Biocombustíveis | RELAÇÃO DE MULTAS APLICADAS EM 2024  (Relatório extraído em março/2025) | Fonte: Sistema de Controle de Multas - SICOM"},{"arquivo":"2025","file":"multas-aplicadas-2025.csv","title":"ANP - Agência Nacional do Petroleo, Gás Natural e Biocombustíveis | RELAÇÃO DE MULTAS APLICADAS EM 2025  (Relatório extraído em janeiro/2026) | Fonte: Sistema de Controle de Multas - SICOM"}]},"notes":["One item per record of one yearly ANP file (`arquivo`); a fine can appear in several years with the status of each year.","status_processo is the status at that year's extraction (ANP extracts once a year), as published; it is not recomputed and may be outdated.","Amounts are the published text, in the format of each file."],"query":{"cnpj":"11111111000101","cnpj_basico":"11111111"},"count_unit":"fine_record","count":1,"page_size":1,"next_cursor":"…","interpretation":"listed_records","items":[{"arquivo":"2016a2019","numero_do_processo":"4861","auto_de_infracao":"401","numero_do_duf":"","status_processo":"Aguardando Pagamento","superintendencia":"SFI-SP","cnpj_cpf":"11111111000101","razao_social":"AUTO POSTO SINTÉTICO LTDA","data_transito_julgado":"2016-07-14","vencimento":"2016-07-13","valor_da_multa":"33000,00","valor_total_pago":"0,00","coluna_sem_titulo":null,"match":"exact_cnpj"}]}
```

## Customs tables and NCM (Receita Federal)

`GET /api/customs/v1/releases?dataset=<id>`, `GET /api/customs/v1/tables`, `GET /api/customs/v1/records?table=<id>`, `GET /api/customs/v1/ncm` and `GET /api/customs/v1/tax-rates`

Official customs reference data of the Receita Federal for a consumer that copies it whole (catalog domain `aduana`, the database schema name). Three datasets, each published as releases of complete snapshots:

- **`aduana_tabelas`**: the Siscomex customs tables of the Tabelas Aduaneiras site (countries, currencies, LOCODE, legal bases, packaging types, …). One release holds every table of one collected batch; each table is identified by `tabela` (a lower-case id such as `locode`, `moeda`) and comes from one official file. The site requires a captcha, so its exports and the reviewed captures of its list and detail pages are collected by hand; tables whose export is incomplete are completed from those official pages under a review that pins every captured file by SHA-256.
- **`aduana_ncm`**: the current NCM classification from the public Siscomex Classif download.
- **`aduana_aliquotas`**: the import tax rate details (II, Mercosul, IPI, PIS/PASEP, COFINS with their validity, and the Mercosul unit) of every 8-digit NCM, captured from the Tabelas Aduaneiras detail pages against one exact Classif file.

Common rules:

- **Releases**: every read takes an optional `release=<seq>`; without it the current release is read. Any release that was published (and not withdrawn) stays readable, so a consumer can read an exact earlier snapshot. A malformed `release` is 400 `INVALID_RELEASE`, a seq that was never published is 404 `RELEASE_NOT_FOUND`, a dataset with nothing published is 503 `DATA_UNAVAILABLE`. `source` names the release read (`release`, `seq`, `reference`: the batch date, `published_at`, `current`). `GET /api/customs/v1/releases?dataset=` lists the published releases of one of the three datasets, newest first (400 `INVALID_QUERY` for any other dataset).
- **Records** (`records`, `ncm`, `tax-rates`): `record_key` identifies a record across releases (the code field, then every identity field — codes, `sigla`, legal act fields, validity dates, `pais`, `ocorrencia` — sorted, as `name=value` pairs with URI-encoded values joined by `&`); `codigo` is the code field; `descricao` the description field (the code when the table has none); `inicio` and `fim` the validity dates as `YYYY-MM-DD` when they are real days (`null` for blank, `-` or a record without validity fields); `campos` holds every official field as the exact published string, in the official field order (nested export elements become `parent_child`, repeated ones `parent_N_child`; `ocorrencia` numbers official rows that share every identity field). Items are in `record_key` order (byte order); `count_unit` is `"record"`.
- **Files**: `tables` lists the tables of the release, one item per table (`count_unit: "table"`): its official name, the file name in the batch, the file's `sha256` and `bytes`, `source_url`, `source_generated_at` (the export's own "generated at" text, `""` when none), `captured_at` (ISO 8601 as recorded), `registros` (record count) and `vazio_verificado`. A table with `registros: 0` is always a verified empty table (`vazio_verificado: true`: the official query showed no record); a table missing from a release is not part of it, which is not the same as empty. `records` answers 404 `TABLE_NOT_FOUND` for a table not in the release read and gives that table's item as `source.file` (its `query` echo names the `table` parameter `tabela`, the internal name); `ncm` and `tax-rates` give their one file as `source.file` (with `tabela` `ncm-nivel-6-subitem` and `ncm-tax-details`).
- **Pages**: `page_size` 1–100 and `cursor` as everywhere; a cursor is bound to the endpoint, the table and the release read, so a cursor taken without `release` is 409 `RELEASE_CHANGED` once another release becomes current. Pass `release=<seq>` to page through one snapshot regardless of publications.

```json sample=customs-releases
{"source":{"dataset":"aduana_tabelas","release":"2026-11-20-07a855df5dbc","seq":2,"reference":"2026-11-20","published_at":"2026-11-26T09:20:20-03:00","current":true,"publisher":"Receita Federal do Brasil"},"query":{"dataset":"aduana_tabelas"},"count_unit":"release","count":1,"page_size":1,"next_cursor":"…","items":[{"seq":2,"label":"2026-11-20-07a855df5dbc","reference":"2026-11-20","published_at":"2026-11-26T09:20:20-03:00","current":true}]}
```

```json sample=customs-tabelas
{"source":{"dataset":"aduana_tabelas","release":"2026-11-20-07a855df5dbc","seq":2,"reference":"2026-11-20","published_at":"2026-11-26T09:20:20-03:00","current":true,"publisher":"Receita Federal do Brasil"},"query":{"release":null},"count_unit":"table","count":1,"page_size":1,"next_cursor":"…","items":[{"tabela":"mercadoria-controlada","nome_oficial":"MERCADORIA CONTROLADA","arquivo":"mercadoria-controlada.json","sha256":"18f4869228dd3899c52dae1a8146585033f181512da23a3a4cfaa8ef15fa0dee","bytes":537,"source_url":"https://www35.receita.fazenda.gov.br/tabaduaneiras-web/private/pages/telaInicial.jsf","source_generated_at":"17/11/2026 03:51:37","captured_at":"2026-11-17T08:10:55.761Z","registros":0,"vazio_verificado":true}]}
```

```json sample=customs-registros
{"source":{"dataset":"aduana_tabelas","release":"2026-11-18-5f4a605a5767","seq":1,"reference":"2026-11-18","published_at":"2026-11-26T09:20:20-03:00","current":false,"publisher":"Receita Federal do Brasil","file":{"tabela":"moeda","nome_oficial":"MOEDA","arquivo":"moeda.xml","sha256":"6c60969cd63bf3f6060a1d019d334c62da39728f801a4a39d68ca53d9759777d","bytes":643,"source_url":"https://www35.receita.fazenda.gov.br/tabaduaneiras-web/private/pages/telaInicial.jsf","source_generated_at":"16/11/2026 03:49:49","captured_at":"2026-11-16T20:11:54.059Z","registros":3,"vazio_verificado":false}},"query":{"tabela":"moeda","release":1},"count_unit":"record","count":1,"page_size":1,"next_cursor":"…","items":[{"record_key":"codigo=005&fimVigencia=-&inicioVigencia=22%2F04%2F2024","codigo":"005","descricao":"AFEGANE/AFEGANIST.","inicio":"2024-04-22","fim":null,"campos":{"codigo":"005","descricao":"AFEGANE/AFEGANIST.","inicioVigencia":"22/04/2024","fimVigencia":"-"}}]}
```

```json sample=customs-ncm
{"source":{"dataset":"aduana_ncm","release":"2026-11-16-b2897c90d5db","seq":1,"reference":"2026-11-16","published_at":"2026-11-26T09:20:20-03:00","current":true,"publisher":"Receita Federal do Brasil","file":{"tabela":"ncm-nivel-6-subitem","nome_oficial":"NCM - NÍVEL 6 - SUBITEM","arquivo":"classif-ncm.json","sha256":"b2897c90d5dbc73b88b499938cf7e2098624f2d9e8c3dce5e9ef0d0abef1624e","bytes":1058,"source_url":"https://portalunico.siscomex.gov.br/classif/api/publico/nomenclatura/download/json?perfil=PUBLICO","source_generated_at":"","captured_at":"2026-11-16T20:36:49-03:00","registros":5}},"query":{"release":null},"count_unit":"record","count":1,"page_size":1,"next_cursor":"…","items":[{"record_key":"codigo=01&anoAtoLegal=2021&fimVigencia=31%2F12%2F9999&inicioVigencia=01%2F04%2F2022&numeroAtoLegal=272&tipoAtoLegal=Res%20Camex","codigo":"01","descricao":"Animais vivos.","inicio":"2022-04-01","fim":"9999-12-31","campos":{"codigo":"01","codigoOriginal":"01","descricao":"Animais vivos.","inicioVigencia":"01/04/2022","fimVigencia":"31/12/9999","tipoAtoLegal":"Res Camex","numeroAtoLegal":"272","anoAtoLegal":"2021"}}]}
```

```json sample=customs-aliquotas
{"source":{"dataset":"aduana_aliquotas","release":"2026-11-17-e5da9c2420cd","seq":1,"reference":"2026-11-17","published_at":"2026-11-26T09:20:20-03:00","current":true,"publisher":"Receita Federal do Brasil","file":{"tabela":"ncm-tax-details","nome_oficial":"DETALHES DE ALÍQUOTAS NCM","arquivo":"ncm-tax-details.json","sha256":"e5da9c2420cd8d31effbbade49e769793c9b6dda280efbafcc1a26346ef63231","bytes":5339,"source_url":"https://www35.receita.fazenda.gov.br/tabaduaneiras-web/private/pages/subItemNcm_listar.jsf","source_generated_at":"","captured_at":"2026-11-17T22:28:00.202Z","registros":2}},"query":{"release":null},"count_unit":"record","count":1,"page_size":1,"next_cursor":"…","items":[{"record_key":"codigo=01012100","codigo":"01012100","descricao":"Mercadoria 01012100","inicio":null,"fim":null,"campos":{"codigo":"01012100","descricao":"Mercadoria 01012100","iiAliquota":"10,8","iiVigenciaInicio":"01/04/2022","iiVigenciaFim":"","mercosulAliquota":"10,8","mercosulVigenciaInicio":"01/04/2022","mercosulVigenciaFim":"","ipiAliquota":"10,8","ipiVigenciaInicio":"01/04/2022","ipiVigenciaFim":"","pisAliquota":"10,8","pisVigenciaInicio":"01/04/2022","pisVigenciaFim":"","pisSpecificAliquota":"0","pisSpecificVigenciaInicio":"01/04/2022","pisSpecificVigenciaFim":"","cofinsAliquota":"10,8","cofinsVigenciaInicio":"01/04/2022","cofinsVigenciaFim":"","cofinsSpecificAliquota":"0","cofinsSpecificVigenciaInicio":"01/04/2022","cofinsSpecificVigenciaFim":"","unidadeCodigo":"10","unidadeDescricao":"QUILOGRAMA LIQUIDO","sourcePage":"https://www35.receita.fazenda.gov.br/tabaduaneiras-web/private/pages/subItemNcm_listar.jsf","capturedAt":"2026-11-17T22:20:00.000Z","htmlSha256":"36516ed7026b1bc182a8b227ca156529539578470a8b36618cd01952aa73bd4f","classificationSource":"https://portalunico.siscomex.gov.br/classif/api/publico/nomenclatura/download/json?perfil=PUBLICO","classificationSha256":"b2897c90d5dbc73b88b499938cf7e2098624f2d9e8c3dce5e9ef0d0abef1624e"}}]}
```

## Customs exchange rate (PTAX)

`GET /api/customs/v1/exchange-rates?currency=<code>[&date=YYYY-MM-DD]`

The exchange rate for customs duties on reference date `date` (a Brasília calendar day; default today in Brasília): the Banco Central do Brasil PTAX **closing selling rate** of the last business day **before** that date, the rule of Portaria SRF nº 87/1999 (the Siscomex rate valid from a day is the previous business day's PTAX closing). Dataset `ptax` (catalog domain `aduana`), loaded from the Banco Central's public Olinda service (`CotacaoMoedaPeriodo`, closing bulletins `Fechamento` and `Fechamento PTAX`; opening and intermediate bulletins are not used). Weekends and holidays are skipped: for a Monday the answer is Friday's closing, after a Friday holiday Thursday's.

- `currency`: required, a three-letter code of the Banco Central's PTAX currency list (`Moedas`: AUD, CAD, CHF, DKK, EUR, GBP, JPY, NOK, SEK, USD as of 2026-11), any case; answered in upper case.
- The answer: `currency`, `currency_name` and `currency_type` (the official `nomeFormatado` and `tipoMoeda`), `reference_date` (the date asked), `quote_date` (the business day whose closing applies), `quoted_at` (the closing bulletin's official time, ISO 8601 with the Brasília offset), `bulletin` (the official `tipoBoletim`, `Fechamento` or `Fechamento PTAX`), `rate` and `official_url`.
- `rate` is a decimal string: Brazilian reais per one unit of the currency (also for `currency_type` `B` currencies such as EUR), the official `cotacaoVenda` with only trailing zeros removed (published `5.65180` is `"5.6518"`, `0.03535` stays `"0.03535"`); never rounded or computed. Parse it as a decimal, not a binary float.
- `official_url` is the Olinda query (`CotacaoMoedaDia`) that returns that currency's bulletins of `quote_date`, the closing among them.
- `source`: `dataset`, `release`, `seq`, `reference` (the last day that release confirmed), `published_at`, `current` (always `true`), `publisher` (`Banco Central do Brasil`), `loaded_through` (the last day whose closings are confirmed loaded: the business day lookup never crosses it) and `checked_at` (when that was confirmed). The data is refreshed daily; a refresh that finds no new closing publishes no release but moves `loaded_through`.

Errors (never an older rate in place of one that is not loaded):

| Status | Code | When |
| --- | --- | --- |
| 400 | `INVALID_QUERY` | `currency` missing or not three letters, `date` not a real `YYYY-MM-DD` day, an unknown or repeated parameter |
| 404 | `CURRENCY_NOT_SUPPORTED` | the code is not in the PTAX currency list; `error.currencies` lists the supported codes |
| 404 | `RATE_NOT_LOADED` | the day before `date` is after `loaded_through` (closings not loaded that far yet, or a future date); `error.loaded_through` |
| 404 | `DATE_OUT_OF_RANGE` | the day before `date` is before the loaded range, or no closing lies between its start and that day; `error.covered_from` |
| 404 | `RATE_NOT_FOUND` | no closing of the currency in the 10 days before `date` inside the loaded range (a currency no longer quoted) |
| 503 | `DATA_UNAVAILABLE` | the dataset is not loaded |

```json sample=customs-exchange-rate
{"source":{"dataset":"ptax","release":"20261126T145506-90403439724c","seq":1,"reference":"2026-11-26","published_at":"2026-11-26T14:55:23-03:00","current":true,"publisher":"Banco Central do Brasil","loaded_through":"2026-11-26","checked_at":"2026-11-26T14:55:42-03:00"},"query":{"currency":"USD","date":"2026-11-14"},"currency":"USD","currency_name":"Dólar dos Estados Unidos","currency_type":"A","reference_date":"2026-11-14","quote_date":"2026-11-13","quoted_at":"2026-11-13T13:03:27.375-03:00","bulletin":"Fechamento","rate":"5.6518","official_url":"https://olinda.bcb.gov.br/olinda/servico/PTAX/versao/v1/odata/CotacaoMoedaDia(moeda=@moeda,dataCotacao=@dataCotacao)?@moeda='USD'&@dataCotacao='11-13-2026'&$format=json"}
```
