# Cross Rates Matrix

Returns every cross rate between 2 to 25 currencies in one request, as JSON or as a ready-made CSV table. data.EUR.USD is the price of 1 EUR in USD. Instead of requesting the latest rates once per base currency, one request returns the full table. Latest by default, or for the close of a past date. Available in all plans.

Request Method: GET
Request URL: https://api.fxapi.com/v1/matrix

# Request Parameters

Parameter Type Mandatory Description
apikey string ️ Your API Key
currencies string ️ 2 to 25 comma-separated currency codes (USD,EUR,GBP)
The array form currencies[]=USD&currencies[]=EUR is also accepted
Rows and columns keep this order
date string The rates at the close of this past day (format: 2021-12-31)
precision integer Round every rate to this many decimals (0 to 10)
By default values carry up to 10 decimals
format string json (default), csv or xlsx. The CSV is the table itself: a header base_currency,USD,EUR,GBP and one row per base currency
xlsx gives the same table as an Excel workbook, see Excel downloads (opens new window)

A request costs one request of your quota, however many currencies it holds. Fewer than 2 or more than 25 currencies return a 422.

# Sample Request

curl -G https://api.fxapi.com/v1/matrix \
    -d currencies=USD,EUR,GBP \
    -H "apikey: YOUR-API-KEY"

# Sample Response

meta.currencies lists the rows and columns in order. data.BASE.QUOTE is the price of one unit of BASE in QUOTE: 1 where both are the same currency, null where a currency has no rate.

{
    "meta": {
        "last_updated_at": "2023-06-23T10:15:59Z",
        "currencies": ["USD", "EUR", "GBP"]
    },
    "data": {
        "USD": {
            "USD": 1,
            "EUR": 0.918456,
            "GBP": 0.786123
        },
        "EUR": {
            "USD": 1.0887771,
            "EUR": 1,
            "GBP": 0.8559168
        },
        "GBP": {
            "USD": 1.2720671,
            "EUR": 1.1683413,
            "GBP": 1
        }
    }
}

# CSV Table

curl -G https://api.fxapi.com/v1/matrix \
    -d currencies=USD,EUR,GBP \
    -d format=csv \
    -H "apikey: YOUR-API-KEY"
base_currency,USD,EUR,GBP
USD,1,0.918456,0.786123
EUR,1.0887771,1,0.8559168
GBP,1.2720671,1.1683413,1