API ReferenceMid market rates

Convert to a currency amount from one or multiple other currencies.

GET
/v1/convert_to

In the example below, the Convert TO API query endpoint is to convert to GBP from all available currencies (the asterisk * represents ALL currencies). https://xecdapi.xe.com/v1/convert_to.csv/?to=GBP&from=*&amount=1

Authorization

AuthorizationBearer <token>

API key created on your Xe Currency Data account's API page, sent as a Bearer token in the Authorization header.

In: header

Query Parameters

from*string

Comma separated list of to currencies ISO codes. This will limit the data returned to only those currencies you are interested in. Use an asterisk * to convert all currencies. Note: Obsolete currencies are replaced by their successor currency.

to?string

OPTIONAL - Currency you want to convert to ISO code. Note if this parameter is omitted, default is USD.

amount?number

OPTIONAL – This parameter can be used to specify the amount you want to convert, if an amount is not specified then 1 is assumed.

obsolete?boolean

OPTIONAL – If ‘true’ then endpoint will display rates for currencies that are obsolete. If ‘false’ then obsolete currencies are replaced by their successor currency.

interval?string

OPTIONAL – Using one of the interval values below in your call request will return rates for that specific interval.

"daily" - Returns the latest daily rate at your pre-chosen daily lock-in time "hourly" - Returns rates for the most recent hour "15minutes" - Returns rates for the most recent 15 minute period "minutely" - Returns rates for the most recent minute

If omitted, we’ll default to your fastest rate frequency (i.e. live, 15-min, hourly, then daily) as per your subscription plan.

inverse?boolean

OPTIONAL – If ‘true’ then endpoint will display the inverse of the converted value. If ‘false‘ then it will not be displayed.

decimal_places?number

OPTIONAL – This parameter can be used to specify the number of decimal places included in the output. Example 1 USD to EUR = 0.874852 with decimal_places=3, the output returned will be EUR = 0.875

margin?number

OPTIONAL – This parameter can be used to add a margin (-/+) to XE's mid-market rate. Example: add margin=2.05 parameter to the endpoint and the API will return our mid-market rates plus the margin of 2.05 percent.

crypto?boolean

OPTIONAL – If 'true' then this endpoint will return data for the following crypto currencies: ADA, ARB, AVAX, BCH, BNB, BTC, DAI, DOGE, DOT, ETH, EURC, LINK, LTC, LUNA, POL, SOL, TRX, UNI, USDC, USDP, USDT, XLM and XRP.

skip_weekends?boolean

OPTIONAL - Applicable to queries with rate intervals faster than daily. If 'true' then requests during the weekend will respond with the rate as of market close (Friday, 5pm America/New_York).

Response Body

application/json

application/json

application/json

application/json

application/json

text/plain

curl -X GET "https://example.com/v1/convert_to?from=string"
{  "terms": "https://www.xe.com/legal",  "privacy": "https://www.xe.com/privacy",  "to": "GBP",  "amount": 1,  "timestamp": "2026-09-24T14:25:00Z",  "from": [    {      "quotecurrency": "EUR",      "mid": 1.1623050132    },    {      "quotecurrency": "USD",      "mid": 1.32212641    }  ]}
Empty
{  "code": 42,  "message": "Invalid interval requested: BOGUS",  "documentation_url": "https://developers.xe.com/docs/currency-data-api"}
{  "code": 1,  "message": "Bad credentials",  "documentation_url": "https://developers.xe.com/docs/currency-data-api"}
{  "code": 3,  "message": "Monthly rate limit exceeded.",  "documentation_url": "https://developers.xe.com/docs/currency-data-api"}
{  "code": 4,  "message": "Current interval rate limit exceeded.",  "documentation_url": "https://developers.xe.com/docs/currency-data-api"}
"An unexpected error occurred"
Get help