> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bunny.build/llms.txt
> Use this file to discover all available pages before exploring further.

# GET /cep-lookup/:cep

> Resolve any Brazilian postal code (CEP) to a full address instantly: street, neighborhood, city, and state.

## Endpoint

```
GET https://api.bunny.build/api/v1/cep-lookup/:cep
```

## Authentication

| Header      | Required | Value                    |
| ----------- | -------- | ------------------------ |
| `X-API-Key` | Yes      | Your API key (`bun_...`) |

## Overview

Resolve any Brazilian postal code (CEP) to a full address instantly. Bunny's CEP API returns street name, neighborhood, city, and state for any valid 8-digit CEP, with no formatting required.

## Use cases

* Auto-fill address forms on checkout
* Validate shipping destinations
* Enrich customer records with location data
* Build delivery area maps

## Details

Strip hyphens before passing the CEP. Accepts `01310100` or `01310-100`. Both work. Returns null fields for CEPs that cover an entire municipality with no specific street.

## Path parameters

| Parameter | Type   | Required | Description                                                |
| --------- | ------ | -------- | ---------------------------------------------------------- |
| `cep`     | string | Yes      | Brazilian postal code (CEP), digits only (e.g. `01310100`) |

## Response

### 200 OK

| Field         | Type   | Description                                   |
| ------------- | ------ | --------------------------------------------- |
| `cep`         | string | The CEP that was looked up (digits only)      |
| `logradouro`  | string | Street name                                   |
| `complemento` | string | Address complement (may be empty)             |
| `bairro`      | string | Neighborhood                                  |
| `cidade`      | string | City name                                     |
| `uf`          | string | State abbreviation (e.g. `SP`)                |
| `estado`      | string | Full state name (e.g. `São Paulo`)            |
| `regiao`      | string | Brazilian region (e.g. `Sudeste`, `Nordeste`) |

**Example**

```json theme={null}
{
  "cep": "01310100",
  "logradouro": "Avenida Paulista",
  "complemento": "de 1 a 610 - lado par",
  "bairro": "Bela Vista",
  "cidade": "São Paulo",
  "uf": "SP",
  "estado": "São Paulo",
  "regiao": "Sudeste"
}
```

### 401 Unauthorized

```json theme={null}
{
  "detail": "Missing API key. Include X-API-Key header."
}
```

### 402 Payment Required

```json theme={null}
{
  "detail": "Monthly quota exceeded. Upgrade your plan."
}
```

### 404 Not Found

CEP not found.

```json theme={null}
{
  "detail": "CEP not found"
}
```

### 422 Unprocessable Entity

Invalid CEP format.

```json theme={null}
{
  "detail": "Invalid CEP format"
}
```

### 429 Too Many Requests

```json theme={null}
{
  "detail": "Rate limit exceeded. Try again in 60 seconds."
}
```

## cURL example

```bash theme={null}
curl https://api.bunny.build/api/v1/cep-lookup/01310100 \
  -H "X-API-Key: bun_your_api_key"
```
