Free Currency
Exchange Rate API
Get real-time exchange rates for 170+ currencies.
No signup, no API key, no limits.
Daily Updates
Fresh exchange rates updated every day
No Authentication
Start using immediately without API keys
No Rate Limits
Unlimited requests for your applications
Mid-Market Rates
Accurate rates from trusted sources
Quick Start
Get exchange rates with a simple HTTP request
Latest Rate
curl --request GET \
--url 'https://hexarate.paikama.co/api/rates/USD/GBP/latest'
Response
{
"status_code": 200,
"data": {
"base": "USD",
"target": "GBP",
"mid": 0.780945,
"unit": 1,
"timestamp": "2024-08-03T05:16:50.272Z"
}
}
API Endpoints
Available endpoints for currency exchange rates
| Endpoint | Description | Cache |
|---|---|---|
| Exchange Rates | ||
| /api/rates/:base/:target/latest | Get the latest exchange rate for a currency pair | Until midnight UTC |
| /api/rates/:base/:target/:date | Get the historical rate for a specific date (YYYY-MM-DD) | Immutable (1 year) |
| /api/rates/:base/:target/timeseries | Get daily rates over a date range | Immutable (1 year) |
| /api/rates/batch | Look up multiple pairs for a historical date | — |
| /api/rates/latest/:base?target= | Legacy endpoint for latest rate (query param) | Until midnight UTC |
| Conversion | ||
| /api/convert | Convert an amount between currencies | Until midnight UTC |
| Currencies | ||
| /api/currencies | List all ISO 4217 currencies | — |
| /api/currencies/:code | Get metadata for a single currency | — |
| /api/currencies/replacements | Currency code replacement history | — |
All endpoints accept GET requests and return JSON.
Endpoint Details
Request and response examples for each endpoint
GET /api/rates/:base/:target/latest
curl --request GET \
--url 'https://hexarate.paikama.co/api/rates/USD/GBP/latest'
{
"status_code": 200,
"data": {
"base": "USD",
"target": "GBP",
"mid": 0.780945,
"unit": 1,
"timestamp": "2024-08-03T05:16:50.272Z"
}
}
Note: Cached until midnight UTC. If no rate exists for today, the latest available rate is fetched from the source.
GET /api/rates/:base/:target/:date
Parameters
:date— Date in YYYY-MM-DD format
curl --request GET \
--url 'https://hexarate.paikama.co/api/rates/USD/GBP/2024-01-15'
{
"status_code": 200,
"data": {
"base": "USD",
"target": "GBP",
"mid": 0.786234,
"unit": 1,
"timestamp": "2024-01-15T12:00:00.000Z"
}
}
Note: If the date is today, the API uses latest-rate logic. Future dates are rejected. Historical rates are cached immutably.
GET /api/rates/:base/:target/timeseries
Parameters
start— Start date, YYYY-MM-DD (required)end— End date, YYYY-MM-DD (optional, defaults to start + 90 days)
curl --request GET \
--url 'https://hexarate.paikama.co/api/rates/USD/EUR/timeseries?start=2024-01-01&end=2024-03-01'
{
"status_code": 200,
"data": {
"base": "USD",
"target": "EUR",
"first_available_date": "2023-06-15",
"rates": [
{ "date": "2024-01-01", "mid": 0.9215, "unit": 1, "timestamp": "2024-01-01T12:00:00.000Z" },
{ "date": "2024-01-02", "mid": 0.9198, "unit": 1, "timestamp": "2024-01-02T12:00:00.000Z" }
],
"next_start": "2024-04-01"
}
}
Note:
Returns up to 90 days per page. Maximum range is 365 days per request.
End date is clamped to yesterday. Use next_start to paginate through longer ranges.
GET /api/rates/batch
Parameters
pairs— Comma-separated pairs in BASE:TARGET format (max 10)date— Historical date, YYYY-MM-DD (must be in the past)
curl --request GET \
--url 'https://hexarate.paikama.co/api/rates/batch?pairs=USD:EUR,USD:GBP&date=2024-01-15'
{
"status_code": 200,
"data": {
"date": "2024-01-15",
"results": [
{
"base": "USD",
"target": "EUR",
"mid": 0.9215,
"unit": 1,
"timestamp": "2024-01-15T12:00:00.000Z"
},
{
"base": "USD",
"target": "GBP",
"mid": null,
"unit": null,
"timestamp": null,
"error": "Pair not found: USD/GBP"
}
]
}
}
Note:
Historical dates only — today and future dates are rejected.
Each pair succeeds or fails independently. The error field is omitted on successful entries.
GET /api/convert
Parameters
from— Source currency code (ISO 4217)to— Target currency code (ISO 4217)amount— Amount to convert (non-negative)
curl --request GET \
--url 'https://hexarate.paikama.co/api/convert?from=USD&to=JPY&amount=100'
{
"status_code": 200,
"data": {
"from": "USD",
"to": "JPY",
"mid": 148.33,
"amount": 100,
"raw_amount": 14833.0,
"converted_amount": 14833,
"unit": 1,
"timestamp": "2024-08-03T05:16:50.272Z"
}
}
Note:
Uses the latest mid-market rate. converted_amount is rounded to the target currency's
minor units (0 for JPY, 2 for USD, 3 for BHD).
GET /api/currencies
curl --request GET \
--url 'https://hexarate.paikama.co/api/currencies'
{
"status_code": 200,
"data": [
{ "code": "USD", "name": "United States dollar", "numeric": 840, "minor_units": 2 },
{ "code": "JPY", "name": "Japanese yen", "numeric": 392, "minor_units": 0 }
]
}
GET /api/currencies/:code
curl --request GET \
--url 'https://hexarate.paikama.co/api/currencies/USD'
{
"status_code": 200,
"data": {
"code": "USD",
"name": "United States dollar",
"numeric": 840,
"minor_units": 2
}
}
GET /api/currencies/replacements
curl --request GET \
--url 'https://hexarate.paikama.co/api/currencies/replacements'
{
"status_code": 200,
"data": [
{
"original": "MRO",
"replacement": "MRU",
"name": "Mauritanian ouguiya",
"from": "2018-01-01",
"until": null
}
]
}
Error Responses
All errors follow a structured format with machine-readable error codes
Error Format
{
"status_code": 422,
"data": {
"error_code": "INVALID_CURRENCY",
"message": "ANG has been replaced by XCG. See https://hexarate.paikama.co/iso-code-histories?s=em",
"context": {
"replacement_currency": "XCG"
}
}
}
The context field is included when additional machine-readable metadata is available
(e.g., a replacement currency code for deprecated currencies). It is omitted when not applicable.
Error Codes
| Error Code | HTTP Status | When |
|---|---|---|
| BAD_REQUEST | 400 | Invalid parameters, future dates (batch), too many pairs, negative amounts |
| INVALID_CURRENCY | 422 | Unrecognized or deprecated currency code |
| INVALID_RATE | 422 | Currency is valid but has no exchange rate data |
| INVALID_DATE | 400 / 422 | Future date (400) or invalid date format (422) |
| PAIR_NOT_FOUND | 404 | No rate data for this currency pair and date |
| INTERNAL_ERROR | 500 | Unexpected server error |
Currency Code Updates
Encountering a 422 error? Some currency codes have been deprecated and replaced.
For example, MRO
has been replaced by MRU.