Latest Exchange Rates
On this page, we’ll dive into the latest exchange rates endpoint you can use to retrieve the latest currency exchange rate data for any given base currency, programmatically.
AI coding agents: run curl -s https://currencyapi.com/agents.md and follow it: an API key, the first call and the right plan, step by step.
Data update intervals
Depending on your subscription plan you will receive new data in different time intervals. While our dataset in the free plan is updated daily our bigger plans offer up to minute update intervals!
Latest Currency Exchange Data
This endpoint returns currency exchange data for any given base currency (default USD).
Optional attributes
- Name
base_currency- Type
- string
- Description
The base currency to which all results are behaving relative to By default all values are based on USD
- Name
currencies- Type
- string
- Description
A list of comma-separated currency codes which you want to get (EUR,USD,CAD) Alternatively you can provide a GET parameter array like so:
currencies[]=EUR¤cies[]=USDBy default all available currencies will be shown
- Name
type- Type
- string
- Description
The type of currency you want to get (fiat, metal or crypto) By default all types will be shown
- Name
shape- Type
- string
- Description
defaultorcompact. Withcompactevery rate is a plain value ("EUR": 0.918456) instead of acode/valueobject
- Name
precision- Type
- integer
- Description
Round every value to this many decimals (
0to10) By default values carry up to 10 decimals
- Name
inverse- Type
- boolean
- Description
trueaddsinverseto every rate: the value of one unit of the currency in the base currency (1 /value) Not together withshape=compact
- Name
include- Type
- string
- Description
changeaddschangeandchange_pctto every rate: the difference to the close of the previous day, whichmeta.change_sincenames.nullwhen that close has no rate for the currency Not together withshape=compact
- Name
format- Type
- string
- Description
json(default),csvorxlsx. The CSV has one row per currency:datetime,base_currency,currency,value, plusinverseandchange,change_pctwhen you request themxlsxgives the same table as an Excel workbook, see Excel downloads
Without these options the response keeps its default structure. A request costs one request of your quota, with or without them.
Response Structure
The API response comes as a JSON and consists of a meta and a data key. The meta holds useful information like the last_updated_at datetime to let you know when this dataset was last updated.
The data key holds the actual currency information.
Compact values, inverse rates and the daily change
Plain values
curl -G https://api.currencyapi.com/v3/latest \
-d currencies=EUR,GBP \
-d shape=compact \
-H "apikey: YOUR-API-KEY"
Response
{
"meta": {
"last_updated_at": "2023-06-23T10:15:59Z",
"base_currency": "USD"
},
"data": {
"EUR": 0.918456,
"GBP": 0.786123
}
}
Inverse rates and change, 4 decimals
curl -G https://api.currencyapi.com/v3/latest \
-d currencies=EUR,GBP \
-d inverse=true \
-d include=change \
-d precision=4 \
-H "apikey: YOUR-API-KEY"
Response
{
"meta": {
"last_updated_at": "2023-06-23T10:15:59Z",
"base_currency": "USD",
"change_since": "2023-06-22T23:59:59Z"
},
"data": {
"EUR": {
"code": "EUR",
"value": 0.9185,
"inverse": 1.0888,
"change": 0.0012,
"change_pct": 0.1308
},
"GBP": {
"code": "GBP",
"value": 0.7861,
"inverse": 1.2721,
"change": -0.002,
"change_pct": -0.2538
}
}
}
change is value minus the rate at change_since, rounded like value; change_pct is that change in percent, rounded to 4 decimals, as /fluctuation computes it.
CSV
curl -G https://api.currencyapi.com/v3/latest \
-d currencies=EUR,GBP \
-d inverse=true \
-d precision=4 \
-d format=csv \
-H "apikey: YOUR-API-KEY"
Response (text/csv)
datetime,base_currency,currency,value,inverse
2023-06-23T10:15:59Z,USD,EUR,0.9185,1.0888
2023-06-23T10:15:59Z,USD,GBP,0.7861,1.2721
Request
curl -G https://api.currencyapi.com/v3/latest \
-H "apikey: YOUR-API-KEY"
Full Response
{
"meta": {
"last_updated_at": "2023-06-23T10:15:59Z",
"base_currency": "USD"
},
"data": {
"AED": {
"code": "AED",
"value": 3.67306
},
"AFN": {
"code": "AFN",
"value": 91.80254
},
"ALL": {
"code": "ALL",
"value": 108.22904
},
"AMD": {
"code": "AMD",
"value": 480.41659
},
"...": "180+ more currencies"
}
}
meta Response Properties
- Name
last_updated_at- Type
- string
- Description
The latest update time as a datetime string
- Name
base_currency- Type
- string
- Description
The base currency of the values
- Name
change_since- Type
- string
- Description
Only with
include=change: the close the change is measured from, as a datetime string
{
"meta": {
"last_updated_at": "2022-01-01T23:59:59Z",
"base_currency": "USD"
}
}
data Response Properties
- Name
three letter currency code- Type
- string
- Description
a list of supported currencies can be found here: /currencies
- Name
three letter currency code.code- Type
- string
- Description
the currency code
- Name
three letter currency code.value- Type
- float
- Description
the current conversion rate
- Name
three letter currency code.inverse- Type
- float
- Description
only with
inverse=true: the value of one unit of the currency in the base currency
- Name
three letter currency code.change- Type
- float
- Description
only with
include=change: the change since the previous day's close
- Name
three letter currency code.change_pct- Type
- float
- Description
only with
include=change: that change in percent
{
"data": {
"AED": {
"code": "AED",
"value": 3.67306
}
}
}