ViaCep
APIFree RESTful API for Brazilian zip code (CEP) data
Overview
ViaCep is a free RESTful API for Brazilian zip code (CEP) data. It supports forward geocoding (retrieve address details via CEP using endpoints like /ws/{cep}/json/) and reverse geocoding (find CEPs from address components: /ws/{uf}/{city}/{street}/json/). Responses are available in JSON or XML formats. Use cases include auto-filling address fields in e-commerce checkouts, validating delivery locations for logistics services, and integrating location data into Brazilian-focused apps without authentication.
Example Integration (JavaScript)
fetch('https://viacep.com.br')
.then(res => res.json())
.then(data => console.log(data))
.catch(err => console.error(err)); Key Features
- RESTful API
- JSON & XML support
- No authentication required
- Forward (CEP to address) & reverse (address to CEP) geocoding
Frequently Asked Questions
? Is ViaCep free to use?
Yes, ViaCep is completely free for both personal and commercial use with no hidden costs.
? Does it require an API Key?
No, ViaCep does not require any API key or authentication to access its endpoints.
? What is the response format?
ViaCep supports both JSON and XML formats. Append /json/ or /xml/ to the endpoint URL to specify your preferred format.
Top Alternatives
People Also Ask about ViaCep
Tool Info
Pros
- ⊕ 100% free for personal/commercial use
- ⊕ Low-latency responses
- ⊕ Simple integration (no API key)
- ⊕ Covers all Brazilian CEPs
Cons
- ⊖ Restricted to Brazilian geographic data only
- ⊖ No official service level agreement (SLA)
- ⊖ Potential temporary blocks for excessive request volumes