CurrencyRateAPI

Quick Launch Tool

Need to test the API without digging through full documentation? Head to the Control Panel, where you’ll find the Quick Launch Tool — a simple way to try out all available endpoints with a single click.

Click the button below to register for free and start using the Quick Launch Tool.

Getting Started

Key terms and concepts you’ll need to begin working with Currency Rate API:

Definition Description
Symbol Three-letter currency code.
Base currency The currency from which conversion starts. For example, if 1 USD = X EUR, then USD is the base currency. Default base currency is EUR.
Target currency The currency into which the base currency is converted. Using the same example, EUR is the target currency.
Base URL The root URL used for all API endpoints. All requests are sent to this base path.

API Response

The exchange rates provided by CurrencyRateAPI are by default in Euro. All data is returned in standard JSON format and can be easily parsed using any programming language.

Sample response:
Below you will find a sample API response containing a range of common world currencies, all relative to the EUR currency and with a timestamp in which they were received.

{
    "success": true,
    "last_update_unix": 1519296206,
    "query_parameters": {
        "codes": ["GBP", "JPY", "EUR"],
        "base_currency": "USD"
    },
    "result": {
        "GBP": 1.566015,
        "JPY": 1.560132,
        "EUR": 1.154727
    }
}

As shown above, the API response for real-time exchange rates includes several key fields:

  • success indicates whether the request was successful.
  • last_update_unix shows the timestamp (in Unix format) of the latest available data.
  • query_parameters reflects the parameters used in the request.
  • result holds the list of requested currencies and their current exchange rates.

Available Endpoints

CurrencyRateAPI includes several API endpoints, each offering specific functionality. Availability of certain endpoints depends on your subscription plan.

  • End point of currencies list.This endpoint returns up-to-date exchange symbol data for all available currencies, or for a specific set if requested. It can be used to retrieve supported currency codes and their corresponding names.
  • End point of last rates.This endpoint returns real-time exchange rate data for all supported currencies, or for a specific set defined in the request.
  • End point of conversion.This endpoint allows you to convert a specified amount from one currency to another using the latest available exchange rate.
  • End point of historical rates.This endpoint returns historical exchange rate data for all supported currencies, or for a specific set, as of a given date. Historical data is available from January 4, 1999. Date format: YYYY-MM-DD.
  • End point of time series data.This endpoint returns daily historical exchange rate data for all supported currencies, or a selected set, within a specified date range. Date format: YYYY-MM-DD.
  • End point of vibration data.This endpoint returns exchange rate fluctuation data between two specified dates for all supported currencies, or a selected set. Date format: YYYY-MM-DD.

SSL Connection

All plans on CurrencyRateAPI support 256-bit SSL encryption. To connect securely, use the https protocol instead of http.

Endpoints

Supported Symbols Endpoint

https://currencyrateapi.com/api/codes

API Response:

{
    "success": true,
    "last_update_unix": 1585267200,
    "result": {
        "AED": "United Arab Emirates Dirham",
        "AFN": "Afghan Afghani",
        "ALL": "Albanian Lek",
        [...]
    }
}

Response Objects:

Key Description
success Returns true for a successful request. If false, an error object will be included in the response.
last_update_unix Returns a Unix timestamp indicating when the returned data was last updated.
result Returns all supported currencies with matching three-letter codes and names.

Latest Rates Endpoint

https://currencyrateapi.com/api/latest?
    base_currency=USD&
    codes=GBP,JPY,EUR

Request Parameters:

Parameter Description
base_currency [Required] Enter a 3-letter ISO currency code to set the base currency for conversion.
codes [Optional] Enter a comma-separated list of currency codes to limit the response to specific currencies.

API Response:

{
    "success": true,
    "last_update_unix": 1519296206,
    "query_parameters": {
        "codes": ["GBP", "JPY", "EUR"],
        "base_currency": "USD"
    },
    "result": {
        "GBP": 0.882047,
        "JPY": 132.360679,
        "EUR": 0.813399
    }
}

Response Objects:

