CEP generator and lookup

Generate a real CEP with its address to use in tests, or find out the address of a CEP.

What do you want to do?

A CEP is generated when the page opens. Choose the state or click "Generate CEP" to create another one.

How it works

  • The CEPs are real and come from Correios, through ViaCEP: each one exists and matches the street, neighborhood and city shown.
  • They are picked from streets in the capital and in another large city of each state, so they work in forms that fill in the address from the CEP.
  • CEPs reserved for companies and government offices are left out.

How to use the API

You can integrate the CEP generator into your app through our REST API.

Endpoint

GET /api/generators/address

Query parameters

state
Optional. The state abbreviation, such as "SP". Without it, the state is picked at random.
formatted
Optional. "false" generates the CEP with digits only. Default: "true".

curl example

curl "https://devtools.vmotta.dev/api/generators/address?state=PE"

Response

{
  "address": {
    "cep": "55016-460",
    "street": "Avenida Terezina",
    "neighborhood": "Universitário",
    "city": "Caruaru",
    "state": "PE"
  }
}