Documentation
Exchange rate API reference for all six operations
Exchange rate API inputs, returned fields and worked examples for latest, convert, historical, timeseries, fluctuation and currencies, with billing and errors.
See also: Currency reference rates overview and prices · Build an expense preview with an exchange rate API
On this page
Calling the exchange rate API
Each operation is a POST to /api/v1/currency/<action> with a flat JSON body: the input fields sit at the top level, without a wrapping object. Send the API key in x-api-key, the header Content-Type: application/json and an Idempotency-Key of 8 to 128 letters, digits, colons, underscores or hyphens; a missing or malformed key is refused with IDEMPOTENCY_KEY_REQUIRED (400).
The key needs the scope currency:<action> or currency:*. A body that is not valid JSON is refused with INVALID_REQUEST (400), and one over the size limit with PAYLOAD_TOO_LARGE (413), before anything runs; a value the operation rejects ends with REQUEST_REJECTED or REQUEST_NOT_FULFILLED (502), nothing is charged, and the corrected request needs a new Idempotency-Key.
Fields in this section (2)
Idempotency-Key, ok
latest: the most recently published rates
latest accepts two optional fields. base is one of the 43 supported codes and defaults to EUR; symbols names the target currencies, and leaving it out returns every currency in the reference set. The reply names the reference day in date.
It is the most recent publication, so on a weekend it is the previous Friday or an earlier working day, never a day that has no rates. rates maps each requested code to its value against the base.
A Unix timestamp, which marks 16:00 CET or CEST on that day, and an amount can accompany the rates. With the example body, base EUR and symbols USD,GBP,JPY, the example response reports 2024-01-05 with USD at 1.1, GBP at 0.85, JPY at 160 and an amount of 1.
Fields in this section (7)
latest, base, symbols, date, rates, timestamp, amount
convert: one amount between two currencies
convert requires from and to, each one of the 43 supported codes, so any pair is accepted, including two currencies other than the euro. amount is optional and defaults to 1; send it as a JSON number, because a value that is not a valid amount is ignored and the default of 1 applies. Without date the latest published rate applies; with date, the rate of that reference day applies under the same calendar rules as historical.
from_currency and base are also accepted in place of from, and to_currency in place of to. The reply echoes from, to and amount, adds rate and result, which is the amount multiplied by the rate, and names the reference day in date; requested_date keeps the original day when it rolled back. Converting 100 USD to EUR in the example gives a rate of 0.9 and a result of 90 on 2024-01-05.
Fields in this section (8)
convert, from, to, amount, date, rate, result, requested_date
historical: the rates of one past day
historical requires date and accepts the same optional base and symbols as latest. The date is a YYYY-MM-DD day from 1999-01-04 onward.
A Saturday, a Sunday or a holiday resolves to the last working day before it: date in the reply is the day the rates belong to, and requested_date repeats the day you sent. The example asks for Saturday 2024-01-06 with base EUR and symbols USD,GBP, and the example response returns date 2024-01-05, requested_date 2024-01-06 and rates for both codes.
Fields in this section (6)
historical, date, requested_date, base, symbols, rates
timeseries: every working day in a range
timeseries requires start and end and accepts base and symbols. Both ends are included, and a range of a single day, with equal ends, is allowed. The reply nests rates by date: each key of rates is a working day inside the range, and its value maps codes to rates.
Weekends and holidays have no key at all, so a missing day is a day without publication, never a zero. The reply echoes the range as start and end, as start_date and end_date, or both, so a client should read whichever pair is present.
A non-null stop_reason means the series stopped before the end of the range. The example range from 2024-01-02 to 2024-01-05 with symbols USD returns four dated entries, one for each working day from Tuesday to Friday.
Fields in this section (7)
timeseries, start, end, rates, start_date, end_date, stop_reason
fluctuation: the change between the two ends
fluctuation takes the same inputs as timeseries but returns no daily values. For each requested code, rates holds start_rate and end_rate from the two ends of the range, together with the signed change and change_pct derived from them; the days in between play no part. Its range labels follow the same rule as in timeseries.
In the example response for 2024-01-02 to 2024-01-05, USD moves from 1.1 to 1.11, a change of 0.01 and a change_pct of about 0.909. Call timeseries instead when the path between the ends matters, for example to find the highest rate of the month.
Fields in this section (7)
fluctuation, start_rate, end_rate, change, change_pct, start_date, end_date
currencies: names of the current reference set
currencies takes an empty JSON object. The reply carries date, base fixed at EUR, count and currencies, a map from each code of the current reference set to its name. Use it to fill a currency picker or to label codes in a report.
The set describes the present: a listed code may have no rates on an older date, while retired codes that inputs still accept, such as HRK, belong to older data rather than to this list. The example response lists USD, GBP and JPY with their names and a count of 3.
Fields in this section (4)
currencies, date, base, count
The response envelope and attribution
A successful reply has the form { ok: true, data, meta }. data has passed this operation's output schema: rate values are positive finite numbers and currency keys consist of three uppercase letters. Fields outside the documented response are removed before the reply is sent.
meta holds requestId, chargedCreditUnits as a decimal string and, when attribution accompanies the result, sourceAttribution, which should stay next to the rates wherever they are shown. A failure has the form { ok: false, error: { code, message } }; when the request had been admitted before it failed, meta is present as well and reports a charge of "0". A reply refused before admission carries a top-level requestId instead of meta.
Fields in this section (4)
ok, data, error, sourceAttribution
Errors, retries and billing
A request refused at the door, for example with INVALID_REQUEST, AUTH_FAILED, SCOPE_DENIED or INSUFFICIENT_CREDITS, runs nothing and costs nothing. A result that fails the output check is reported as RESULT_INVALID (502): its outcome is unknown, so the price is held, then released, and never charged. An operation that reports it did not succeed returns REQUEST_NOT_FULFILLED (502) and is not charged.
SERVICE_UNAVAILABLE describes a condition on the service side, not your wallet balance. OPERATION_TIMEOUT, RESULT_INVALID and other uncertain outcomes must not trigger an automatic paid retry with a new Idempotency-Key. RATE_LIMITED and CONCURRENCY_LIMIT (429) carry a Retry-After header: wait that many seconds and resend with the same key.
Reusing a key for different input returns IDEMPOTENCY_CONFLICT (409). A finished request replays for 24 hours: sending the identical request again with the same key returns the stored reply without a second charge, and after that window a succeeded request answers RESULT_EXPIRED (410) and is neither run nor charged again. A request with an unknown outcome answers REQUEST_PENDING (409) until its 900-second hold ends, then OUTCOME_UNKNOWN_RELEASED (504) with nothing charged; only then decide whether to send a new request with a new key.
Fields in this section (3)
ok, error, Idempotency-Key
Operations
Every public gateway operation uses POST /api/v1/{project}/{action}.
Use the documented flat JSON object. Keep the fields at the top level; do not wrap them in body.
Gateway reference: authentication, idempotency, billing and all error codes
Latest reference rates
POST /api/v1/currency/latest
Rates for the most recently published reference day. Omitting symbols returns every currency in the reference set.
Input fields
| Field | Type | Required | Allowed values | Limits |
|---|---|---|---|---|
base | string | Optional | 43 values"EUR""USD""JPY""GBP""CHF""AUD""CAD""CNY""HKD""NZD""SEK""NOK""DKK""CZK""HUF""PLN""RON""BGN""TRY""ISK""ILS""INR""IDR""KRW""MYR""PHP""SGD""THB""ZAR""MXN""BRL""RUB""HRK""GRD""CYP""EEK""LTL""LVL""MTL""SIT""SKK""ROL""TRL" | — |
symbols | string | Optional | — | — |
Request examples
# Server-side only. Set KAKIAPI_API_KEY in your secret manager.
# Every gateway operation is called with POST.
# Only operations shown as enabled on the API page can be called.
# Generate once per intent; retain the same value on status checks.
REQUEST_ID="$(uuidgen)"
curl --request POST 'https://kakiapi.com/api/v1/currency/latest' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"base":"EUR","symbols":"USD,GBP,JPY"}'Example response
{
"base": "EUR",
"date": "2024-01-05",
"rates": {
"USD": 1.1,
"GBP": 0.85,
"JPY": 160
},
"amount": 1
}Convert an amount
POST /api/v1/currency/convert
A numeric amount; defaults to 1. Optional historical date.
Input fields
| Field | Type | Required | Allowed values | Limits |
|---|---|---|---|---|
from | string | Required | 43 values"EUR""USD""JPY""GBP""CHF""AUD""CAD""CNY""HKD""NZD""SEK""NOK""DKK""CZK""HUF""PLN""RON""BGN""TRY""ISK""ILS""INR""IDR""KRW""MYR""PHP""SGD""THB""ZAR""MXN""BRL""RUB""HRK""GRD""CYP""EEK""LTL""LVL""MTL""SIT""SKK""ROL""TRL" | — |
to | string | Required | 43 values"EUR""USD""JPY""GBP""CHF""AUD""CAD""CNY""HKD""NZD""SEK""NOK""DKK""CZK""HUF""PLN""RON""BGN""TRY""ISK""ILS""INR""IDR""KRW""MYR""PHP""SGD""THB""ZAR""MXN""BRL""RUB""HRK""GRD""CYP""EEK""LTL""LVL""MTL""SIT""SKK""ROL""TRL" | — |
amount | number | Optional | — | — |
date | string | Optional | — | format date |
Request examples
# Server-side only. Set KAKIAPI_API_KEY in your secret manager.
# Every gateway operation is called with POST.
# Only operations shown as enabled on the API page can be called.
# Generate once per intent; retain the same value on status checks.
REQUEST_ID="$(uuidgen)"
curl --request POST 'https://kakiapi.com/api/v1/currency/convert' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"from":"USD","to":"EUR","amount":100}'Example response
{
"from": "USD",
"to": "EUR",
"amount": 100,
"rate": 0.9,
"result": 90,
"date": "2024-01-05"
}Historical reference day
POST /api/v1/currency/historical
Dates start at 1999-01-04. For a Saturday, Sunday or holiday the rates of the last working day before it are returned, and requested_date keeps the day you sent.
Input fields
| Field | Type | Required | Allowed values | Limits |
|---|---|---|---|---|
date | string | Required | — | format date |
base | string | Optional | 43 values"EUR""USD""JPY""GBP""CHF""AUD""CAD""CNY""HKD""NZD""SEK""NOK""DKK""CZK""HUF""PLN""RON""BGN""TRY""ISK""ILS""INR""IDR""KRW""MYR""PHP""SGD""THB""ZAR""MXN""BRL""RUB""HRK""GRD""CYP""EEK""LTL""LVL""MTL""SIT""SKK""ROL""TRL" | — |
symbols | string | Optional | — | — |
Request examples
# Server-side only. Set KAKIAPI_API_KEY in your secret manager.
# Every gateway operation is called with POST.
# Only operations shown as enabled on the API page can be called.
# Generate once per intent; retain the same value on status checks.
REQUEST_ID="$(uuidgen)"
curl --request POST 'https://kakiapi.com/api/v1/currency/historical' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"date":"2024-01-06","base":"EUR","symbols":"USD,GBP"}'Example response
{
"base": "EUR",
"date": "2024-01-05",
"requested_date": "2024-01-06",
"rates": {
"USD": 1.1,
"GBP": 0.85
}
}Time series
POST /api/v1/currency/timeseries
Both ends of the range are included. Inspect stop_reason; missing business-day data is not zero.
Input fields
| Field | Type | Required | Allowed values | Limits |
|---|---|---|---|---|
start | string | Required | — | format date |
end | string | Required | — | format date |
base | string | Optional | 43 values"EUR""USD""JPY""GBP""CHF""AUD""CAD""CNY""HKD""NZD""SEK""NOK""DKK""CZK""HUF""PLN""RON""BGN""TRY""ISK""ILS""INR""IDR""KRW""MYR""PHP""SGD""THB""ZAR""MXN""BRL""RUB""HRK""GRD""CYP""EEK""LTL""LVL""MTL""SIT""SKK""ROL""TRL" | — |
symbols | string | Optional | — | — |
Request examples
# Server-side only. Set KAKIAPI_API_KEY in your secret manager.
# Every gateway operation is called with POST.
# Only operations shown as enabled on the API page can be called.
# Generate once per intent; retain the same value on status checks.
REQUEST_ID="$(uuidgen)"
curl --request POST 'https://kakiapi.com/api/v1/currency/timeseries' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"start":"2024-01-02","end":"2024-01-05","base":"EUR","symbols":"USD"}'Example response
{
"base": "EUR",
"start": "2024-01-02",
"end": "2024-01-05",
"rates": {
"2024-01-02": {
"USD": 1.1
},
"2024-01-03": {
"USD": 1.11
},
"2024-01-04": {
"USD": 1.09
},
"2024-01-05": {
"USD": 1.1
}
}
}Endpoint change
POST /api/v1/currency/fluctuation
Compare the rates at the two ends of a range; no daily values are returned.
Input fields
| Field | Type | Required | Allowed values | Limits |
|---|---|---|---|---|
start | string | Required | — | format date |
end | string | Required | — | format date |
base | string | Optional | 43 values"EUR""USD""JPY""GBP""CHF""AUD""CAD""CNY""HKD""NZD""SEK""NOK""DKK""CZK""HUF""PLN""RON""BGN""TRY""ISK""ILS""INR""IDR""KRW""MYR""PHP""SGD""THB""ZAR""MXN""BRL""RUB""HRK""GRD""CYP""EEK""LTL""LVL""MTL""SIT""SKK""ROL""TRL" | — |
symbols | string | Optional | — | — |
Request examples
# Server-side only. Set KAKIAPI_API_KEY in your secret manager.
# Every gateway operation is called with POST.
# Only operations shown as enabled on the API page can be called.
# Generate once per intent; retain the same value on status checks.
REQUEST_ID="$(uuidgen)"
curl --request POST 'https://kakiapi.com/api/v1/currency/fluctuation' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"start":"2024-01-02","end":"2024-01-05","base":"EUR","symbols":"USD"}'Example response
{
"base": "EUR",
"start": "2024-01-02",
"end": "2024-01-05",
"start_date": "2024-01-02",
"end_date": "2024-01-05",
"rates": {
"USD": {
"start_rate": 1.1,
"end_rate": 1.11,
"change": 0.01,
"change_pct": 0.9090909091
}
}
}Current currency names
POST /api/v1/currency/currencies
Current published code-to-name set. Its membership does not establish availability on historical dates.
Input fields
This operation takes no input fields. Send the JSON request body shown below.
Request examples
# Server-side only. Set KAKIAPI_API_KEY in your secret manager.
# Every gateway operation is called with POST.
# Only operations shown as enabled on the API page can be called.
# Generate once per intent; retain the same value on status checks.
REQUEST_ID="$(uuidgen)"
curl --request POST 'https://kakiapi.com/api/v1/currency/currencies' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{}'Example response
{
"date": "2024-01-05",
"base": "EUR",
"count": 3,
"currencies": {
"USD": "US dollar",
"GBP": "Pound sterling",
"JPY": "Japanese yen"
}
}