Key Description
success Returns true for a successful request. If false, an error object will be included in the response.
last_update_unix Returns a Unix timestamp indicating when the returned data was last updated.
query_parameters Returns the parameters used in the current API request.
result Returns exchange rate data for the currencies specified in the request.

Endpoint of Historical Rates

https://currencyrateapi.com/api/history?
    date=2020-05-25&
    base_currency=GBP&
    codes=USD,EUR,CAD

Request Parameters:

Parameter Description
date [Required] The historical date for which exchange rates are requested. Format: YYYY-MM-DD.
base_currency [Required] Enter a 3-letter currency code to set the base currency for the conversion.
codes [Optional] Enter a comma-separated list of currency codes to limit the response to specific currencies.

API Response:

{
    "success": true,
    "query_parameters": {
        "date": "2025-05-25",
        "codes": ["USD", "EUR", "CAD"],
        "base_currency": "GBP"
    },
    "result": {
        "USD": 1.636492,
        "EUR": 1.196476,
        "CAD": 1.739516
    }
}

Response Objects:

Key Description
success Returns true for a successful request. If false, an error object will be included in the response.
query_parameters Returns the parameters used in the current API request.
result Returns exchange rate data for the currencies on the date specified in the request.

Convertion Endpoint

https://currencyrateapi.com/api/convert?
    base_currency=USD&
    codes=EUR,JPY,AUD&
    amount=10

Request Parameters:

Parameter Description
base_currency [Required] The three-letter currency code of the currency you want to convert from.
codes [Required] Enter a comma-separated list of 3-letter currency codes to convert the amount into.
amount [Required] Specifies the amount to be converted.
date [Optional] Specify date (YYYY-MM-DD format) to use historical rates for this conversion.

API Response:

{
    "success": true,
    "last_update_unix": 1585267200,
    "query_parameters": {
        "base_currency": "USD",
        "codes": ["EUR", "JPY", "AUD"],
        "amount": 10
    },
    "result": {
        "EUR": 9.50,
        "JPY": 1500.50,
        "AUD": 14.80
    }
}

Response Objects:

Key Description
success Returns true for a successful request. If false, an error object will be included in the response.
last_update_unix Returns a Unix timestamp indicating when the returned data was last updated.
query_parameters Returns the parameters used in the current API request.
result Returns conversion rate data for the currencies specified in the request.

Time-Series Endpoint

https://currencyrateapi.com/api/timeframe?
    from=2012-06-20&
    to=2012-06-30&
    codes=EUR,AUD,CAD&
    base_currency=USD

Request Parameters:

Parameter Description
from [Required] Specifies the start date of the requested timeframe in YYYY-MM-DD format. Historical data is available starting from 1999-01-04.
to [Required] Specifies the end date of the requested timeframe in YYYY-MM-DD format.
codes [Required] Enter a comma-separated list of 3-letter currency codes to specify which currencies to include in the response.
base_currency [Required] Enter a comma-separated list of 3-letter currency codes to limit the response to specific currencies.

API Response:

{
    "success": true,
    "query_parameters": {
        "form": "2012-06-20",
        "to": "2012-06-30",
        "codes": ["EUR","AUD","CAD"],
        "base_currency": "USD",
    },
    "result": {
        "2012-06-20": { "USD": 1.322891, "AUD": 1.278047, "CAD": 1.302303 },
        "2012-06-21": { "USD": 1.315066, "AUD": 1.274202, "CAD": 1.299083 },
        "2012-06-22": { "USD": 1.314491, "AUD": 1.280135, "CAD": 1.296868 },
        ...
        "2012-06-30": { "USD": 1.314492, "AUD": 1.283121, "CAD": 1.289616 }
    }
}

Response Objects:

Key Description
success Returns true for a successful request. If false, an error object will be included in the response.
query_parameters Returns the parameters used in the current API request.
result Returns daily exchange rate data for each day within the specified date range.

Fluctuation Endpoint

https://currencyrateapi.com/api/fluctuation?
    from=2012-06-01&
    to=2012-06-30&
    codes=USD,JPY&
    base_currency=EUR 

Request Parameters:

