Skip to main content

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

HeaderRequiredValue
X-API-KeyYesYour 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

FieldTypeDescription
cca2stringISO 3166-1 alpha-2 code
cca3stringISO 3166-1 alpha-3 code
namestringCommon country name
official_namestringOfficial country name
capitalstringCapital city
regionstringGeographic region
subregionstringGeographic subregion
populationintegerEstimated population
area_km2numberArea in square kilometers
flagstringFlag emoji
currenciesarray of objectsList of currencies with code, name, and symbol
languagesarray of stringsOfficial languages
calling_codestringInternational dialing code
tldstringTop-level domain
bordersarray of stringsBordering country codes (alpha-3)
timezonesarray of stringsIANA timezone identifiers
continentsarray of stringsContinent(s)
Example
{
  "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

{
  "detail": "Missing API key. Include X-API-Key header."
}

402 Payment Required

{
  "detail": "Monthly quota exceeded. Upgrade your plan."
}

422 Unprocessable Entity

{
  "detail": "Country not found for the provided code or search term."
}

429 Too Many Requests

{
  "detail": "Rate limit exceeded. Try again in 60 seconds."
}

cURL example

curl "https://api.bunny.build/api/v1/country-info/BR" \
  -H "X-API-Key: bun_your_api_key"