{"openapi":"3.1.0","info":{"title":"Brazilayer — Brazilian Company Data (CNPJ)","version":"0.1.0","description":"Official registration data for all Brazilian companies, from the Receita Federal\n(Brazilian IRS) public CNPJ registry, updated monthly. Paid endpoints use the x402\npayment protocol (USDC on Base): calling without payment returns HTTP 402 with a\n`payment-required` header describing price and pay-to address; pay and retry.\nResponse keys are in Portuguese, mirroring official Brazilian legal terms.\nFree sample at GET /v1/cnpj/amostra. Terms: /termos (Portuguese).\n","contact":{"email":"contato@brazilayer.com"}},"servers":[{"url":"https://api.brazilayer.com"},{"url":"http://159.195.38.228"}],"paths":{"/v1/health":{"get":{"summary":"Service status and data reference month (free)","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok","degradado"]},"servico":{"type":"string"},"base_referencia":{"type":["string","null"],"description":"Reference month (YYYY-MM) of the loaded registry"}}}}}}}}},"/v1/ferramentas":{"get":{"summary":"Free tools index — no payment, no limit, no signup","responses":{"200":{"description":"List of the free tools below"}}}},"/v1/ferramentas/cnpj/{valor}":{"get":{"summary":"Validate and normalize a Brazilian company tax ID, CNPJ (free)","description":"Check digits, normalized 14-digit form, punctuated form, 8-digit root (economic group) and headquarters/branch flag. Pure arithmetic — no database lookup. Use it before paying: an invalid CNPJ never resolves in any paid endpoint.","parameters":[{"name":"valor","in":"path","required":true,"schema":{"type":"string"},"description":"CNPJ with or without punctuation"}],"responses":{"200":{"description":"Validation result","content":{"application/json":{"schema":{"type":"object","properties":{"valido":{"type":"boolean"},"motivo":{"type":["string","null"],"enum":["formato_invalido","digito_verificador_invalido",null]},"cnpj":{"type":"string","description":"normalized 14 digits"},"formatado":{"type":"string","example":"00.000.000/0001-91"},"raiz":{"type":"string","description":"8-digit root","shared by the group":null},"matriz":{"type":"boolean","description":"true = headquarters","false = branch":null}}}}}}}}},"/v1/ferramentas/cpf/{valor}":{"get":{"summary":"Validate a Brazilian personal tax ID, CPF (free)","description":"Check-digit validation only. Pure arithmetic: nothing is stored or looked up, and the response never echoes the full number — only the masked form.","parameters":[{"name":"valor","in":"path","required":true,"schema":{"type":"string"},"description":"CPF with or without punctuation"}],"responses":{"200":{"description":"Validation result, with the number masked","content":{"application/json":{"schema":{"type":"object","properties":{"valido":{"type":"boolean"},"motivo":{"type":["string","null"],"enum":["formato_invalido","digito_verificador_invalido",null]},"mascarado":{"type":["string","null"],"example":"***444777**"}}}}}}}}},"/v1/cnpj/amostra":{"get":{"summary":"Free full sample (format of /v1/empresa/{cnpj}/completo) for one fixed CNPJ","responses":{"200":{"description":"Sample company bundle with `amostra: true`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmpresaCompleta"}}}}}}},"/v1/cnpj/situacao/{cnpj}":{"get":{"summary":"Does the CNPJ exist and is it active ($0.001 via x402)","parameters":[{"$ref":"#/components/parameters/cnpj"}],"responses":{"200":{"description":"Existence and registration status (a non-existent CNPJ still returns 200, with existe=false)","content":{"application/json":{"schema":{"type":"object","properties":{"cnpj":{"type":"string"},"existe":{"type":"boolean"},"situacao_cadastral":{"type":"object","nullable":true,"properties":{"codigo":{"type":"string"},"descricao":{"type":"string","nullable":true},"data":{"type":"string","nullable":true}}},"matriz_filial":{"type":"string","nullable":true},"uf":{"type":"string","nullable":true},"fonte":{"$ref":"#/components/schemas/Fonte"}}}}}},"400":{"$ref":"#/components/responses/Erro"},"402":{"$ref":"#/components/responses/PagamentoExigido"}}}},"/v1/cnpj/empresa/{cnpj}":{"get":{"summary":"Company registration data ($0.005 via x402)","parameters":[{"$ref":"#/components/parameters/cnpj"}],"responses":{"200":{"description":"Registration card","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Empresa"}}}},"400":{"$ref":"#/components/responses/Erro"},"402":{"$ref":"#/components/responses/PagamentoExigido"},"404":{"$ref":"#/components/responses/Erro"}}}},"/v1/cnpj/empresa/{cnpj}/socios":{"get":{"summary":"Partners/shareholders of a company ($0.005 via x402)","parameters":[{"$ref":"#/components/parameters/cnpj"}],"responses":{"200":{"description":"Partners list","content":{"application/json":{"schema":{"type":"object","properties":{"cnpj":{"type":"string"},"total":{"type":"integer"},"socios":{"type":"array","items":{"$ref":"#/components/schemas/Socio"}},"fonte":{"$ref":"#/components/schemas/Fonte"}}}}}},"400":{"$ref":"#/components/responses/Erro"},"402":{"$ref":"#/components/responses/PagamentoExigido"},"404":{"$ref":"#/components/responses/Erro"}}}},"/v1/cnpj/empresa/{cnpj}/completo":{"get":{"summary":"Bundle: registration + partners + branches ($0.01 via x402)","parameters":[{"$ref":"#/components/parameters/cnpj"}],"responses":{"200":{"description":"Full company profile","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmpresaCompleta"}}}},"400":{"$ref":"#/components/responses/Erro"},"402":{"$ref":"#/components/responses/PagamentoExigido"},"404":{"$ref":"#/components/responses/Erro"}}}},"/v1/cnpj/busca":{"get":{"summary":"Search companies ($0.01 via x402). At least one filter required.","parameters":[{"name":"nome","in":"query","schema":{"type":"string"},"description":"Full-text on legal and trade names (Portuguese","accent-insensitive)":null},{"name":"uf","in":"query","schema":{"type":"string","pattern":"^[A-Za-z]{2}$"},"description":"2-letter state code"},{"name":"municipio","in":"query","schema":{"type":"string","pattern":"^\\d{4}$"},"description":"4-digit RFB city code"},{"name":"cnae","in":"query","schema":{"type":"string","pattern":"^\\d{7}$"},"description":"7-digit CNAE activity code"},{"name":"porte","in":"query","schema":{"type":"string","enum":["micro_empresa","pequeno_porte","demais","nao_informado"]}},{"name":"situacao","in":"query","schema":{"type":"string","enum":["ativa","baixada","suspensa","inapta","nula"],"default":"ativa"}},{"name":"pagina","in":"query","schema":{"type":"integer","default":1}},{"name":"por_pagina","in":"query","schema":{"type":"integer","default":20,"maximum":50}}],"responses":{"200":{"description":"Paginated results; total capped at \"10000+\"","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"oneOf":[{"type":"integer"},{"type":"string","const":"10000+"}]},"pagina":{"type":"integer"},"resultados":{"type":"array","items":{"type":"object","properties":{"cnpj":{"type":"string"},"razao_social":{"type":["string","null"]},"nome_fantasia":{"type":["string","null"]},"uf":{"type":["string","null"]},"municipio":{"type":["string","null"]},"cnae_principal":{"type":["string","null"]},"situacao":{"type":["string","null"]}}}},"fonte":{"$ref":"#/components/schemas/Fonte"}}}}}},"400":{"$ref":"#/components/responses/Erro"},"402":{"$ref":"#/components/responses/PagamentoExigido"}}}},"/v1/cnpj/socio/busca":{"get":{"summary":"Reverse lookup: companies where a person/entity is partner ($0.02 via x402)","parameters":[{"name":"nome","in":"query","required":true,"schema":{"type":"string","minLength":3},"description":"Person or entity name (full-text","accent-insensitive)":null},{"name":"pagina","in":"query","schema":{"type":"integer","default":1}},{"name":"por_pagina","in":"query","schema":{"type":"integer","default":20,"maximum":50}}],"responses":{"200":{"description":"Paginated results","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"oneOf":[{"type":"integer"},{"type":"string","const":"10000+"}]},"pagina":{"type":"integer"},"resultados":{"type":"array","items":{"type":"object","properties":{"nome_socio":{"type":["string","null"]},"cnpj":{"type":"string","description":"8-digit CNPJ root of the company"},"razao_social":{"type":["string","null"]},"qualificacao":{"$ref":"#/components/schemas/CodigoDescricao"},"data_entrada":{"type":["string","null"],"format":"date"}}}},"fonte":{"$ref":"#/components/schemas/Fonte"}}}}}},"400":{"$ref":"#/components/responses/Erro"},"402":{"$ref":"#/components/responses/PagamentoExigido"}}}},"/v1/integridade/consulta/{cnpj}":{"get":{"summary":"Sanctions & integrity screening, all official lists in one call ($0.01 via x402)","description":"Screens a Brazilian company against CEIS, CNEP, CEPIM, the slave-labor\nblacklist (MTE) and leniency agreements. Legal-entity records only.\nSources updated daily.\n","parameters":[{"$ref":"#/components/parameters/cnpj"}],"responses":{"200":{"description":"Screening result with per-list matches and clean-record flag","content":{"application/json":{"schema":{"type":"object","properties":{"cnpj":{"type":"string"},"total_apontamentos":{"type":"integer"},"ficha_limpa":{"type":"boolean"},"apontamentos":{"type":"object","properties":{"ceis":{"type":"array","items":{"type":"object"}},"cnep":{"type":"array","items":{"type":"object"}},"cepim":{"type":"array","items":{"type":"object"}},"trabalho_escravo":{"type":"array","items":{"type":"object"}},"acordos_leniencia":{"type":"array","items":{"type":"object"}}}}}}}}},"400":{"$ref":"#/components/responses/Erro"},"402":{"$ref":"#/components/responses/PagamentoExigido"}}}},"/v1/integridade/amostra":{"get":{"summary":"Free sample screening response (real sanctioned company)","responses":{"200":{"description":"Sample screening with `amostra: true`"}}}},"/v1/licitacoes/fornecedor/{cnpj}":{"get":{"summary":"All public contracts won by a company, with summary stats ($0.01 via x402)","parameters":[{"$ref":"#/components/parameters/cnpj"}],"responses":{"200":{"description":"Contracts list (max 100, newest first) + aggregates","content":{"application/json":{"schema":{"type":"object","properties":{"cnpj":{"type":"string"},"resumo":{"type":"object","properties":{"total_contratos":{"type":"integer"},"valor_total":{"type":"number"},"orgaos_distintos":{"type":"integer"}}},"contratos":{"type":"array","items":{"type":"object"}}}}}}},"400":{"$ref":"#/components/responses/Erro"},"402":{"$ref":"#/components/responses/PagamentoExigido"}}}},"/v1/licitacoes/abertas":{"get":{"summary":"Open government tenders, live from PNCP ($0.01 via x402)","parameters":[{"name":"uf","in":"query","schema":{"type":"string","pattern":"^[A-Za-z]{2}$"}},{"name":"modalidade","in":"query","schema":{"type":"string","default":"6"},"description":"PNCP modality code (6 = electronic auction)"},{"name":"pagina","in":"query","schema":{"type":"integer","default":1}},{"name":"por_pagina","in":"query","schema":{"type":"integer","default":20,"maximum":50}}],"responses":{"200":{"description":"Open tenders with deadlines and bidding links. Always 200 when the request is valid: if PNCP is slow or down, the last cached copy is served instead of an error. `fonte` always states what you got: `consultado_em` (when the data was collected from PNCP), `defasagem_segundos` (how old it is), `atualiza_a_cada_minutos` (fixed refresh cadence, 30) and `status` (`ok`, `cache_servido`, `fonte_indisponivel`). Expect staleness of minutes, never an error — PNCP itself takes 15-22s per query.","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"pagina":{"type":"integer"},"oportunidades":{"type":"array","items":{"type":"object"}},"fonte":{"type":"object","properties":{"base":{"type":"string"},"consultado_em":{"type":"string","nullable":true,"format":"date-time"},"defasagem_segundos":{"type":"integer","nullable":true},"atualiza_a_cada_minutos":{"type":"integer"},"cache":{"type":"boolean"},"status":{"type":"string","enum":["ok","cache_servido","fonte_indisponivel"]}}}}}}}},"400":{"$ref":"#/components/responses/Erro"},"402":{"$ref":"#/components/responses/PagamentoExigido"}}}},"/v1/licitacoes/amostra":{"get":{"summary":"Free sample of the supplier-contracts response","responses":{"200":{"description":"Sample with `amostra: true`"}}}},"/v1/bcb/instituicao/{cnpj}":{"get":{"summary":"Central Bank authorization check + verified domains ($0.005 via x402)","parameters":[{"$ref":"#/components/parameters/cnpj"}],"responses":{"200":{"description":"Authorization status, registrations and verified internet domains","content":{"application/json":{"schema":{"type":"object","properties":{"cnpj_basico":{"type":"string"},"autorizada":{"type":"boolean"},"registros":{"type":"array","items":{"type":"object"}},"dominios_verificados":{"type":"array","items":{"type":"string"}}}}}}},"400":{"$ref":"#/components/responses/Erro"},"402":{"$ref":"#/components/responses/PagamentoExigido"}}}},"/v1/bcb/amostra":{"get":{"summary":"Free sample of the Central Bank check response","responses":{"200":{"description":"Sample with `amostra: true`"}}}},"/v1/empresa/enriquecer/{cnpj}":{"get":{"summary":"Full KYB profile in one call — registration + partners + branches + sanctions + Central Bank + public contracts ($0.05 via x402)","parameters":[{"$ref":"#/components/parameters/cnpj"}],"responses":{"200":{"description":"Enriched company profile aggregating all four datasets","content":{"application/json":{"schema":{"type":"object","properties":{"cnpj":{"type":"string"},"cadastro":{"type":"object"},"integridade":{"type":"object"},"banco_central":{"type":"object"},"contratos_publicos":{"type":"object"},"fontes":{"type":"object"}}}}}},"402":{"$ref":"#/components/responses/PagamentoExigido"},"404":{"$ref":"#/components/responses/Erro"}}}},"/v1/empresa/amostra":{"get":{"summary":"Free sample of the enriched profile (a sanctioned company with public contracts)","responses":{"200":{"description":"Sample with `amostra: true`"}}}},"/v1/mercado/noticias":{"get":{"summary":"Brazilian financial & crypto news with sentiment, 15-min refresh ($0.002 via x402)","parameters":[{"name":"tema","in":"query","schema":{"type":"string","enum":["cripto","macro","cambio","regulacao","empresas"]}},{"name":"sentimento","in":"query","schema":{"type":"string","enum":["positivo","negativo","neutro"]}},{"name":"relevancia_min","in":"query","schema":{"type":"integer","minimum":0,"maximum":10}},{"name":"por_pagina","in":"query","schema":{"type":"integer","maximum":50}}],"responses":{"200":{"description":"Headlines with topic, sentiment, relevance and links"},"402":{"$ref":"#/components/responses/PagamentoExigido"}}}},"/v1/mercado/indicadores":{"get":{"summary":"Brazil macro snapshot — Selic, IPCA, PTAX, Focus survey medians ($0.002 via x402)","responses":{"200":{"description":"Key-value map of indicators with values, units and reference dates"},"402":{"$ref":"#/components/responses/PagamentoExigido"}}}},"/v1/mercado/cambio":{"get":{"summary":"Official PTAX + live BRL crypto premium, a capital-flow signal ($0.002 via x402)","responses":{"200":{"description":"PTAX and live BTC/USDT BRL prices with premium percentages"},"402":{"$ref":"#/components/responses/PagamentoExigido"}}}},"/v1/mercado/amostra":{"get":{"summary":"Free sample of the markets dataset (news + indicators)","responses":{"200":{"description":"Sample with `amostra: true`"}}}},"/v1/commodities/clima":{"get":{"summary":"Crop-weather stress per Brazilian producing belt — rain, drought, frost risk ($0.005 via x402)","responses":{"200":{"description":"Per-belt observed/forecast rain, dry days, 72h min temp, frost flag"},"402":{"$ref":"#/components/responses/PagamentoExigido"}}}},"/v1/commodities/fogo":{"get":{"summary":"Daily satellite fire hotspots by biome and state, with drought proxy ($0.002 via x402)","responses":{"200":{"description":"7-day biome series + leading states"},"402":{"$ref":"#/components/responses/PagamentoExigido"}}}},"/v1/commodities/exportacoes":{"get":{"summary":"Monthly Brazilian commodity exports with YoY change ($0.005 via x402)","responses":{"200":{"description":"FOB and KG per commodity per month"},"402":{"$ref":"#/components/responses/PagamentoExigido"}}}},"/v1/commodities/hidrologia":{"get":{"summary":"Stored hydro energy (EAR) by grid subsystem, daily ($0.002 via x402)","responses":{"200":{"description":"EAR percent per subsystem with 7-day delta"},"402":{"$ref":"#/components/responses/PagamentoExigido"}}}},"/v1/commodities/briefing":{"get":{"summary":"Daily AI-synthesized Brazil Commodity Briefing in English ($0.10 via x402)","responses":{"200":{"description":"Summary, per-commodity highlights with direction flags"},"402":{"$ref":"#/components/responses/PagamentoExigido"}}}},"/v1/commodities/amostra":{"get":{"summary":"Free sample of the commodity signals dataset","responses":{"200":{"description":"Sample with `amostra: true`"}}}},"/v1/fundos/fluxos":{"get":{"summary":"Daily net flows of Brazilian institutional money by fund class ($0.005 via x402)","parameters":[{"name":"dias","in":"query","schema":{"type":"integer","minimum":1,"maximum":60}}],"responses":{"200":{"description":"Latest day totals plus per-class series"},"402":{"$ref":"#/components/responses/PagamentoExigido"}}}},"/v1/fundos/consulta/{cnpj}":{"get":{"summary":"Verify a Brazilian investment fund at the CVM registry ($0.005 via x402)","parameters":[{"$ref":"#/components/parameters/cnpj"}],"responses":{"200":{"description":"Registration status, manager, administrator and latest NAV/assets"},"400":{"$ref":"#/components/responses/Erro"},"402":{"$ref":"#/components/responses/PagamentoExigido"}}}},"/v1/fundos/ranking":{"get":{"summary":"Rank Brazilian funds by net assets, inflows or shareholders ($0.01 via x402)","parameters":[{"name":"por","in":"query","schema":{"type":"string","enum":["patrimonio","captacao","cotistas"]}},{"name":"classificacao","in":"query","schema":{"type":"string"}},{"name":"dias","in":"query","schema":{"type":"integer"}},{"name":"limite","in":"query","schema":{"type":"integer","maximum":50}}],"responses":{"200":{"description":"Ranked funds with manager, assets, NAV and flows"},"402":{"$ref":"#/components/responses/PagamentoExigido"}}}},"/v1/fundos/carteira/{cnpj}":{"get":{"summary":"A fund's equity holdings from the CVM portfolio disclosure (CDA) ($0.01 via x402)","parameters":[{"$ref":"#/components/parameters/cnpj"}],"responses":{"200":{"description":"Stocks/BDRs held in the latest disclosed month: ticker, quantity, market value, bought and sold"},"400":{"$ref":"#/components/responses/Erro"},"402":{"$ref":"#/components/responses/PagamentoExigido"}}}},"/v1/fundos/movimentacoes":{"get":{"summary":"What Brazilian funds are buying and selling per stock — institutional net flow ($0.02 via x402)","parameters":[{"name":"competencia","in":"query","schema":{"type":"string"},"description":"month YYYY-MM (default latest consolidated)"},{"name":"limite","in":"query","schema":{"type":"integer","maximum":50}}],"responses":{"200":{"description":"Per ticker: amount bought, sold and net flow across disclosing funds"},"400":{"$ref":"#/components/responses/Erro"},"402":{"$ref":"#/components/responses/PagamentoExigido"}}}},"/v1/fundos/amostra":{"get":{"summary":"Free sample of the fund industry dataset","responses":{"200":{"description":"Sample with `amostra: true`"}}}},"/v1/tributos/ncm/{codigo}":{"get":{"summary":"IBS/CBS regime for a product by NCM, with legal basis ($0.005 via x402)","parameters":[{"name":"codigo","in":"path","required":true,"schema":{"type":"string"},"description":"NCM, 4-8 digits"},{"name":"ano","in":"query","schema":{"type":"string"},"description":"2026-2033"}],"responses":{"200":{"description":"Regime, legal grounds (annex/item/wording) and transition context"},"400":{"$ref":"#/components/responses/Erro"},"402":{"$ref":"#/components/responses/PagamentoExigido"}}}},"/v1/tributos/busca":{"get":{"summary":"Search tax-reform annexes by product/service description ($0.005 via x402)","parameters":[{"name":"termo","in":"query","required":true,"schema":{"type":"string","minLength":3}},{"name":"limite","in":"query","schema":{"type":"integer","maximum":30}}],"responses":{"200":{"description":"Annex entries with regime, NCMs cited and legal wording"},"402":{"$ref":"#/components/responses/PagamentoExigido"}}}},"/v1/tributos/calendario":{"get":{"summary":"Year-by-year Brazilian tax transition 2026-2033 ($0.002 via x402)","responses":{"200":{"description":"Taxes in force per year and extinction dates"},"402":{"$ref":"#/components/responses/PagamentoExigido"}}}},"/v1/tributos/amostra":{"get":{"summary":"Free sample of the tax reform dataset","responses":{"200":{"description":"Sample with `amostra: true`"}}}},"/v1/cadeias/energia_br":{"get":{"summary":"Causal chain — Brazilian power risk: rainfall leads reservoirs, thermal dispatch and tariff ($0.05 via x402)","responses":{"200":{"description":"Chain links, deterministic reading, rule applied and declared limits"},"402":{"$ref":"#/components/responses/PagamentoExigido"}}}},"/v1/cadeias/cafe_kc":{"get":{"summary":"Causal chain — Arabica coffee: dry days in the Minas belt lead yield and KC price ($0.05 via x402)","responses":{"200":{"description":"Chain links, deterministic reading, rule applied and declared limits"},"402":{"$ref":"#/components/responses/PagamentoExigido"}}}},"/v1/cadeias/soja_zs":{"get":{"summary":"Causal chain — soybeans: consecutive dry days in the Mato Grosso belt lead yield and shipped volume ($0.05 via x402)","responses":{"200":{"description":"Chain links, deterministic reading, rule applied and declared limits"},"402":{"$ref":"#/components/responses/PagamentoExigido"}}}},"/v1/cadeias/capital_br":{"get":{"summary":"Causal chain — Brazilian capital flight: the USDT premium over PTAX leads FX pressure ($0.05 via x402)","responses":{"200":{"description":"Chain links, deterministic reading, rule applied and declared limits"},"402":{"$ref":"#/components/responses/PagamentoExigido"}}}},"/v1/cadeias/amostra":{"get":{"summary":"Free sample of a full causal chain","responses":{"200":{"description":"Complete chain with `amostra: true`"}}}},"/v1/desmatamento/municipio/{ibge}":{"get":{"summary":"Deforestation profile of a Brazilian municipality since the EUDR cutoff ($0.01 via x402)","parameters":[{"name":"ibge","in":"path","required":true,"schema":{"type":"string"},"description":"IBGE code, 7 digits"}],"responses":{"200":{"description":"Area and alerts since 2020-12-31, windows, classes, ranking"},"400":{"$ref":"#/components/responses/Erro"},"402":{"$ref":"#/components/responses/PagamentoExigido"}}}},"/v1/desmatamento/fornecedor/{cnpj}":{"get":{"summary":"Supplier origin risk — CNPJ to its municipality's deforestation record ($0.02 via x402)","parameters":[{"$ref":"#/components/parameters/cnpj"}],"responses":{"200":{"description":"Company, municipality, regional exposure and methodological limits"},"402":{"$ref":"#/components/responses/PagamentoExigido"},"404":{"$ref":"#/components/responses/Erro"}}}},"/v1/desmatamento/ranking":{"get":{"summary":"Where Brazilian deforestation is concentrated ($0.01 via x402)","parameters":[{"name":"por","in":"query","schema":{"type":"string","enum":["municipio","uf"]}},{"name":"dias","in":"query","schema":{"type":"integer","maximum":2000}},{"name":"bioma","in":"query","schema":{"type":"string","enum":["amazonia","cerrado"]}},{"name":"limite","in":"query","schema":{"type":"integer","maximum":50}}],"responses":{"200":{"description":"Ranked municipalities or states by cleared area"},"402":{"$ref":"#/components/responses/PagamentoExigido"}}}},"/v1/desmatamento/amostra":{"get":{"summary":"Free sample of the deforestation dataset","responses":{"200":{"description":"National totals by biome + worst municipality"}}}}},"components":{"parameters":{"cnpj":{"name":"cnpj","in":"path","required":true,"schema":{"type":"string"},"description":"Brazilian company tax ID, 14 digits, with or without punctuation"}},"responses":{"Erro":{"description":"Error envelope: { erro: { codigo, mensagem } }","content":{"application/json":{"schema":{"type":"object","properties":{"erro":{"type":"object","properties":{"codigo":{"type":"string"},"mensagem":{"type":"string"}}}}}}}},"PagamentoExigido":{"description":"x402 payment required. The `payment-required` response header carries base64\nJSON with accepted payment options (scheme \"exact\", USDC on Base, amount in\n6-decimal units, payTo address). Sign an EIP-3009 authorization and retry with\nthe `payment-signature` header. x402 client libraries automate this.\n\nIf you are not using an x402 client, read the JSON body instead: it states the\nprice and links the free sample of this dataset plus the free tools.\n","content":{"application/json":{"schema":{"type":"object","properties":{"erro":{"type":"object","properties":{"codigo":{"type":"string","const":"pagamento_exigido"},"mensagem":{"type":"string"}}},"preco_usd":{"type":["number","null"]},"como_pagar":{"type":"object","properties":{"protocolo":{"type":"string","const":"x402"},"requisitos":{"type":"string"},"instrucoes":{"type":"string","format":"uri"}}},"gratis_agora":{"type":"array","description":"Free endpoints you can call right now, no payment","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"descricao":{"type":"string"}}}},"catalogo":{"type":"string","format":"uri"}}}}}}},"schemas":{"Fonte":{"type":"object","description":"Data source and reference month","properties":{"base":{"type":"string","const":"RFB/CNPJ"},"referencia":{"type":["string","null"],"description":"YYYY-MM"}}},"CodigoDescricao":{"type":"object","properties":{"codigo":{"type":["string","null"]},"descricao":{"type":["string","null"]}}},"Socio":{"type":"object","properties":{"nome":{"type":["string","null"]},"tipo":{"type":["string","null"],"enum":["pessoa_fisica","pessoa_juridica","estrangeiro",null]},"documento_mascarado":{"type":["string","null"],"description":"CPF comes pre-masked from the government source"},"qualificacao":{"$ref":"#/components/schemas/CodigoDescricao"},"data_entrada":{"type":["string","null"],"format":"date"},"faixa_etaria":{"type":["string","null"],"description":"age bracket, e.g. 41-50"},"representante_legal":{"type":["string","null"]}}},"Empresa":{"type":"object","properties":{"cnpj":{"type":"string","description":"14 digits"},"razao_social":{"type":["string","null"],"description":"legal name"},"nome_fantasia":{"type":["string","null"],"description":"trade name"},"matriz_filial":{"type":["string","null"],"enum":["matriz","filial",null]},"situacao_cadastral":{"type":"object","description":"registration status (Ativa = active, Baixada = closed)","properties":{"codigo":{"type":["string","null"]},"descricao":{"type":["string","null"]},"data":{"type":["string","null"],"format":"date"},"motivo":{"type":["string","null"]}}},"data_inicio_atividade":{"type":["string","null"],"format":"date"},"natureza_juridica":{"$ref":"#/components/schemas/CodigoDescricao"},"porte":{"type":["string","null"],"enum":["micro_empresa","empresa_pequeno_porte","demais","nao_informado",null]},"capital_social":{"type":["number","null"]},"cnae_principal":{"$ref":"#/components/schemas/CodigoDescricao"},"cnae_secundarios":{"type":"array","items":{"$ref":"#/components/schemas/CodigoDescricao"}},"endereco":{"type":"object","properties":{"logradouro":{"type":["string","null"]},"numero":{"type":["string","null"]},"complemento":{"type":["string","null"]},"bairro":{"type":["string","null"]},"municipio":{"type":["string","null"]},"uf":{"type":["string","null"]},"cep":{"type":["string","null"]}}},"contato":{"type":"object","properties":{"email":{"type":["string","null"]},"telefone":{"type":["string","null"]}}},"simples":{"type":"object","description":"Simples/MEI small-business tax regime flags","properties":{"optante":{"type":"boolean"},"mei":{"type":"boolean"}}},"fonte":{"$ref":"#/components/schemas/Fonte"}}},"EmpresaCompleta":{"allOf":[{"$ref":"#/components/schemas/Empresa"},{"type":"object","properties":{"socios":{"type":"array","items":{"$ref":"#/components/schemas/Socio"}},"total_socios":{"type":"integer"},"filiais":{"type":"array","items":{"type":"object","properties":{"cnpj":{"type":"string"},"uf":{"type":["string","null"]},"municipio":{"type":["string","null"]},"situacao":{"type":["string","null"]}}}}}}]}}}}