CEP generator and lookup
Generate a real CEP with its address to use in tests, or find out the address of a CEP.
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"
}
}Enter a CEP and click "Look up CEP" to see the address.
How it works
- The lookup uses the Correios database, through ViaCEP.
- The CEP can be entered with or without the hyphen.
- CEPs of small towns, which have a single CEP, come back without a street or neighborhood.
How to use the API
You can integrate the CEP lookup into your app through our REST API.
Endpoint
GET /api/cep/01304000
curl example
curl "https://devtools.vmotta.dev/api/cep/01304000"
Response
{
"address": {
"cep": "01304-000",
"street": "Rua Augusta",
"complement": "até 698 - lado par",
"neighborhood": "Consolação",
"city": "São Paulo",
"state": "SP",
"ddd": "11"
}
}