> ## 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 /country-info/:code

> Retrieve comprehensive country data by ISO code or name.

## Endpoint

```
GET https://api.bunny.build/api/v1/country-info/:code
```

Also supports search by name:

```
GET https://api.bunny.build/api/v1/country-info?search=term
```

## Authentication

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

## Overview

Retrieve structured country data using an ISO 3166-1 alpha-2 code (e.g. `BR`), alpha-3 code (e.g. `BRA`), or a country name search query. The response covers geography, demographics, currencies, languages, calling codes, and more in a single call.

## Use cases

* Pre-fill country fields and validate user input in registration forms
* Enrich address records with region, capital, and calling code data
* Power shipping calculators with area, borders, and timezone information
* Drive localization logic based on languages, currencies, and TLDs

## Request

Pass the ISO 3166-1 alpha-2 or alpha-3 code as a path parameter, or use the `search` query parameter for name-based lookup.

**Examples:**

```
GET /country-info/BR
GET /country-info/BRA
GET /country-info?search=brazil
```

## Response

### 200 OK

| Field           | Type             | Description                                          |
| --------------- | ---------------- | ---------------------------------------------------- |
| `cca2`          | string           | ISO 3166-1 alpha-2 code                              |
| `cca3`          | string           | ISO 3166-1 alpha-3 code                              |
| `name`          | string           | Common country name                                  |
| `official_name` | string           | Official country name                                |
| `capital`       | string           | Capital city                                         |
| `region`        | string           | Geographic region                                    |
| `subregion`     | string           | Geographic subregion                                 |
| `population`    | integer          | Estimated population                                 |
| `area_km2`      | number           | Area in square kilometers                            |
| `flag`          | string           | Flag emoji                                           |
| `currencies`    | array of objects | List of currencies with `code`, `name`, and `symbol` |
| `languages`     | array of strings | Official languages                                   |
| `calling_code`  | string           | International dialing code                           |
| `tld`           | string           | Top-level domain                                     |
| `borders`       | array of strings | Bordering country codes (alpha-3)                    |
| `timezones`     | array of strings | IANA timezone identifiers                            |
| `continents`    | array of strings | Continent(s)                                         |

**Example**

```json theme={null}
{
  "cca2": "BR",
  "cca3": "BRA",
  "name": "Brazil",
  "official_name": "Federative Republic of Brazil",
  "capital": "Brasilia",
  "region": "Americas",
  "subregion": "South America",
  "population": 215313498,
  "area_km2": 8515767,
  "flag": "🇧🇷",
  "currencies": [{ "code": "BRL", "name": "Brazilian real", "symbol": "R$" }],
  "languages": ["Portuguese"],
  "calling_code": "+55",
  "tld": ".br",
  "borders": ["ARG", "BOL", "COL", "GUY", "PRY", "PER", "SUR", "URY", "VEN"],
  "timezones": ["America/Sao_Paulo", "America/Manaus"],
  "continents": ["South America"]
}
```

### 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."
}
```

### 422 Unprocessable Entity

```json theme={null}
{
  "detail": "Country not found for the provided code or search term."
}
```

### 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/country-info/BR" \
  -H "X-API-Key: bun_your_api_key"
```
