Government — entry 003 of 90
Brazil
BrasilAPI is a community-maintained, open-source project — not an official government service — that aggregates and normalizes public Brazilian registries into one keyless REST API. A live `GET /api/cep/v1/{cep}` call confirmed the postal-code lookup works with no key over HTTPS with a wildcard `Access-Control-Allow-Origin` header; the same gateway also fronts CNPJ business-registry lookups, bank/ISPB codes, DDD area codes, national holidays, and IBGE municipality data, each sourced from the relevant official agency. Because it re-serves government data rather than being run by a government body, treat it as a convenience layer, not a primary source for compliance-grade queries.
BrasilAPI is a community-maintained aggregator that re-serves Brazilian public registries — postal codes, CNPJ business records, bank codes, and national holidays — through one keyless REST gateway. A live GET this run against /cep/v1/01001000 returned a genuine 118 B address object at HTTP 200 with access-control-allow-origin: * and no key, signup, or credit card of any kind.
GreatAPIs Score
Auth quickstart
- No API key, signup, or credit card required — a live GET this run against
/cep/v1/01001000returned HTTP 200 with a full address object and a wildcardAccess-Control-Allow-Originheader on the first anonymous try.
Your key is stored only in this browser (localStorage) and sent directly to the API — never to greatapis.
Look up an address by CEP (postal code)
GEThttps://brasilapi.com.br/api/cep/v1/01001000
{"cep":"01001000","state":"SP","city":"São Paulo","neighborhood":"Sé","street":"Praça da Sé","service":"open-cep"}A live GET this run against /cnpj/v1/19131243000197 (Open Knowledge Brasil's own CNPJ) returned a genuine 2,991 B business-registry record at HTTP 200, including registered address, cnae_fiscal activity code, and a qsa array of partners — confirming the same gateway also fronts the Receita Federal company registry, not just postal codes.
Try it
Developer reference
https://brasilapi.com.br/api- GET/cep/v1/{cep}
- GET/cnpj/v1/{cnpj}
- GET/banks/v1
Gotchas & limits
- A CEP with no match is a real HTTP 404, but the body is a multi-provider error object, not a simple message string — a live GET this run against
/cep/v1/00000000returned exactly 547 B:{"message":"Todos os serviços de CEP retornaram erro.","type":"service_error","name":"CepPromiseError","errors":[...]}with one nestederrors[]entry per upstream provider BrasilAPI tried (correios,viacep,widenet,correios-alt) and failed. /feriados/v1/{year}only covers 1900 through 2199 — a live GET this run against/feriados/v1/1600returned HTTP 404 with body{"message":"Ano fora do intervalo suportado entre 1900 e 2199.","type":"feriados_range_error","name":"NotFoundError"}(117 B), while/feriados/v1/2100inside the range answered a normal 200./banks/v1mixes real banks with non-bank settlement systems that carrycode: null— a live GET this run confirmed the entry{"ispb":"00038121","name":"Selic","code":null,"fullName":"Banco Central do Brasil - Selic"}in the same array as normal numbered banks like Banco do Brasil (code: 1). Code that assumes every list entry has a numeric bank code will getnullfor Selic.- The
/cnpjpartner (qsa) list privacy-masks CPF numbers rather than omitting them — the live Open Knowledge Brasil lookup above returned"cnpj_cpf_do_socio":"***112108**"for its listed partner: a real field that looks like a usable identifier but is a redacted string, not a real CPF, so it cannot be used to cross-reference partners across different companies.