UnifyUnits Developers
POST /v1/currency/convert Requires API key

Convert between currencies

Converts an amount between ISO 4217 currencies using European Central Bank euro reference rates (about 30 currencies, published each TARGET business day). The response includes the exact rate and the date it was published. `GET /v1/currency/convert` accepts the same fields as query parameters. Optional `date` uses historical rates and requires the Developer plan or higher; weekends and holidays resolve to the previous publication.

Prefer a language client when available: JavaScript / TypeScript, Python, or PHP (Laravel). Samples on this page stay raw HTTP so they match the OpenAPI contract.

Parameters

Name Type Required Description
value string Yes Decimal amount as a string (e.g. "100")
from string Yes Currency code, case-insensitive (e.g. "USD")
to string Yes Currency code, case-insensitive (e.g. "GBP")
date string No Historical rate date, YYYY-MM-DD. Requires the Developer plan or higher.
decimals integer No Round the result to this many fractional places (0-40, half-even).
format_locale string No Language tag such as de-DE. Adds a formatted display string (for example 1,5 km) to the result next to the exact value. Requires the Developer plan or higher.

Possible errors

INVALID_REQUEST · INVALID_VALUE · UNKNOWN_CURRENCY · PLAN_REQUIRED · RATE_NOT_FOUND · UNAUTHORIZED · INVALID_API_KEY · RATE_LIMIT_EXCEEDED · QUOTA_EXCEEDED · SERVICE_UNAVAILABLE

All endpoints · Error reference

cURL
curl "https://api.unifyunits.com/v1/currency/convert" \
  -X POST \
  -H "Authorization: Bearer $UNIFYUNITS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"value":"100","from":"USD","to":"GBP","decimals":2}'

Response 200

json
{
  "data": {
    "input": { "value": "100", "unit": "USD" },
    "result": { "value": "64", "unit": "GBP" },
    "rate": { "date": "2026-10-02", "source": "ecb", "value": "0.64" }
  }
}