Parameter Description
from [Required] Specifies the start date of the requested timeframe in YYYY-MM-DD format. The earliest supported date is 1999-01-04.
to [Required] Specifies the end date of the requested timeframe in YYYY-MM-DD format.
codes [Required] Enter a comma-separated list of 3-letter currency codes to specify which currencies to include in the response.
base_currency [Required] Enter a comma-separated list of 3-letter currency codes to limit the response to specific currencies.

API Response:

{
    "success": true,
    "query_parameters": {
        "from":"2012-06-01",
        "to": "2012-06-30",
        "codes":"USD,JPY",
        "base_currency":"EUR"
    },
    "result": {
        "USD": {
            "start_rate": 1.228952,
            "end_rate": 1.232735,
            "change": 0.0038,
            "change_percent": 0.3078,
        },
        "JPY": {
            "start_rate": 131.587611,
            "end_rate": 131.651142,
            "change": 0.0635,
            "change_percent": 0.0483
        }
    }
}

Response Objects:

Key Description
success Returns true for a successful request. If false, an error object will be included in the response.
query_parameters Returns the parameters used in the current API request.
result Returns exchange rate data for the currencies specified in the request.
result > start_rate Returns the exchange rate for the specified start date (Date format: YYYY-MM-DD).
result > end_rate Returns the exchange rate for the specified end date (Date format: YYYY-MM-DD).
result > change Returns the decimal value of the exchange rate change between the start and end dates for the specified currency (Date format: YYYY-MM-DD).
result > change_percent Returns the percentage change in the exchange rate between the start and end dates for the specified currency (Date format: YYYY-MM-DD).

Sample Code

PHP (cURL)

// Set API Endpoint
$endpoint = 'latest';

// Initialize CURL:
$ch = curl_init('https://currencyrateapi.com/api/'.$endpoint);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

// Store the data:
$json = curl_exec($ch);
curl_close($ch);

// Decode JSON response:
$exchangeRates = json_decode($json, true);

// Access the exchange rate values, e.g. GBP:
echo $exchangeRates['result']['GBP'];

Convert currencies:

The following PHP cURL example demonstrates how to convert currencies using the CurrencyRateAPI

// Set API Endpoint and required parameters
$endpoint = 'convert';

$base_currency = 'USD';
$target_currency = 'EUR';
$amount = 10;

// Initialize CURL:
$url = 'https://currencyrateapi.com/api/' . $endpoint .
       '?base_currency=' . $base_currency .
       '&codes=' . $codes .
       '&amount=' . $amount;

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

// Get the JSON data:
$json = curl_exec($ch);
curl_close($ch);

// Decode JSON response:
$exchangeRates = json_decode($json, true);

// Access the conversion result:
echo $exchangeRates['result'];

JavaScript (fetch)

 // Set endpoint
const endpoint = 'latest';
const base = '?base_currency=USD';

// Get the most recent exchange rates via the "latest" endpoint:
fetch('https://currencyrateapi.com/api/' + endpoint + base)
    .then(response => {
        return response.json();
    })
    .then(json => {

        // Exchange rate data is stored in json.result
        alert(json.result.GBP);

        // Timestamp can be accessed in json.last_update_unix
        alert(json.last_update_unix);
    })
    .catch(error => {
        console.error('Fetch error:', error);
    });

Convert Currencies:
Here's how to convert currencies using fetch.

// Set endpoint
var endpoint = 'convert';

// Define from currency, to currency, and amount
var base_currency = 'EUR';
var codes = 'GBP,USD,AUD';
var amount = '10';

// Execute the conversion using the "convert" endpoint:
fetch(
  'https://currencyrateapi.com/api/' +
    endpoint +
    '?base_currency=' + base_currency +
    '&codes=' + codes +
    '&amount=' + amount
)
  .then(function(response) {
    if (!response.ok) {
      throw new Error('Network response was not ok: ' + response.status);
    }
    return response.json();
  })
  .then(function(json) {
    // Access the conversion result in json.result
    alert(JSON.stringify(json.result, null, 2));
  })
  .catch(function(error) {
    console.error('Fetch error:', error);
  });