NewConnect Claude, Gemini, ChatGPT, and other AI agents to API Ninjas via our MCP server →

Exchange Rate API

The Exchange Rate API provides current and historical exchange rates on global currencies. Choose from hundreds of different currency pairs.

Note: This API provides exchange rates between fiat currencies. For crypto-to-fiat rates, use the Crypto Price API instead.

Available endpoints:

All supported currencies are available on the free tier with once-daily rates. Premium plans add real-time rates and historical data.

Analyzing FX risk? See the Currency Volatility endpoints below for realized volatility, cones, HV rank, and EWMA/GARCH forecasts. Premium only

Supported Currencies

SymbolCurrencySymbolCurrency
USDUnited States DollarEUREuro
GBPBritish PoundJPYJapanese Yen
AUDAustralian DollarCADCanadian Dollar
CHFSwiss FrancCNYChinese Yuan
INRIndian RupeeHKDHong Kong Dollar
SGDSingapore DollarMXNMexican Peso
AEDUAE DirhamAFNAfghan Afghani
ALLAlbanian LekAMDArmenian Dram
ANGNetherlands Antillean GuldenAOAAngolan Kwanza
ARSArgentine PesoAWGAruban Florin
AZNAzerbaijani ManatBAMBosnia And Herzegovina Konvertibilna Marka
BBDBarbadian DollarBDTBangladeshi Taka
BGNBulgarian LevBHDBahraini Dinar
BIFBurundi FrancBMDBermudan Dollar
BNDBrunei DollarBOBBolivian Boliviano
BRLBrazilian RealBSDBahamian Dollar
BTCBitcoinBTNBhutanese Ngultrum
BWPBotswana PulaBYNNew Belarusian Ruble
BYRBelarusian RubleBZDBelize Dollar
CDFCongolese FrancCLFChilean Unit Of Account
CLPChilean PesoCOPColombian Peso
CRCCosta Rican ColonCUCCuban Convertible Peso
CUPCuban PesoCVECape Verdean Escudo
CZKCzech KorunaDJFDjiboutian Franc
DKKDanish KroneDOPDominican Peso
DZDAlgerian DinarEGPEgyptian Pound
ERNEritrean NakfaETBEthiopian Birr
FJDFijian DollarFKPFalkland Islands Pound
GELGeorgian LariGGPGuernsey Pound
GHSGhanaian CediGIPGibraltar Pound
GMDGambian DalasiGNFGuinean Franc
GTQGuatemalan QuetzalGYDGuyanese Dollar
HNLHonduran LempiraHRKCroatian Kuna
HTGHaitian GourdeHUFHungarian Forint
IDRIndonesian RupiahILSIsraeli New Sheqel
IMPManx poundIQDIraqi Dinar
IRRIranian RialISKIcelandic Króna
JEPJersey PoundJMDJamaican Dollar
JODJordanian DinarKESKenyan Shilling
KGSKyrgyzstani SomKHRCambodian Riel
KMFComorian FrancKPWNorth Korean Won
KRWSouth Korean WonKWDKuwaiti Dinar
KYDCayman Islands DollarKZTKazakhstani Tenge
LAKLao KipLBPLebanese Lira
LKRSri Lankan RupeeLRDLiberian Dollar
LSLLesotho LotiLVLLatvian Lats
LYDLibyan DinarMADMoroccan Dirham
MDLMoldovan LeuMGAMalagasy Ariary
MKDMacedonian DenarMMKMyanma Kyat
MNTMongolian TugrikMOPMacanese Pataca
MROMauritanian OuguiyaMURMauritian Rupee
MVRMaldivian RufiyaaMWKMalawian Kwacha
MYRMalaysian RinggitMZNMozambican Metical
NADNamibian DollarNGNNigerian Naira
NIONicaraguan CordobaNOKNorwegian Krone
NPRNepalese RupeeNZDNew Zealand Dollar
OMROmani RialPABPanamanian Balboa
PENPeruvian Nuevo SolPGKPapua New Guinean Kina
PHPPhilippine PesoPKRPakistani Rupee
PLNPolish ZlotyPYGParaguayan Guarani
QARQatari RiyalRONRomanian Leu
RSDSerbian DinarRUBRussian Ruble
RWFRwandan FrancSARSaudi Riyal
SBDSolomon Islands DollarSCRSeychellois Rupee
SDGSudanese PoundSEKSwedish Krona
SHPSaint Helena PoundSLL, SLESierra Leonean Leone
SOSSomali ShillingSRDSurinamese Dollar
STD, STNSao Tome And Principe DobraSVCSalvadoran Colón
SYPSyrian PoundSZLSwazi Lilangeni
THBThai BahtTJSTajikistani Somoni
TMTTurkmenistan ManatTNDTunisian Dinar
TOPPaangaTRYTurkish New Lira
TTDTrinidad and Tobago DollarTWDNew Taiwan Dollar
TZSTanzanian ShillingUAHUkrainian Hryvnia
UGXUgandan ShillingUYUUruguayan Peso
UZSUzbekistani SomVEF, VESVenezuelan Bolivar
VNDVietnamese DongVUVVanuatu Vatu
WSTSamoan TalaXAFCentral African CFA Franc
XAGSilver (troy ounce)XCDEast Caribbean Dollar
XDRSpecial Drawing RightsXOFWest African CFA Franc
XPFCFP FrancYERYemeni Rial
ZARSouth African RandZMKOld Zambian Kwacha
ZMWZambian KwachaZWGZimbabwe Gold
ZWLZimbabwean Dollar
Online
(4.3)

