> ## 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.

# Introdução

> Visão geral da API Bunny, URL base e autenticação

<Note>
  Todos os endpoints usam autenticação por **chave de API** no header `X-API-Key`. Veja as páginas de cada endpoint para detalhes completos de requisição e resposta.
</Note>

## <Icon icon="link" type="solid" /> URL base

```
https://api.bunny.build/api/v1
```

## <Icon icon="lock" type="solid" /> Autenticação

| Header         | Obrigatório | Descrição                                            |
| -------------- | ----------- | ---------------------------------------------------- |
| `X-API-Key`    | Sim         | Sua chave de API (começa com `bun_`)                 |
| `Content-Type` | Condicional | `application/json` (obrigatório em requisições POST) |
| `Accept`       | Recomendado | `application/json`                                   |

<Card title="Exemplo de headers" icon="code" horizontal>
  ```
  X-API-Key: bun_aBcDeFgHiJkLmNoPqRsTuVwXyZ123456
  Content-Type: application/json
  Accept: application/json
  ```
</Card>

## <Icon icon="gauge-high" type="solid" /> Limite de taxa

As respostas incluem headers de limite de taxa:

| Header                  | Descrição              |
| ----------------------- | ---------------------- |
| `X-RateLimit-Limit`     | Requisições por minuto |
| `X-RateLimit-Remaining` | Requisições restantes  |
| `X-RateLimit-Reset`     | Segundos até o reset   |

Em **429**, o servidor pode enviar `Retry-After` (segundos).

## <Icon icon="triangle-exclamation" type="solid" /> Formato de erro

Erros retornam um corpo JSON:

```json theme={null}
{
  "detail": "Mensagem de erro"
}
```

Erros de validação (422) podem retornar um array de objetos em `detail` com `loc`, `msg`, `type`.

## <Icon icon="list" type="solid" /> Códigos de status HTTP

| Código | Significado                                    |
| ------ | ---------------------------------------------- |
| 200    | Sucesso                                        |
| 400    | Bad Request: Entrada inválida                  |
| 401    | Unauthorized: Chave de API ausente ou inválida |
| 402    | Payment Required: Cota excedida                |
| 403    | Forbidden: Conta desativada                    |
| 404    | Not Found                                      |
| 422    | Unprocessable Entity: Erro de validação        |
| 429    | Too Many Requests: Limite de taxa excedido     |
| 500    | Internal Server Error                          |

## <Icon icon="folder-tree" type="solid" /> Endpoints

<CardGroup cols={2}>
  <Card title="POST /barcode" icon="barcode" href="/pt-BR/api-reference/barcode">
    Gerar uma imagem de código de barras.
  </Card>

  <Card title="GET /cep-lookup/:cep" icon="map-pin" href="/pt-BR/api-reference/cep-lookup">
    Consultar um CEP brasileiro.
  </Card>

  <Card title="GET /cnpj-data/:cnpj" icon="building" href="/pt-BR/api-reference/cnpj-data">
    Buscar dados públicos de uma empresa pelo CNPJ.
  </Card>

  <Card title="GET /currency-exchange" icon="money-bill" href="/pt-BR/api-reference/currency-exchange">
    Obter taxa de câmbio em tempo real.
  </Card>

  <Card title="GET /domain-availability/:domain" icon="globe" href="/pt-BR/api-reference/domain-availability">
    Verificar disponibilidade de domínio.
  </Card>

  <Card title="GET /ip-classify" icon="network-wired" href="/pt-BR/api-reference/ip-classify">
    Classificar um endereço IP por tipo de rede.
  </Card>

  <Card title="GET /ip-lookup" icon="magnifying-glass" href="/pt-BR/api-reference/ip-lookup">
    Consultar dados de geo e rede de um IP.
  </Card>

  <Card title="POST /random-password/generate" icon="key" href="/pt-BR/api-reference/random-password">
    Gerar uma senha aleatória segura.
  </Card>

  <Card title="GET /temporary-email" icon="envelope" href="/pt-BR/api-reference/temporary-email">
    Verificar se um e-mail usa domínio descartável.
  </Card>

  <Card title="POST /translate" icon="language" href="/pt-BR/api-reference/translate">
    Traduzir texto entre idiomas.
  </Card>

  <Card title="POST /url-checker" icon="link" href="/pt-BR/api-reference/url-checker">
    Verificar segurança e disponibilidade de uma URL.
  </Card>

  <Card title="GET /validate-cpf-cnpj" icon="id-card" href="/pt-BR/api-reference/validate-cpf-cnpj">
    Validar número de CPF ou CNPJ.
  </Card>

  <Card title="POST /wpp-url/generate" icon="comment" href="/pt-BR/api-reference/wpp-url">
    Gerar link de clique para o WhatsApp.
  </Card>
</CardGroup>
