ViaCep

API

Free RESTful API for Brazilian zip code (CEP) data

Visit Website

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)

script.js JS

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

Correios API Search Google
CepAberto API Search Google

People Also Ask about ViaCep

ViaCep vs Correios APIViaCep vs CepAberto API ViaCep 2025 review

Tool Info

Pricing Free
Category Geocoding
Platform Public API

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

More Geocoding Tools