Public APIs
ViaCep favicon

ViaCep

Geocoding

Brazil RESTful zip codes API.

ViaCep's website screenshot

About ViaCep

ViaCEP is a free webservice for looking up Brazilian postal codes (CEP - Codigo de Enderecamento Postal). Given an 8-digit CEP, it returns the corresponding address details, including street (logradouro), neighborhood (bairro), city (localidade), state (uf and estado), region (regiao), IBGE code, DDD area code, and SIAFI code, in either JSON, JSONP, or XML format.

The service also supports reverse lookup by address: given a state, city, and street name (each with a minimum of three characters), it returns matching CEPs ordered by proximity of the street name match, with a maximum of 50 results per query. Invalid CEP formats or address queries with fields shorter than three characters return a 400 Bad Request response, and valid but nonexistent CEPs return a response with an "erro" field set to true.

The database is dated 11/08/2026 and contains 1,600,723 CEPs. It is intended for use by developers building address auto-fill or address validation features into applications, such as online registration forms. The provider warns against massive use for validating local databases, stating that such use may result in indefinite blocking of access, and states that it does not distribute or sell its database.

Key features

  • Look up Brazilian CEP (postal code) address data by 8-digit code
  • Returns address details: street, neighborhood, city, state, region, IBGE and DDD codes
  • Search CEPs by state, city, and street name
  • Supports JSON, JSONP, and XML response formats
  • Validates CEP format and returns 400 for invalid input

Frequently asked questions

Is ViaCEP free to use?

Yes, ViaCEP is a free webservice for looking up Brazilian postal codes (CEPs).

What data formats does the API return?

The API can return results in JSON, JSONP, or XML.

Can I search for a CEP without knowing the exact code?

Yes, you can search by providing the state (UF), city, and street name, which returns up to 50 matching CEPs.

What happens if I query an invalid or nonexistent CEP?

An invalid format returns a 400 Bad Request, while a valid but nonexistent CEP returns a result with an 'erro' field set to true.

Is there a limit on usage?

There is no stated rate limit, but massive use for validating local databases may result in an indefinite automatic block.

Advertise here

Featured products

  • SerpApi - Search API favicon
  • Screenshot Scout favicon
  • TalorData favicon
  • CoreClaw favicon

Show your product to thousands of developers

· 100k monthly pageviews
· 7k newsletter subscribers

Advertise your product