From 3,186 users

4,200+

Applications using this API

API Status

Online - All Systems Operational

API Response Times

Average
P50
P75
P90
P95
313ms353ms409ms622ms986ms

Didn't find what you were looking for? Suggest an improvement

5 endpoints

https://api.api-ninjas.com/v1/exchangerate

Returns the exchange rate for a given currency pair.

Data freshness depends on your plan: free-tier accounts receive once-daily exchange rates, while premium subscribers receive real-time rates.

Parameters

  • pair  required

    Currency pair to query. Must be in the form of currency1_currency2 (e.g. USD_EUR).

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

The /v1/exchangerate endpoint returns a JSON object with the following fields, or an error if the request is unsuccessful.

  • currency_pair

    The requested currency pair.

  • exchange_rate

    The exchange rate for the given currency pair.

  • timestamp

    Unix timestamp (in seconds) indicating the time at which the exchange rate was applied.

Live Demo

Live demo · no API key required
Query parameters
pair

Get a free API key to get started — no credit card required.

Headers
X-Api-KeyLog in or sign up to get your API key
GET
https://api.api-ninjas.com/v1/exchangerate?pair=GBP_AUD
Sample response
{
"currency_pair": "GBP_AUD",
"exchange_rate": 1.88194,
"timestamp": 1777407695
}

Code Examples

curl -X GET "https://api.api-ninjas.com/v1/exchangerate?pair=GBP_AUD" \ -H "X-Api-Key: YOUR_API_KEY"

If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.

Premium only

https://api.api-ninjas.com/v1/exchangeratehistorical

Returns daily historical exchange rates for a given currency pair. Data is available back to January 1, 1999 for most currency pairs.

Parameters

  • pair  required

    Currency pair to query. Must be in the form of currency1_currency2 (e.g. USD_EUR).

  • date  optional

    Single date to query, in YYYY-MM-DD format. Either date OR both start_date and end_date must be provided.

  • start_date  optional

    Start date of a range query, in YYYY-MM-DD format. Must be used together with end_date.

  • end_date  optional

    End date of a range query, in YYYY-MM-DD format. Date range cannot exceed 180 days.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

The /v1/exchangeratehistorical endpoint returns a JSON array of objects with the following fields, or an error if the request is unsuccessful. A single-date query returns an array of exactly one object.

  • pair

    The requested currency pair.

  • date

    Date of the rate, in YYYY-MM-DD format.

  • rate

    The exchange rate for the given currency pair on the given date.

Live Demo

Live demo
Query parameters
pair
date
start_date
end_date

Get a free API key to get started — no credit card required.

Headers
X-Api-KeyLog in or sign up to get your API key
GET
https://api.api-ninjas.com/v1/exchangeratehistorical?pair=USD_EUR&date=2020-03-15
Sample response
[
{
"pair": "USD_EUR",
"date": "2020-03-15",
"rate": 0.896585
}
]

Code Examples

curl -X GET "https://api.api-ninjas.com/v1/exchangeratehistorical?pair=USD_EUR&date=2020-03-15" \ -H "X-Api-Key: YOUR_API_KEY"

Currency Volatility

Premium subscribers can measure how much a currency pair fluctuates — its FX (historical) volatility — with realized volatility, EWMA (RiskMetrics, λ=0.94) and GARCH(1,1) forecasts, volatility cones, and HV-rank / percentile context. Available for the same 150+ currency pairs (excluding ZWG, BTC, XAG).

Premium only

https://api.api-ninjas.com/v1/currencyvolatility

Returns the latest realized (or EWMA) volatility for a currency pair over a lookback window, together with a volatility cone across standard window lengths and HV rank / percentile context.

