Currency

Get international currency information and exchange rates based on ISO 4217 standard

Overview

This endpoint provides access to international currency information and exchange rates. You can retrieve a list of all available currencies with their ISO 4217 codes, or query exchange rates for specific currency pairs on specific dates.

The endpoint returns:

  • Currency codes (ISO 4217 alpha-3) with full names
  • Currency numeric codes (ISO 4217 numeric)
  • Decimal precision information for each currency
  • Exchange rates between currency pairs

Pricing

Currency List Endpoint

📊 1 Credit per Request

Each request to get currency information costs 1 data credit and counts as a billable request.

Exchange Rate Endpoint

📊 1 Credit per Currency Pair

Each currency pair costs 1 data credit. For example:

  • USD to EUR = 1 credit
  • USD to EUR, GBP, JPY = 3 credits (3 pairs)

Endpoints

GET /currency
GET /currency?codes={currency_codes}
GET /currency/rate?symbols={target_currencies}&base={base_currency}&date={YYYYMMDD}
GET /currency/info

Currency List Endpoint

GET /currency

Get a list of all available currencies or filter by specific currency codes.

Query Parameters

ParameterTypeRequiredDescription
codesstringNoComma-separated list of ISO 4217 alpha-3 currency codes to filter (e.g., "USD,EUR,GBP")

Response Format

[
  {
    "code": "USD",
    "name": "US Dollar",
    "num": "840",
    "decimals": 2
  },
  {
    "code": "EUR",
    "name": "Euro",
    "num": "978",
    "decimals": 2
  }
]

Response Fields

FieldTypeDescription
codestringISO 4217 alpha-3 currency code (e.g., "USD", "EUR")
namestringFull currency name
numstringISO 4217 numeric code (3 digits)
decimalsnumberNumber of decimal places for the currency

Example Requests

Get All Currencies

curl -X GET "https://api.boxapi.com/currency" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

Get Specific Currencies

curl -X GET "https://api.boxapi.com/currency?codes=USD,EUR,GBP,JPY" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

Exchange Rate Endpoint

GET /currency/rate

Get exchange rates for specified currency pairs on a specific date.

Query Parameters

ParameterTypeRequiredDescription
symbolsstringYesComma-separated list of target currency codes (ISO 4217 alpha-3)
basestringNoBase currency code (ISO 4217 alpha-3). Default: "USD"
datestringNoDate for exchange rates in YYYYMMDD format (8 digits, no separators). Default: today's date

Response Format

{
  "success": true,
  "date": "2025-11-26",
  "base": "USD",
  "rates": {
    "EUR": 0.85,
    "GBP": 0.73,
    "JPY": 110.25
  },
  "credits_used": 3
}

Response Fields

FieldTypeDescription
successbooleanWhether the request was successful
datestringDate of the exchange rates in YYYY-MM-DD format
basestringBase currency code
ratesobjectObject containing exchange rates for each requested currency
credits_usednumberNumber of credits consumed by this request

Example Requests

Get Current USD to EUR Rate

curl -X GET "https://api.boxapi.com/currency/rate?symbols=EUR" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

Get USD to Multiple Currencies

curl -X GET "https://api.boxapi.com/currency/rate?symbols=EUR,GBP,JPY" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

Get Historical EUR to USD Rate

curl -X GET "https://api.boxapi.com/currency/rate?date=20251101&base=EUR&symbols=USD" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

Get Multiple Rates for Specific Date

curl -X GET "https://api.boxapi.com/currency/rate?date=20251115&base=GBP&symbols=USD,EUR,JPY,CHF" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

Usage Examples

JavaScript/Node.js

// Get all currencies
const allCurrencies = await fetch('https://api.boxapi.com/currency', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  }
});

const currencies = await allCurrencies.json();
console.log(`Total currencies: ${currencies.length}`);

// Get specific currencies
const specificCurrencies = await fetch('https://api.boxapi.com/currency?codes=USD,EUR,GBP', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  }
});

