The default base currency of the API is US Dollars (USD), but you can request exchange rates relative to a different base currency, where available, by setting the base parameter in your request.

📘

Changing Base Currency is currently available for clients on the Developer, Enterprise and Unlimited plans.

Any currency can be chosen as a base currency when requesting the latest rates, as well as historical rates and time-series (where available).

The base currency should be requested with its 3-digit ISO code (see our list of available API currencies if in doubt).

Results will be delivered relative to 1 unit of the currency you have requested.

Basic Request & Response*

Append the base query parameter to your API request, along with the required 3-digit ISO currency code or symbol, like so (for Euros):

https://openexchangerates.org/api/latest.json
    ?app_id=[[app:app_id]]
    &base=EUR
$.get('https://openexchangerates.org/api/latest.json', {app_id: '[[app:app_id]]', base: 'GBP'}, function(data) {
    console.log(data);
});

The response format is exactly the same as the standard API response, with all rates in the rates object given relative to 1 standard unit of your requested base currency:

{
    disclaimer: "https://openexchangerates.org/terms/",
    license: "https://openexchangerates.org/license/",
    "timestamp": 1424127600,
    "base": "EUR",
    "rates": {
        "AED": 4.626447,
        "AFN": 61.002415,
        "ALL": 137.92617,
        /* ... */
    }
}

Basic Code Samples

$.get('https://openexchangerates.org/api/latest.json', {app_id: '[[app:app_id]]', base: 'UGX'}, function(data) {
    console.log("1 Ugandan Shilling equals " + data.rates.JPY + " Japanese Yen");
});
More code samples are on their way! Please get in touch if you'd like to submit a new/improved code sample in your languague or framework.

Combining Parameters

Requesting symbols for a specific base currency can be combined with other API parameters, such as requesting specific rates/currencies (symbols) and JSONP callbacks (callback), for example:

https://openexchangerates.org/api/historical/2015-02-16.json
    ?app_id=[[app:app_id]]
    &base=CAD
    &symbols=AUD,GBP,EUR
    &callback=someFunctionName

The response will combine your parameters:

someFunctionName(
{
    disclaimer: "https://openexchangerates.org/terms/",
    license: "https://openexchangerates.org/license/",
    timestamp: 1424127600,
    base: "CAD",
    rates: {
            AUD: 1.032828,
            EUR: 0.706867,
            GBP: 0.522328,
        }
    }
)

Default Base Currency

🚧

The default API base currency is always United States Dollars (USD). It's not currently possible to set another default base for your entire account, so if (for example) you always need rates in GBP, you’ll need to always add &base=GBP to your API requests.