Parameters

  • pair  required

    Currency pair to query, in the form currency1_currency2 (e.g. EUR_USD).

  • window  optional

    Lookback window for the headline realized volatility, in trading days. Defaults to 30. Must be between 2 and 1000.

  • method  optional

    Volatility method: close_to_close (default) or ewma.

  • day_count  optional

    Annualization factor: 252 trading days (default) or 365 calendar days.

  • annualized  optional

    Whether to treat the annualized figure as the headline value. Defaults to true.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

The /v1/currencyvolatility endpoint returns a JSON object with the following fields, or an error if the request is unsuccessful.

  • pair

    The queried currency pair.

  • as_of_date

    Date of the most recent return used (YYYY-MM-DD).

  • annualized_volatility

    Annualized volatility as a decimal (e.g. 0.0785 = 7.85%). annualized_volatility_pct gives the same value as a percentage.

  • daily_volatility

    Daily volatility as a decimal. daily_volatility_pct gives the percentage form.

  • n_observations

    Number of returns used for the headline figure.

  • outliers_filtered

    Number of extreme returns (over 30%) excluded as data artifacts or regime breaks.

  • percentile_context

    Object with the HV rank and percentile of the current volatility within its trailing one-year distribution (current_percentile, hv_rank, min, median, max, lookback_years).

  • cone

    Volatility cone: an array with one entry per window length (10, 21, 63, 126, 252 trading days), each giving the historical min, p25, median, p75, max of rolling realized volatility plus the current reading and its current_percentile.

  • method

    Echo of the requested method.

  • window_days

    Echo of the requested window, in days.

  • day_count

    Echo of the requested day_count.

  • annualized

    Echo of the requested annualized setting.

Live Demo

Live demo
Query parameters
pair
window

Get a free API key to get started — no credit card required.

Headers
X-Api-KeyLog in or sign up to get your API key
GET
https://api.api-ninjas.com/v1/currencyvolatility?pair=EUR_USD&window=30
Sample response
{
"pair": "EUR_USD",
"as_of_date": "2026-05-21",
"method": "close_to_close",
"window_days": 30,
"annualized": true,
"day_count": 252,
"annualized_volatility": 0.0785,
"annualized_volatility_pct": 7.85,
"daily_volatility": 0.00494,
"daily_volatility_pct": 0.494,
"n_observations": 30,
"outliers_filtered": 0,
"percentile_context": {
"lookback_years": 1,
"current_percentile": 73,
"hv_rank": 64,
"min": 0.0412,
"median": 0.0673,
"max": 0.0998
},
"cone": [
{
"window_days": 10,
"min": 0.034,
"p25": 0.052,
"median": 0.071,
"p75": 0.094,
"max": 0.218,
"current": 0.083,
"current_percentile": 64
},
{
"window_days": 21,
"min": 0.041,
"p25": 0.058,
"median": 0.069,
"p75": 0.088,
"max": 0.183,
"current": 0.079,
"current_percentile": 58
},
{
"window_days": 63,
"min": 0.048,
"p25": 0.061,
"median": 0.071,
"p75": 0.083,
"max": 0.142,
"current": 0.077,
"current_percentile": 52
},
{
"window_days": 126,
"min": 0.052,
"p25": 0.064,
"median": 0.072,
"p75": 0.082,
"max": 0.118,
"current": 0.075,
"current_percentile": 48
},
{
"window_days": 252,
"min": 0.057,
"p25": 0.066,
"median": 0.072,
"p75": 0.079,
"max": 0.099,
"current": 0.073,
"current_percentile": 41
}
]
}

Code Examples

curl -X GET "https://api.api-ninjas.com/v1/currencyvolatility?pair=EUR_USD&window=30" \ -H "X-Api-Key: YOUR_API_KEY"

Premium only

https://api.api-ninjas.com/v1/currencyvolatilityhistorical

Returns a daily time series of trailing rolling volatility for a currency pair over a date range, with each point tagged by its percentile rank, plus a volatility cone snapshot as of the end date.

Parameters

  • pair  required

    Currency pair to query, in the form currency1_currency2 (e.g. EUR_USD).

  • window  optional

    Rolling window for volatility, in trading days. Defaults to 30.

  • method  optional

    Volatility method: close_to_close (default) or ewma.

  • days  optional

    Length of the trailing date range in calendar days, ending today. Defaults to 90. Maximum 1825. Mutually exclusive with start_date/end_date.

  • start_date  optional

    Start of an explicit date range, in YYYY-MM-DD form. Provide together with end_date instead of days. The range cannot exceed 1825 days.

  • end_date  optional

    End of the date range, in YYYY-MM-DD form. Provide together with start_date.

  • day_count  optional

    Annualization factor: 252 trading days (default) or 365 calendar days.

  • annualized  optional

    Whether to treat the annualized figure as the headline value. Defaults to true.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