const filteredCurrencies = await specificCurrencies.json();
filteredCurrencies.forEach(currency => {
  console.log(`${currency.code}: ${currency.name} (decimals: ${currency.decimals})`);
});

// Get exchange rates
const ratesResponse = await fetch('https://api.boxapi.com/currency/rate?symbols=EUR,GBP,JPY', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  }
});

const ratesData = await ratesResponse.json();
console.log(`Exchange rates for ${ratesData.date}:`);
console.log(`Base: ${ratesData.base}`);
Object.entries(ratesData.rates).forEach(([currency, rate]) => {
  console.log(`${currency}: ${rate}`);
});
console.log(`Credits used: ${ratesData.credits_used}`);

Python

import requests

headers = {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
}

# Get all currencies
response = requests.get('https://api.boxapi.com/currency', headers=headers)
currencies = response.json()
print(f"Total currencies: {len(currencies)}")

# Get specific currencies
specific_response = requests.get(
    'https://api.boxapi.com/currency?codes=USD,EUR,GBP',
    headers=headers
)
filtered_currencies = specific_response.json()
for currency in filtered_currencies:
    print(f"{currency['code']}: {currency['name']} (decimals: {currency['decimals']})")

# Get exchange rates
rates_response = requests.get(
    'https://api.boxapi.com/currency/rate?symbols=EUR,GBP,JPY',
    headers=headers
)
rates_data = rates_response.json()
print(f"Exchange rates for {rates_data['date']}:")
print(f"Base: {rates_data['base']}")
for currency, rate in rates_data['rates'].items():
    print(f"{currency}: {rate}")
print(f"Credits used: {rates_data['credits_used']}")

# Get historical rates
historical_response = requests.get(
    'https://api.boxapi.com/currency/rate?date=20251101&base=EUR&symbols=USD,GBP',
    headers=headers
)
historical_data = historical_response.json()
print(f"\nHistorical rates for {historical_data['date']}:")
print(f"Base: {historical_data['base']}")
for currency, rate in historical_data['rates'].items():
    print(f"{currency}: {rate}")

PHP

<?php
$apiKey = 'YOUR_API_KEY';

// Get all currencies
$ch = curl_init('https://api.boxapi.com/currency');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer ' . $apiKey,
    'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$currencies = json_decode($response, true);

echo "Total currencies: " . count($currencies) . "\n";

// Get specific currencies
$ch = curl_init('https://api.boxapi.com/currency?codes=USD,EUR,GBP');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer ' . $apiKey,
    'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$filteredCurrencies = json_decode($response, true);

foreach ($filteredCurrencies as $currency) {
    echo "{$currency['code']}: {$currency['name']} (decimals: {$currency['decimals']})\n";
}

// Get exchange rates
$ch = curl_init('https://api.boxapi.com/currency/rate?symbols=EUR,GBP,JPY');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer ' . $apiKey,
    'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$ratesData = json_decode($response, true);

echo "\nExchange rates for {$ratesData['date']}:\n";
echo "Base: {$ratesData['base']}\n";
foreach ($ratesData['rates'] as $currency => $rate) {
    echo "{$currency}: {$rate}\n";
}
echo "Credits used: {$ratesData['credits_used']}\n";
?>

Error Responses

Missing Required Parameter

{
  "error": "Missing required parameter: symbols",
  "statusCode": 400
}

HTTP Status: 400 Bad Request

Invalid Date Format

{
  "error": "Invalid date format. Use YYYYMMDD",
  "statusCode": 400
}

HTTP Status: 400 Bad Request

Authentication Error

{
  "error": "Unauthorized"
}

HTTP Status: 401 Unauthorized

Internal Server Error

{
  "error": "Internal server error"
}

HTTP Status: 500 Internal Server Error

Rate Limits

The following rate limits apply per IP address:

  • 10,000 requests per minute for successful responses (2xx status codes)
  • 60 requests per minute for client errors (4xx status codes)
  • 60 requests per minute for server errors (5xx status codes)

⚠️ If you exceed these limits, your IP will be temporarily blocked and you'll receive a 429 status code.

