Cep.la API

Free to Use Varies (check documentation)

Overview

Cep.la is a free Brazilian API that lets you look up address information using a Brazilian postal code (CEP). It returns details like street name, neighborhood, city, and state in a simple JSON format. No API key is needed, making it a great starting point for any app that handles Brazilian addresses.

💡

Beginner Tip

Brazilian CEPs are 8-digit codes; you can pass them with or without a hyphen (e.g., 01310-100 or 01310100). The API returns null for invalid or unknown CEPs.

Available Data

IP address information
geographic location
ASN and ISP data

Example Response

JSON Response
{
  "status": "success",
  "data": {
    "result": "Data from Cep.la",
    "description": "Brazil RESTful API to find information about streets, zip codes, neighborhoods, cities and states",
    "timestamp": "2025-01-15T10:00:00Z"
  }
}

Field Reference

cep The queried postal code, formatted as 8 digits without a hyphen.
logradouro Street or place name associated with the CEP.
bairro Neighborhood or district name.
cidade City name where the CEP is located.
uf Two-letter state abbreviation (e.g., "SP" for Sao Paulo).

Implementation Example

const url = "http://cep.la/";
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

Empty or null response The CEP does not exist in the database or is malformed.
Verify the CEP is exactly 8 digits and belongs to a valid Brazilian address. Remove any hyphens or spaces.
Non-JSON response Missing the Accept: application/json header.
Add the header -H "Accept: application/json" to your request so the API returns JSON instead of HTML.
Connection timeout The server may occasionally be slow due to it being a community-run service.
Implement a retry with exponential backoff and consider caching successful lookups locally.

Matrix Score Breakdown

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

Fully tested on Apr 5, 2026

Technical Specifications

Auth No Auth
HTTPS NO
CORS UNKNOWN
Category Geocoding
Difficulty Beginner
Verified: 2026-04-04

Similar APIs

View All →