ViaCEP

App · 2 actions

Look up Brazilian addresses by CEP (postal code), and find the CEPs of a street by state, city and street name.

Find CEPs by address

Find the CEPs of a street from its state, city and name. Returns up to 50 matches, closest names first; a long street can have one CEP per stretch.

Inputs

StatestatetextRequired
The state the city is in.One of: AC (AC - Acre), AL (AL - Alagoas), AP (AP - Amapá), AM (AM - Amazonas), BA (BA - Bahia), CE (CE - Ceará), DF (DF - Distrito Federal), ES (ES - Espírito Santo), GO (GO - Goiás), MA (MA - Maranhão), and 17 more.
CitycitytextRequired
The city's name, at least 3 characters, such as São Paulo. Accents are optional.
StreetstreettextRequired
All or part of the street's name, at least 3 characters, such as Paulista. Leave out the type (Rua, Avenida).

Outputs

countnumber
How many addresses matched.
may_be_truncatedtrue/false
True when 50 came back, ViaCEP's limit, so there may be more. Narrow the street name to find them.
resultslist
Matching addresses, each with its CEP.
Example output
{
  "count": 2,
  "may_be_truncated": false,
  "results": [
    {
      "cep": "01001-000",
      "city": "S\u00e3o Paulo",
      "complement": "lado \u00edmpar",
      "ddd": "11",
      "gia_code": "1004",
      "ibge_code": "3550308",
      "neighborhood": "S\u00e9",
      "region": "Sudeste",
      "siafi_code": "7107",
      "state": "SP",
      "state_name": "S\u00e3o Paulo",
      "street": "Pra\u00e7a da S\u00e9",
      "unit": null
    },
    {
      "cep": "01001-901",
      "city": "S\u00e3o Paulo",
      "complement": "371",
      "ddd": "11",
      "gia_code": "1004",
      "ibge_code": "3550308",
      "neighborhood": "S\u00e9",
      "region": "Sudeste",
      "siafi_code": "7107",
      "state": "SP",
      "state_name": "S\u00e3o Paulo",
      "street": "Pra\u00e7a da S\u00e9",
      "unit": "Edif\u00edcio Santa L\u00eddia"
    }
  ]
}

Look up an address by CEP

Get the street, neighborhood, city and state of a CEP (Brazilian postal code), with the city's IBGE code and DDD (phone area code).

Inputs

CEPceptextRequired
The 8-digit postal code, with or without the hyphen, such as 01001-000.

Outputs

ceptext
The CEP (postal code), as 01001-000.
citytext
City (localidade).
complementtext
Which part of the street the CEP covers, such as lado ímpar (odd-numbered side).
dddtext
The city's DDD (phone area code).
gia_codetext
São Paulo state's GIA tax code, for SP addresses.
ibge_codetext
The city's 7-digit IBGE code.
neighborhoodtext
Neighborhood (bairro).
regiontext
Region of Brazil, such as Sudeste.
siafi_codetext
The city's SIAFI code, used in federal finance systems.
statetext
Two-letter state code (UF), such as SP.
state_nametext
State name.
streettext
Street name (logradouro). Empty for a CEP that covers a whole town.
unittext
The building or organisation, for a CEP of its own.
Example output
{
  "cep": "01001-000",
  "city": "S\u00e3o Paulo",
  "complement": "lado \u00edmpar",
  "ddd": "11",
  "gia_code": "1004",
  "ibge_code": "3550308",
  "neighborhood": "S\u00e9",
  "region": "Sudeste",
  "siafi_code": "7107",
  "state": "SP",
  "state_name": "S\u00e3o Paulo",
  "street": "Pra\u00e7a da S\u00e9",
  "unit": null
}

On this page