Important Notes

  • All currency codes follow the ISO 4217 standard
  • Currency codes are case-insensitive (both "USD" and "usd" are accepted)
  • The date parameter must be in YYYYMMDD format (8 digits, no separators or hyphens)
  • Exchange rates are provided for the specified date or current date if not specified
  • The endpoint supports 226 international currencies including:
    • Major world currencies (USD, EUR, GBP, JPY, etc.)
    • Regional currencies from all continents
    • Precious metals (Gold, Silver, Platinum, Palladium)
    • Special currencies (SDR, bonds, etc.)

Currency Information Endpoint

GET /currency/info

Get detailed information about the currency API endpoints, parameters, and pricing.

Response:

{
  "description": "This API provides access to international currency information and exchange rates based on ISO 4217 standard.",
  "endpoints": {
    "list": {
      "path": "/currency",
      "description": "Get list of all available currencies or filter by currency codes",
      "params": {
        "codes": {
          "type": "string",
          "description": "Comma-separated list of currency codes to filter (optional)",
          "example": "USD,EUR,GBP",
          "required": false
        }
      },
      "pricing": {
        "description": "1 credit per request",
        "credits": 1
      }
    },
    "rates": {
      "path": "/currency/rate",
      "description": "Get exchange rates for specified currency pairs",
      "params": {
        "date": {
          "type": "string",
          "format": "YYYYMMDD",
          "description": "Date for exchange rates (8 digits, no separators)",
          "example": "20251126",
          "default": "today's date",
          "required": false
        },
        "base": {
          "type": "string",
          "description": "Base currency code (ISO 4217 alpha-3)",
          "example": "USD",
          "default": "USD",
          "required": false
        },
        "symbols": {
          "type": "string",
          "description": "Comma-separated list of target currency codes (ISO 4217 alpha-3)",
          "example": "EUR,GBP,JPY",
          "required": true
        }
      },
      "pricing": {
        "description": "1 credit per currency pair",
        "example": "USD to EUR,GBP,JPY = 3 credits (3 pairs)"
      }
    }
  },
  "currencyFormat": {
    "description": "All currency codes follow ISO 4217 standard",
    "codeFormat": "3-letter alphabetic code (e.g., USD, EUR, GBP)",
    "numericFormat": "3-digit numeric code (e.g., 840, 978, 826)"
  },
  "commonCurrencies": [
    { "code": "USD", "name": "US Dollar", "num": "840" },
    { "code": "EUR", "name": "Euro", "num": "978" },
    { "code": "GBP", "name": "British Pound", "num": "826" },
    { "code": "JPY", "name": "Japanese Yen", "num": "392" }
  ]
}

Credit Cost: 1 credit per request

Supported Currencies

The API supports 226 international currencies including:

Major World Currencies

  • USD (US Dollar)
  • EUR (Euro)
  • GBP (British Pound)
  • JPY (Japanese Yen)
  • CHF (Swiss Franc)
  • CAD (Canadian Dollar)
  • AUD (Australian Dollar)
  • CNY (Chinese Yuan)
  • And many more...

Precious Metals

  • XAU (Gold)
  • XAG (Silver)
  • XPT (Platinum)
  • XPD (Palladium)

Special Currencies

  • XDR (Special Drawing Right)
  • Various bond market units
  • Testing purposes codes

For a complete list of all supported currencies, use the GET /currency endpoint without any parameters.

Date Format

All dates must be provided in YYYYMMDD format (8 digits, no separators):

Correct: 20251126, 20250101, 20241231Incorrect: 2025-11-26, 2025/11/26, 26-11-2025

Use Cases

The Currency API is ideal for:

  • 💱 E-commerce platforms requiring multi-currency pricing
  • 📊 Financial applications needing real-time exchange rates
  • 🌍 International businesses managing global transactions
  • 📈 Analytics dashboards displaying currency conversions
  • 💰 Payment processors calculating currency exchanges
  • 🏦 Banking applications providing currency information