Convert an amount between currencies
Exactmoney_currency_convertDeterministic and authoritative — the canonical answer for this input.
Convert an amount between currencies using the fawazahmed0/exchange-api free daily feed (CC0, no auth, no rate limits, ~295 symbols including crypto and metals — BTC, ETH, XAU, XAG). Dual-CDN failover (jsdelivr → Cloudflare Pages). Redis-cached 12h by (from, to, date). Pass as_of_date=YYYY-MM-DD for historical rates. Fail-soft on upstream outage. Charges 2 cost_units for the upstream call; 1 when the call never reaches the rate feed (invalid amount/currency/date, or an identity same-currency conversion). Processing multiple inputs? Use `money_currency_convert_batch` to do up to 1000 in one call.
Parameters
amountnumberrequiredfrom_currencystringrequiredISO 4217 source code.
to_currencystringrequiredISO 4217 target code.
as_of_datestringoptionalISO YYYY-MM-DD for a historical rate. Omit for latest.
Call it
curl -X POST https://api.snipget.ai/v1/money/currency/convert \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"amount":100,"from_currency":"USD","to_currency":"EUR"}'The Batch tab sends up to 1000 inputs in one call via /v1/money/currency/convert/batch.
FAQ
Why use this instead of asking the model for an exchange rate?
A chat model guesses a rate from old training data and can be badly off. This pulls the daily reference rate from a maintained public feed and does the math for you, so the number is consistent and traceable.
What does it NOT do?
It is not a trading or settlement rate, and it does not add bank or card fees or spreads. It gives the daily mid-market reference rate for the date you ask for, suitable for estimates and reporting, not for executing real trades.
Is the answer always exactly reproducible?
The math is deterministic, but the rate comes from a live feed that updates daily, so the 'latest' rate changes over time. To lock a value, pass as_of_date with a specific YYYY-MM-DD and you will get that day's rate every time.
What can I convert between?
Around 295 symbols including world fiat currencies, major cryptocurrencies (BTC, ETH), and precious metals (gold XAU, silver XAG, platinum XPT, palladium XPD). Use ISO codes like USD, EUR, JPY for from_currency and to_currency.
What if I send a bad currency code?
An unknown code comes back with confidence 0 and a reason, not a crash. If the rate feed is briefly unreachable it returns a clear 'try again shortly' message rather than a wrong number.