The /v1/currencyvolatilityhistorical endpoint returns a JSON object with the following fields, or an error if the request is unsuccessful.

  • series

    Array of daily points, each with a date, annualized_volatility, daily_volatility, and percentile (rank of that day's volatility within its trailing one-year distribution).

  • cone

    Volatility cone as of the end date — same structure as in the /v1/currencyvolatility endpoint.

  • n_points

    Number of series points returned.

  • outliers_filtered

    Count of extreme returns excluded.

  • pair

    Echo of the requested pair.

  • method

    Echo of the requested method.

  • window_days

    Echo of the requested window, in days.

  • day_count

    Echo of the requested day_count.

  • annualized

    Echo of the requested annualized setting.

  • start_date

    Start of the resolved date range.

  • end_date

    End of the resolved date range.

Live Demo

Live demo
Query parameters
pair
window
days

Get a free API key to get started — no credit card required.

Headers
X-Api-KeyLog in or sign up to get your API key
GET
https://api.api-ninjas.com/v1/currencyvolatilityhistorical?pair=EUR_USD&window=30&days=90
Sample response
{
"pair": "EUR_USD",
"method": "close_to_close",
"window_days": 30,
"day_count": 252,
"annualized": true,
"start_date": "2026-02-21",
"end_date": "2026-05-21",
"n_points": 3,
"outliers_filtered": 0,
"series": [
{
"date": "2026-02-23",
"annualized_volatility": 0.0712,
"daily_volatility": 0.00449,
"percentile": 61
},
{
"date": "2026-02-24",
"annualized_volatility": 0.0731,
"daily_volatility": 0.0046,
"percentile": 64
},
{
"date": "2026-02-25",
"annualized_volatility": 0.0708,
"daily_volatility": 0.00446,
"percentile": 59
}
],
"cone": [
{
"window_days": 21,
"min": 0.041,
"p25": 0.058,
"median": 0.069,
"p75": 0.088,
"max": 0.183,
"current": 0.079,
"current_percentile": 58
}
]
}

Code Examples

curl -X GET "https://api.api-ninjas.com/v1/currencyvolatilityhistorical?pair=EUR_USD&window=30&days=90" \ -H "X-Api-Key: YOUR_API_KEY"

Premium only

https://api.api-ninjas.com/v1/currencyvolatilityforecast

Returns forward-looking volatility estimates for a currency pair using EWMA (RiskMetrics) or GARCH(1,1). GARCH adds mean reversion toward a long-run volatility level; if the GARCH fit does not converge the response falls back to EWMA. These are model-based estimates, not predictions.

Parameters

  • pair  required

    Currency pair to query, in the form currency1_currency2 (e.g. GBP_JPY).

  • method  optional

    Forecast method: garch_11 (default) or ewma.

  • lambda  optional

    EWMA decay factor, used only when method=ewma. Defaults to 0.94 (RiskMetrics). Must be between 0.80 and 0.99.

  • horizon  optional

    Comma-separated list of forecast horizons in trading days (e.g. 1,5,21,63). Defaults to 1,5,21,63.

  • day_count  optional

    Annualization factor: 252 trading days (default) or 365 calendar days.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

The /v1/currencyvolatilityforecast endpoint returns a JSON object with the following fields, or an error if the request is unsuccessful.

  • current_conditional_vol_annualized

    The model's current one-step-ahead annualized volatility.

  • forecast

    Array of forecasts, each with a horizon_days, vol_annualized, and vol_daily.

  • parameters

    Fitted model parameters. For garch_11: omega, alpha, beta, persistence, long_run_var, long_run_vol_annualized, and fitted_on. For ewma: lambda and fitted_on.

  • fallback

    true when a requested GARCH fit did not converge and an EWMA estimate was returned instead.

  • pair

    Echo of the requested pair.

  • as_of_date

    Date of the most recent return used.

  • method

    Echo of the requested method.

  • day_count

    Echo of the requested day_count.

  • outliers_filtered

    Count of extreme returns excluded.

Live Demo

Live demo
Query parameters
pair
horizon

Get a free API key to get started — no credit card required.

Headers
X-Api-KeyLog in or sign up to get your API key
GET
https://api.api-ninjas.com/v1/currencyvolatilityforecast?pair=GBP_JPY&method=garch_11&horizon=1%2C5%2C21%2C63
Sample response
{
"pair": "GBP_JPY",
"as_of_date": "2026-05-21",
"method": "garch_11",
"day_count": 252,
"parameters": {
"omega": 6.4e-7,
"alpha": 0.043,
"beta": 0.951,
"persistence": 0.994,
"long_run_var": 0.000079,
"long_run_vol_annualized": 0.141,
"fitted_on": "rolling_1500d"
},
"current_conditional_vol_annualized": 0.158,
"outliers_filtered": 0,
"fallback": false,
"forecast": [
{
"horizon_days": 1,
"vol_annualized": 0.157,
"vol_daily": 0.00989
},
{
"horizon_days": 5,
"vol_annualized": 0.156,
"vol_daily": 0.00983
},
{
"horizon_days": 21,
"vol_annualized": 0.153,
"vol_daily": 0.00964
},
{
"horizon_days": 63,
"vol_annualized": 0.149,
"vol_daily": 0.00939
}
]
}

Code Examples

curl -X GET "https://api.api-ninjas.com/v1/currencyvolatilityforecast?pair=GBP_JPY&method=garch_11" \ -H "X-Api-Key: YOUR_API_KEY"

If your programming language is not listed in the Code Examples above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.

Frequently Asked Questions

  • Yes, but you must have a premium subscription. Commercial use of the Exchange Rate API is not permitted on the free tier. See our pricing page to choose a plan that fits your needs.
  • Sign up for a free account to instantly get your API key, then pass it in the X-Api-Key header on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.
  • Your API requests will simply be denied once you hit your monthly quota — you will never be charged more than the plan you signed up for. To increase your quota, you can upgrade your plan any time on our pricing page.
  • The API responds with a standard HTTP status code and a JSON error message describing the problem. See our error codes reference for the full list of codes and how to resolve each one, or contact support if you need help.
  • Send a GET request to the /v1/exchangerate endpoint with the required pair parameter formatted as currency1_currency2 (for example GBP_AUD or USD_EUR), and the response returns a rate value along with a timestamp. You can browse all available endpoints and supported currencies on this page.
  • Yes, the premium-only /v1/exchangeratehistorical endpoint returns daily historical rates back to January 1, 1999 for most pairs; query a single day with the date parameter or a span using start_date and end_date (in YYYY-MM-DD format, with a range no longer than 180 days). Historical access requires a paid plan, which you can review on the pricing page.
  • The API covers hundreds of currency pairs across global currencies, and all currencies are available on the free tier with once-daily rates; premium plans add real-time rates and daily historical exchange rates. Each response includes a timestamp for the rate. For deriving converted amounts you can pair this with the Convert Currency API.
  • Use it to display live FX quotes, build pricing or checkout flows in multiple currencies, or backtest strategies using the daily history from the /v1/exchangeratehistorical endpoint. For related financial analysis you may also find the Currency Volatility and Interest Rate APIs useful.
  • It is built for FX risk and trading analytics: sizing positions and setting stops by realized volatility, gauging whether current volatility is high or low via the cone and hv_rank, and producing forward-looking risk estimates with EWMA or GARCH(1,1) forecasts. It pairs naturally with the Exchange Rate API for live rates and the Convert Currency API for conversions.
  • Volatility is available for over 150 fiat currency pairs (the same set as the Convert Currency API, excluding ZWG, BTC, and XAG), specified with the pair parameter in currency1_currency2 form such as EUR_USD. It is computed as the sample standard deviation of daily logarithmic returns from closing rates, annualized by the square root of 252 trading days; see the full API docs for details.
  • /v1/currencyvolatility returns the latest realized (or EWMA) volatility over a window plus a volatility cone and percentile context; /v1/currencyvolatilityhistorical returns a daily series of trailing rolling volatility over a days range (max 1825); and /v1/currencyvolatilityforecast returns forward-looking EWMA or garch_11 estimates across the horizon days you request. All three are premium endpoints, listed on the pricing page.
  • Call /v1/currencyvolatilityforecast with a pair and choose method=garch_11 (default, with mean reversion) or method=ewma; the response includes current_conditional_vol_annualized, a forecast array (each with horizon_days, vol_annualized, vol_daily), fitted parameters, and a fallback flag set to true when a GARCH fit fails to converge and EWMA is returned instead. These are model-based estimates rather than predictions; unsuccessful requests return an error.
  • It is realized volatility, also called historical volatility (HV): it is measured from actual past exchange-rate movements, not implied volatility derived from options prices. The /v1/currencyvolatility endpoint returns an hv_rank and percentile showing whether current FX volatility is high or low versus its trailing-year range, and the forecast endpoint adds forward-looking EWMA and GARCH(1,1) estimates.