Every API here is available over the APIs.io API and to AI agents over MCP.
openapi: 3.2.0
info:
title: Pontofato Cep API
version: '1.0'
description: 'Operations tagged Cep across 2 of this provider''s published API definitions: pontofato-openapi-original.json, pontofato-openapi.json. Each path carries the servers of the definition it was published in.'
servers:
- url: https://pontofato.com
tags:
- name: Cep
paths:
/api/cep/{cep}:
get:
operationId: cep
summary: Pontos CNEFE de um CEP, com lat/lon IBGE — não é chute de mapa
description: 'Devolve: { cep, pontos[{cep,logradouro,numero,complemento,bairro,cidade,uf,lat,lon,ibge,especie,especie_label,tipo_edificacao,tipo_edificacao_codigo,estabelecimento,estabelecimentos,especies,setor,distrito,subdistrito,quadra,face,nv_geo,nv_geo_label,finalidade,indicador_estab,indicador_const,id_cnefe,tipo_logradouro,titulo_logradouro,nome_logradouro,modificador,unidades,complementos,_links,_origem}], resumo{address_count,edificios,bairro,cidade,uf,ibge,lat,lon,especies}, fonte, cobertura{ufs,completa}, _links }'
parameters:
- name: cep
in: path
required: true
schema:
type: string
responses:
'200':
description: '{ cep, pontos[{cep,logradouro,numero,complemento,bairro,cidade,uf,lat,lon,ibge,especie,especie_label,tipo_edificacao,tipo_edificacao_codigo,estabelecimento,estabelecimentos,especies,setor,distrito,subdistrito,quadra,face,nv_geo,nv_geo_label,finalidade,indicador_estab,indicador_const,id_cnefe,tipo_logradouro,titulo_logradouro,nome_logradouro,modificador,unidades,complementos,_links,_origem}], resumo{address_count,edificios,bairro,cidade,uf,ibge,lat,lon,especies}, fonte, cobertura{ufs,completa}, _links }'
content:
application/json:
schema:
$ref: '#/components/schemas/Cep'
'400':
description: CEP inválido (tamanho ou `00000000`).
'404':
description: CEP bem-formado fora da base; `cobertura` diz quais UFs já existem.
'503':
description: Origem sqlite fora.
tags:
- Cep
servers:
- url: https://pontofato.com
/api/cep/{cep}/unidades:
get:
operationId: unidades
summary: Unidades CNEFE de um CEP, com complemento, espécie e id — paginado
description: 'O lookup do CEP agrupa por logradouro+número. Esta rota devolve cada unidade (apartamento, loja) com o fato CNEFE. Sem `logradouro`/`numero`, pagina o CEP inteiro.
Devolve: { cep, items[{cep,logradouro,numero,complemento,bairro,cidade,uf,lat,lon,ibge,especie,especie_label,tipo_edificacao,tipo_edificacao_codigo,estabelecimento,estabelecimentos,especies,setor,distrito,subdistrito,quadra,face,nv_geo,nv_geo_label,finalidade,indicador_estab,indicador_const,id_cnefe,tipo_logradouro,titulo_logradouro,nome_logradouro,modificador,unidades,complementos,_links,_origem}], total, limit, offset, hasMore, cobertura{ufs,completa}, _links }'
parameters:
- name: cep
in: path
required: true
schema:
type: string
- name: logradouro
in: query
required: false
schema:
type: string
description: Logradouro exatamente como no lookup (tipo + nome).
- name: numero
in: query
required: false
schema:
type: string
description: Número do edifício no CNEFE.
- name: limit
in: query
required: false
schema:
type: integer
default: 50
description: Itens por página, teto 50.
- name: offset
in: query
required: false
schema:
type: integer
default: 0
description: Deslocamento 0-based.
responses:
'200':
description: '{ cep, items[{cep,logradouro,numero,complemento,bairro,cidade,uf,lat,lon,ibge,especie,especie_label,tipo_edificacao,tipo_edificacao_codigo,estabelecimento,estabelecimentos,especies,setor,distrito,subdistrito,quadra,face,nv_geo,nv_geo_label,finalidade,indicador_estab,indicador_const,id_cnefe,tipo_logradouro,titulo_logradouro,nome_logradouro,modificador,unidades,complementos,_links,_origem}], total, limit, offset, hasMore, cobertura{ufs,completa}, _links }'
content:
application/json:
schema:
$ref: '#/components/schemas/Unidades'
'400':
description: CEP inválido.
'404':
description: CEP fora da malha, ou o logradouro+número não existe nele.
tags:
- Cep
servers:
- url: https://pontofato.com
components:
schemas:
Cep:
type: object
properties:
cep:
type: string
description: CEP formatado `NNNNN-NNN`.
pontos:
type: array
items:
$ref: '#/components/schemas/Ponto'
description: Endereços distintos neste CEP (teto na origem).
resumo:
allOf:
- $ref: '#/components/schemas/Resumo'
description: Unidades, edifícios, espécies, bairro, cidade, UF e centroide.
fonte:
type: string
description: Sempre `cnefe-2022` neste produto.
cobertura:
allOf:
- $ref: '#/components/schemas/Cobertura'
description: UFs ingeridas agora.
_links:
type: object
description: '`self`, `empresas` e `unidades` absolutos.'
required:
- cep
- pontos
- resumo
- fonte
- cobertura
- _links
description: Pontos CNEFE de um CEP, com resumo e cobertura.
Resumo:
type: object
properties:
address_count:
type: integer
description: Unidades CNEFE no CEP (não é o número de prédios).
edificios:
type: integer
description: Logradouro+número distintos no CEP.
bairro:
type: string
description: Bairro mais frequente na amostra.
cidade:
type: string
description: Município IBGE.
uf:
type: string
description: Sigla da unidade da federação.
ibge:
type: string
description: Código IBGE do município.
nullable: true
lat:
type: number
description: Latitude média dos edifícios devolvidos.
nullable: true
lon:
type: number
description: Longitude média dos edifícios devolvidos.
nullable: true
especies:
type: array
items:
$ref: '#/components/schemas/EspecieContagem'
description: Unidades por espécie no CEP inteiro.
required:
- address_count
- edificios
- bairro
- cidade
- uf
- ibge
- lat
- lon
- especies
description: 'Síntese do CEP: quantos pontos, quantos edifícios, onde fica.'
EspecieContagem:
type: object
properties:
codigo:
type: string
description: Código IBGE da espécie (`1`–`8`).
nullable: true
label:
type: string
description: 'Rótulo: domicílio particular, ensino, saúde…'
nullable: true
n:
type: integer
description: Quantas unidades nesta espécie.
required:
- codigo
- label
- n
description: Quantas unidades CNEFE de uma espécie no recorte.
Ponto:
type: object
properties:
cep:
type: string
description: CEP formatado da unidade ou do edifício.
nullable: true
logradouro:
type: string
description: Tipo + nome do logradouro, já juntados.
numero:
type: string
description: Número no logradouro.
nullable: true
complemento:
type: string
description: Complementos do CNEFE, se houver.
nullable: true
bairro:
type: string
description: Localidade/bairro no cadastro.
cidade:
type: string
description: Município IBGE.
uf:
type: string
description: Sigla da unidade da federação.
lat:
type: number
description: Latitude WGS84 do ponto.
nullable: true
lon:
type: number
description: Longitude WGS84 do ponto.
nullable: true
ibge:
type: string
description: Código IBGE do município.
nullable: true
especie:
type: string
description: Código da espécie CNEFE (`1`–`8`).
nullable: true
especie_label:
type: string
description: Rótulo IBGE da espécie.
nullable: true
tipo_edificacao:
type: string
description: Casa, apartamento, vila — `COD_TIPO_ESPECIE`.
nullable: true
tipo_edificacao_codigo:
type: string
description: Código `101`–`104`.
nullable: true
estabelecimento:
type: string
description: Nome do estabelecimento, quando a espécie tem.
nullable: true
estabelecimentos:
type: array
items:
type: string
description: Nomes distintos no edifício (amostra).
nullable: true
especies:
type: array
items:
$ref: '#/components/schemas/EspecieContagem'
description: Mistura de espécies neste logradouro+número.
nullable: true
setor:
type: string
description: Setor censitário.
nullable: true
distrito:
type: string
description: Código de distrito IBGE.
nullable: true
subdistrito:
type: string
description: Código de subdistrito IBGE.
nullable: true
quadra:
type: string
description: Número da quadra no setor.
nullable: true
face:
type: string
description: Número da face da quadra.
nullable: true
nv_geo:
type: string
description: Nível de geocodificação (`1`–`6`).
nullable: true
nv_geo_label:
type: string
description: O que o nível de geo significa.
nullable: true
finalidade:
type: string
description: Residencial, não residencial, misto ou indeterminado.
nullable: true
indicador_estab:
type: string
description: Único ou múltiplo estabelecimento no endereço.
nullable: true
indicador_const:
type: string
description: Único ou múltiplo em construção/reforma.
nullable: true
id_cnefe:
type: string
description: '`COD_UNICO_ENDERECO` da unidade (só no detalhe).'
nullable: true
tipo_logradouro:
type: string
description: Tipo (RUA, AVENIDA…).
nullable: true
titulo_logradouro:
type: string
description: Título (DOUTOR…), se houver.
nullable: true
nome_logradouro:
type: string
description: Nome do logradouro sem o tipo.
nullable: true
modificador:
type: string
description: Modificador do número (SN, KM…).
nullable: true
unidades:
type: integer
description: Quantas unidades CNEFE neste logradouro+número (apartamentos, salas).
complementos:
type: integer
description: Complementos distintos no edifício.
nullable: true
_links:
type: object
description: '`unidades` absoluto para o detalhe paginado.'
nullable: true
_origem:
type: string
description: UF do sqlite que respondeu.
required:
- cep
- logradouro
- numero
- complemento
- bairro
- cidade
- uf
- lat
- lon
- ibge
- especie
- especie_label
- tipo_edificacao
- tipo_edificacao_codigo
- estabelecimento
- estabelecimentos
- especies
- setor
- distrito
- subdistrito
- quadra
- face
- nv_geo
- nv_geo_label
- finalidade
- indicador_estab
- indicador_const
- id_cnefe
- tipo_logradouro
- titulo_logradouro
- nome_logradouro
- modificador
- unidades
- complementos
- _links
- _origem
description: 'Um endereço CNEFE: número, coordenada IBGE e o fato que veio no CSV.'
Cobertura:
type: object
properties:
ufs:
type: array
items:
type: string
description: Siglas presentes no disco, em ordem.
completa:
type: boolean
description: '`true` só com as 27 UFs.'
required:
- ufs
- completa
description: Quais UFs já têm sqlite na origem.
Unidades:
type: object
properties:
cep:
type: string
description: CEP formatado.
items:
type: array
items:
$ref: '#/components/schemas/Ponto'
description: Unidades desta página (complemento, espécie, id CNEFE).
total:
type: integer
description: Quantas unidades batem o filtro.
limit:
type: integer
description: Teto desta página.
offset:
type: integer
description: Deslocamento pedido.
hasMore:
type: boolean
description: '`true` se ainda há unidade depois desta página.'
cobertura:
allOf:
- $ref: '#/components/schemas/Cobertura'
description: UFs ingeridas agora.
_links:
type: object
description: '`self` desta página e `cep` do lookup.'
required:
- cep
- items
- total
- limit
- offset
- hasMore
- cobertura
- _links
description: Unidades CNEFE de um CEP (ou de um logradouro+número), paginadas.
Cep_2:
type: object
properties:
cep:
type: string
description: CEP formatado `NNNNN-NNN`.
pontos:
type: array
items:
$ref: '#/components/schemas/Ponto_2'
description: Distinct addresses at this CEP (capped at the origin). Only with `detalhe=pontos`.
resumo:
allOf:
- $ref: '#/components/schemas/Resumo_2'
description: Units, buildings, types, neighborhood, city, state and centroid.
empresas_no_cep:
allOf:
- $ref: '#/components/schemas/EmpresasNoCep'
description: The companies at this CEP, the same number as on the street page; the list comes from `/api/empresas`. Missing before the first count.
fonte:
type: string
description: Identification and attribution of the address reference.
cobertura:
allOf:
- $ref: '#/components/schemas/Cobertura_2'
description: States available in this lookup. Only with `detalhe=pontos`.
_links:
type: object
description: Absolute `self`, `empresas` and `unidades`; `pontos` in the default answer.
required:
- cep
- resumo
- fonte
- _links
description: 'A CEP: summary, companies, source and links. The points and the coverage come with `detalhe=pontos`.'
Resumo_2:
type: object
properties:
address_count:
type: integer
description: Units at the CEP (not the number of buildings).
edificios:
type: integer
description: Distinct street+number pairs at the CEP.
logradouro:
type: string
description: Street of the building with the most addresses.
bairro:
type: string
description: Most frequent neighborhood in the sample.
cidade:
type: string
description: IBGE municipality.
uf:
type: string
description: Code of the federative unit.
ibge:
type: string
description: IBGE code of the municipality.
nullable: true
lat:
type: number
description: Average latitude of the returned buildings.
nullable: true
lon:
type: number
description: Average longitude of the returned buildings.
nullable: true
especies:
type: array
items:
$ref: '#/components/schemas/EspecieContagem_2'
description: Units per type in the whole CEP.
censo:
allOf:
- $ref: '#/components/schemas/CensoDoSetor'
description: The 2022 Census data of the sector of the building with the most addresses; each point brings its own with `detalhe=pontos`.
required:
- address_count
- edificios
- logradouro
- bairro
- cidade
- uf
- ibge
- lat
- lon
- especies
description: 'CEP summary: how many points, how many buildings, where it is.'
EspecieContagem_2:
type: object
properties:
codigo:
type: string
description: IBGE code of the type (`1`–`8`).
nullable: true
label:
type: string
description: 'Label: private household, education, health…'
nullable: true
n:
type: integer
description: How many units of this type.
required:
- codigo
- label
- n
description: How many units of a type in the segment.
Ponto_2:
type: object
properties:
cep:
type: string
description: Formatted CEP of the unit or the building.
nullable: true
logradouro:
type: string
description: Street type + name, already joined.
numero:
type: string
description: Number on the street.
nullable: true
complemento:
type: string
description: Address complements, if any.
nullable: true
bairro:
type: string
description: Locality or neighborhood in the register.
cidade:
type: string
description: IBGE municipality.
uf:
type: string
description: Code of the federative unit.
lat:
type: number
description: WGS84 latitude of the point.
nullable: true
lon:
type: number
description: WGS84 longitude of the point.
nullable: true
ibge:
type: string
description: IBGE code of the municipality.
nullable: true
especie:
type: string
description: CNEFE type code (`1`–`8`).
nullable: true
especie_label:
type: string
description: IBGE label of the type.
nullable: true
tipo_edificacao:
type: string
description: Casa, apartamento, vila — `COD_TIPO_ESPECIE`.
nullable: true
tipo_edificacao_codigo:
type: string
description: Code `101`–`104`.
nullable: true
estabelecimento:
type: string
description: Name of the establishment, when the type has one.
nullable: true
estabelecimentos:
type: array
items:
type: string
description: Distinct names in the building (sample).
nullable: true
especies:
type: array
items:
$ref: '#/components/schemas/EspecieContagem_2'
description: Mix of types at this street+number.
nullable: true
setor:
type: string
description: Census sector.
nullable: true
censo:
allOf:
- $ref: '#/components/schemas/CensoDoSetor'
description: The 2022 Census of the building's sector (only in the CEP lookup); missing when the sector does not match the final grid.
nullable: true
distrito:
type: string
description: IBGE district code.
nullable: true
subdistrito:
type: string
description: IBGE subdistrict code.
nullable: true
quadra:
type: string
description: Number of the block in the sector.
nullable: true
face:
type: string
description: Number of the block face.
nullable: true
nv_geo:
type: string
description: Geocoding level (`1`–`6`).
nullable: true
nv_geo_label:
type: string
description: What the geo level means.
nullable: true
finalidade:
type: string
description: Residential, non-residential, mixed or undetermined.
nullable: true
indicador_estab:
type: string
description: Single or multiple establishments at the address.
nullable: true
indicador_const:
type: string
description: Single or multiple under construction/renovation.
nullable: true
id_cnefe:
type: string
description: '`COD_UNICO_ENDERECO` of the unit (only in the detail).'
nullable: true
tipo_logradouro:
type: string
description: Tipo (RUA, AVENIDA…).
nullable: true
titulo_logradouro:
type: string
description: Title (DOUTOR…), if any.
nullable: true
nome_logradouro:
type: string
description: Street name without the type.
nullable: true
modificador:
type: string
description: Number modifier (SN, KM…).
nullable: true
unidades:
type: integer
description: How many units at this street+number (apartments, rooms).
complementos:
type: integer
description: Distinct complements in the building.
nullable: true
_links:
type: object
description: Absolute `unidades` for the paginated detail.
nullable: true
_origem:
type: string
description: Reference state of the result.
required:
- cep
- logradouro
- numero
- complemento
- bairro
- cidade
- uf
- lat
- lon
- ibge
- especie
- especie_label
- tipo_edificacao
- tipo_edificacao_codigo
- estabelecimento
- estabelecimentos
- especies
- setor
- censo
- distrito
- subdistrito
- quadra
- face
- nv_geo
- nv_geo_label
- finalidade
- indicador_estab
- indicador_const
- id_cnefe
- tipo_logradouro
- titulo_logradouro
- nome_logradouro
- modificador
- unidades
- complementos
- _links
- _origem
description: An address with number, coordinates and available characteristics.
Cobertura_2:
type: object
properties:
ufs:
type: array
items:
type: string
description: Available codes, in order.
completa:
type: boolean
description: '`true` only with all 27 states.'
required:
- ufs
- completa
description: Which states are available for lookup.
EmpresasNoCep:
type: object
properties:
total:
type: integer
description: Establishments with this CEP, in any status.
ativas:
type: integer
description: Active establishments with this CEP.
required:
- total
- ativas
description: Companies at the CEP in the Receita base, counted once per dump.
CensoDoSetor:
type: object
properties:
setor:
type: string
description: The final sector code (15 digits).
situacao:
type: string
description: '`Urbana` or `Rural`.'
nullable: true
pessoas:
type: integer
description: People in the census tract (empty when confidential).
nullable: true
domicilios:
type: integer
description: Households of the sector, all of them.
nullable: true
ocupados:
type: integer
description: Occupied private households.
nullable: true
mediaMoradores:
type: number
description: Average residents per occupied household.
nullable: true
vagos:
type: integer
description: Vacant permanent private households.
nullable: true
densidade:
type: integer
description: People per km² (the sector area in the Census).
nullable: true
rendaMedia:
type: number
description: Average monthly nominal income of the householder, in reais.
nullable: true
rendaMediana:
type: number
description: Median monthly nominal income of the householder, in reais.
nullable: true
required:
- setor
- situacao
- pessoas
- domicilios
- ocupados
- mediaMoradores
- vagos
- densidade
- rendaMedia
- rendaMediana
description: The census sector of the building in the 2022 Census (IBGE, aggregated per sector).
Unidades_2:
type: object
properties:
cep:
type: string
description: CEP formatado.
items:
type: array
items:
$ref: '#/components/schemas/Ponto_2'
description: Units of this page (complement, type, identifier).
total:
type: integer
description: How many establishments match the filter.
limit:
type: integer
description: Cap of this page.
offset:
type: integer
description: Deslocamento pedido.
hasMore:
type: boolean
description: '`true` if there are still units after this page.'
cobertura:
allOf:
- $ref: '#/components/schemas/Cobertura_2'
description: States available in this lookup.
_links:
type: object
description: '`self` of this page and `cep` of the lookup.'
required:
- cep
- items
- total
- limit
- offset
- hasMore
- cobertura
- _links
description: Units of a CEP (or of a street+number), paginated.
ProblemDetails:
type: object
description: RFC 9457 Problem Details error response (`application/problem+json`). Includes stable `code` and backward-compatible `error` and `message` fields; route-specific extension fields (such as `accepts`, `allow`, `retry_after`, or `request_id`) may also be present.
required:
- type
- title
- status
- detail
- instance
- code
properties:
type:
type: string
format: uri
description: URI identifying the problem type, linking to `/errors#<code>` on this host.
title:
type: string
description: Short human-readable summary of the problem type.
status:
type: integer
description: HTTP status code generated for this occurrence.
detail:
type: string
description: Human-readable explanation specific to this occurrence.
instance:
type: string
description: Request path where the error occurred (without query parameters).
code:
type: string
description: Stable machine-readable snake_case error code documented at `/errors`.
error:
type: string
description: Backward-compatible alias of `code` (or protocol reason on x402 402 responses).
message:
type: string
description: Backward-compatible alias of `detail`.
additionalProperties: true
securitySchemes:
globalAccount:
type: apiKey
in: cookie
name: __Host-mm-auth
description: Global session in the product's HttpOnly cookie; writes require exact Origin and X-CSRF-Token.
contaChaveApi:
type: http
scheme: bearer
bearerFormat: mmk_…
description: 'Account API key: `Authorization: Bearer mmk_…` or `X-Api-Key: mmk_…`. Created on the account page (API keys), valid only in the product where it was created; it acts as the account (or the organization that owns it).'
carteiraAgente:
type: http
scheme: bearer
bearerFormat: mmw_…
description: 'Wallet credential of an agent without an account (`Authorization: Bearer mmw_…`, 30 days, this product only): POST /api/auth/wallet/agent/start, check that the domain and URI of the message are the host and origin that you called, sign the message with the wallet, POST /api/auth/wallet/agent/token. The owner is `x402:<address>`.'
externalDocs:
url: https://payapi.market/api/pontofato
description: PayAPI Market
x-refined-from:
- pontofato-openapi-original.json
- pontofato-openapi.json