Brazil API

⭐ Beginner's Pick Government / No Auth Required Beginner HTTPS CORS
Free to Use Varies (check documentation)

Overview

BrasilAPI is a free, community-driven API that centralizes public data about Brazil in one easy-to-use place. You can look up ZIP codes, bank information, CNPJ company data, Brazilian holidays, and much more without any API key. It is one of the best open APIs for developers working with Brazilian data.

💡

Beginner Tip

Start with the CEP (ZIP code) endpoint—it is the most straightforward and returns rich address data including city, state, and neighborhood in a clean JSON format.

Available Data

Brazil data via REST API
JSON-formatted response data
Freely accessible without authentication

Example Response

JSON Response
{
  "status": "success",
  "data": {
    "result": "Data from Brazil",
    "description": "Community driven API for Brazil Public Data",
    "timestamp": "2025-01-15T10:00:00Z"
  }
}

Field Reference

cep The 8-digit Brazilian postal code (CEP) that was queried
state Two-letter Brazilian state abbreviation (e.g. SP, RJ)
city Name of the city corresponding to the ZIP code
neighborhood Neighborhood or district within the city
street Street name associated with the postal code

Implementation Example

const url = "https://brasilapi.com.br/";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

404 Not Found The ZIP code or CNPJ provided does not exist in the database
Double-check the value you are querying—CEPs must be 8 digits with no dashes or spaces
Service Unavailable (503) The API is temporarily down or rate-limited due to high community usage
Add retry logic with exponential backoff and check the BrasilAPI status page at brasilapi.com.br
CORS error in browser Some browser environments block requests to the API
Make requests from a backend server or use a CORS proxy during development

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 20/20
🔒 Security 15/15
🛠 Developer XP 20/20
✓ Reliability 7/15
Response Time 45ms

Fully tested on Apr 5, 2026

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS YES
Category Government
Difficulty Beginner
Verified: 2026-04-04

Similar APIs

View All →