How do I convert a single amount?
Call GET /api/exchange with base, target, and amount query parameters. The response returns the applied exchangeRate, a formatted convertedAmount string, and a lastUpdated timestamp for the rate.
Convert any amount between ISO 4217 currencies with live exchange-rate data. Single conversions or bulk batches up to 100, each with the rate and update timestamp.
This calls the live Exchange Rates API. Pick currencies and an amount; the response returns the applied rate, the converted amount, and when the rate was last updated.
Fetching live rate...
Why Exchange Rates API
Live conversion
Convert any amount between ISO 4217 currencies using current upstream exchange-rate data.
Rate transparency
Every result returns the applied exchangeRate and a formatted convertedAmount, so the math is auditable.
Freshness timestamps
A lastUpdated Unix timestamp on each conversion tells you exactly when the underlying rate was published.
Bulk conversions
Convert up to 100 pairs per request via GET query payload or a POST body, with a summary of successes and failures.
Per-item results
Bulk responses report each conversion independently, with item-level errors and indexes so one bad pair never fails the batch.
Structured errors
Missing parameters, unsupported currencies, and oversized batches all return clear errors with correlation IDs.
/api/v1/exchange-rates-and-currency
Single conversion
Requires base, target, and amount. Returns the rate, converted amount, and timestamp.
Bulk via GET
Pass a JSON array string in conversions to convert many pairs, up to 100, in one call.
Bulk via POST
Send a conversions array in the JSON body for larger, cleaner batch requests.
Service health
Status, service name, version, uptime, and environment.
Prometheus metrics
Request counts, duration histograms, and conversion counters.
| Parameter | Type | Required | Description |
|---|---|---|---|
| base | string | single | Source currency code (ISO 4217), e.g. USD. |
| target | string | single | Target currency code (ISO 4217), e.g. EUR. |
| amount | number | single | Amount to convert. |
| conversions | string / array | bulk | JSON array of { base, target, amount } objects. Query string for GET, request body for POST. Max 100. |
Error reference
Bad input and upstream failures both return a plain error message and a correlationId for tracing.
base, target, or amount was not provided for a single conversion.
The target currency code does not exist in the returned rate set.
The bulk payload is missing, not an array, or not valid JSON for the GET bulk endpoint.
A bulk request contained more than 100 conversion objects.
The requested route does not exist under the service.
The upstream rate provider failed during a single or bulk conversion.
Example error response
{
"error": "Please provide base, target, and amount.",
"correlationId": "1780095009530-nmfnx6tsc"
}FAQ
Call GET /api/exchange with base, target, and amount query parameters. The response returns the applied exchangeRate, a formatted convertedAmount string, and a lastUpdated timestamp for the rate.
Yes. Use /api/bulk-exchange with up to 100 conversion objects. Send them as a JSON array string in the conversions query parameter (GET) or as a conversions array in the request body (POST).
Yes. Every result includes the exchangeRate applied and the convertedAmount, so the conversion is fully auditable rather than a black box.
Bulk responses report each conversion independently with item-level errors and indexes, plus a summary of total, successful, and failed counts, so a single bad pair does not fail the whole batch.
Send your Datpaq API key as an x-api-key header or an api_key query parameter. Keys are created in the Datpaq dashboard and a free tier is included.
Single or bulk conversions with the applied rate and freshness timestamp on every result. No rate feeds to ingest, no conversion tables to maintain.