BlogData

Country lookups include currency

A country response includes its currency code, name, and symbol. Follow the code when you need the full currency record.

If you're already looking up a country, fetching its currency shouldn't take another request just to learn the code or display its name.

These fields come back with GET /country/US:

{
  "country": "US",
  "name": "United States",
  "currency": "USD",
  "currency_name": "United States Dollar",
  "currency_symbol": "$"
}

That gives a country details page enough to say which currency is used. Keep the code when displaying amounts across countries, though. A dollar sign by itself doesn't tell someone which dollar you mean.

When you need currency-specific details, follow USD to /currency. /currency/USD includes decimal places; add ?deep=true for the countries that use it, included on every plan. To get a reference exchange rate, use a pair such as /currency/USD/EUR.

The distinction keeps a country lookup useful without stuffing the entire currency record into it. It also works when several countries share a currency: their country records point to the same currency code, so your application can resolve that currency once and reuse the result.