Skip to main content

Endpoint

GET https://api.bunny.build/api/v1/currency-exchange?from=USD&to=BRL&amount=100

Authentication

HeaderRequiredValue
X-API-KeyYesYour API key (bun_...)

Overview

Get real-time exchange rates between any two currencies. Bunny’s Currency Exchange API supports 160+ currencies and returns the current mid-market rate, the converted amount, and the timestamp of the last rate update.

Use cases

  • Display prices in the visitor’s local currency
  • Process multi-currency payments and invoices
  • Build currency converter widgets
  • Sync inventory prices across markets

Details

Rates are refreshed frequently and cached for up to 60 minutes. Provide from and to as ISO 4217 currency codes (e.g. USD, BRL, EUR). Optionally pass amount to get a converted value directly.

Query parameters

ParameterTypeRequiredDescription
fromstringYesSource currency code (ISO 4217, e.g. USD)
tostringYesTarget currency code (ISO 4217, e.g. BRL)
amountnumberNoAmount to convert (default: 1)

Response

200 OK

FieldTypeDescription
fromstringSource currency code
tostringTarget currency code
ratenumberExchange rate (1 unit of from expressed in to)
amountnumberThe amount that was converted (mirrors the amount query param, default 1)
convertednumberResult of amount * rate, rounded to 6 decimal places
updated_atstringTimestamp of the last rate update (from the upstream provider)
Example
{
  "from": "USD",
  "to": "BRL",
  "rate": 5.423100,
  "amount": 100,
  "converted": 542.31,
  "updated_at": "Mon, 23 Jun 2025 00:02:01 +0000"
}

401 Unauthorized

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

402 Payment Required

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

422 Unprocessable Entity

Invalid currency code.
{
  "detail": "Invalid currency code"
}

429 Too Many Requests

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

cURL example

curl "https://api.bunny.build/api/v1/currency-exchange?from=USD&to=BRL&amount=100" \
  -H "X-API-Key: bun_your_api_key"