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.


GET/v3/latest

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&currencies[]=USD By 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

    default or compact. With compact every rate is a plain value ("EUR": 0.918456) instead of a code/value object

  • Name
    precision
    Type
    integer
    Description

    Round every value to this many decimals (0 to 10) By default values carry up to 10 decimals

  • Name
    inverse
    Type
    boolean
    Description

    true adds inverse to every rate: the value of one unit of the currency in the base currency (1 / value) Not together with shape=compact

  • Name
    include
    Type
    string
    Description

    change adds change and change_pct to every rate: the difference to the close of the previous day, which meta.change_since names. null when that close has no rate for the currency Not together with shape=compact

  • Name
    format
    Type
    string
    Description

    json (default), csv or xlsx. The CSV has one row per currency: datetime,base_currency,currency,value, plus inverse and change,change_pct when you request them xlsx gives 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

GET
/v3/latest
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

Available in all plans
  • 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

Available in all plans
  • 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
        }
    }
}