Try our API in 3 Easy Steps
Our documentation is extensive and you can start in minutes.
Documentation API v1
Available Currencies For Live and Convert Endpoints
A list of the available currencies for the /live and the /convert endpoint, can be accessed through requesting the live_currencies_list endpoint or visiting list of live exchange rates. In order to request data, add the currencies codes together to form a currency pair. For example, EURUSD can be requested by adding EUR and USD together. To get the inverse of the same pair, simply reverse the quote to USDEUR. To access JSON object containing all available currency codes verus USD, Simply append your api_key to the TraderMade exchange rates API apicurrencies endpoint:
Request Example:
https://marketdata.tradermade.com/api/v1/live_currencies_list?api_key=api_key Sign Up
Response Example:
{
"available_currencies": {
"AED": "UAE Dirham",
"ARS": "Argentine Peso",
"AUD": "Australian Dollar",
"BRL": "Brazilian Real",
"BTC": "Bitcoin",
"CAD": "Canadian Dollar",
"CHF": "Swiss Franc",
"CLP": "Chilean Peso",
"CNY": "Chinese Yuan",
"COP": "Colombian Peso",
"CZK": "Czech Koruna",
"DKK": "Danish Krone",
"EUR": "Euro",
"GBP": "British Pound Sterling",
"HKD": "Hong Kong Dollar",
"HRK": "Croatian Kuna",
"HUF": "Hungarian Forint",
"IDR": "Indonesian Rupiah",
"ILS": "Israeli New Sheqel",
"INR": "Indian Rupee",
"ISK": "Icelandic Krona",
"JPY": "Japanese Yen",
"KRW": "South Korean Won",
"KWD": "Kuwaiti Dinar",
"MAD": "Moroccan Dirham",
"MXN": "Mexican Peso",
"MYR": "Malaysian Ringgit",
"NOK": "Norwegian Krone",
"NZD": "New Zealand Dollar",
"PEN": "Peruvian Nuevo Sol",
"PHP": "Philippine Peso",
"PLN": "Polish Zloty",
"RON": "Romanian Leu",
"RUB": "Russian Ruble",
"SEK": "Swedish Krona",
"SGD": "Singapore Dollar",
"THB": "Thai Baht",
"TRY": "Turkish Lira",
"TWD": "Taiwanese Dollar",
"USD": "US Dollar",
"XAG": "Silver (troy ounce)",
"XAU": "Gold (troy ounce)",
"ZAR": "South African Rand"
},
"endpoint": "live_currencies"
}
Available Currencies For Historical, PandasDF, Timeseries, and Minute_Historical Endpoints
A list of the available currencies for the /historical, /pandasDF, ./timeseries,, and the /minute_historical endpoints, can be accessed through requesting the historical_currencies_list endpoint or visiting list of historical exchange rates.
Request Example:
https://marketdata.tradermade.com/api/v1/historical_currencies_list?api_key=api_key Sign Up
Response Example:
{
"available_currencies": {
"AED": "UAE Dirham",
"ARS": "Argentine Peso",
"AUD": "Australian Dollar",
"BRL": "Brazilian Real",
"BTC": "Bitcoin",
"CAD": "Canadian Dollar",
"CHF": "Swiss Franc",
"CLP": "Chilean Peso",
"CNY": "Chinese Yuan",
"COP": "Colombian Peso",
"CZK": "Czech Koruna",
"DKK": "Danish Krone",
"EUR": "Euro",
"GBP": "British Pound Sterling",
"HKD": "Hong Kong Dollar",
"HRK": "Croatian Kuna",
"HUF": "Hungarian Forint",
"IDR": "Indonesian Rupiah",
"ILS": "Israeli New Sheqel",
"INR": "Indian Rupee",
"ISK": "Icelandic Krona",
"JPY": "Japanese Yen",
"KRW": "South Korean Won",
"KWD": "Kuwaiti Dinar",
"MAD": "Moroccan Dirham",
"MXN": "Mexican Peso",
"MYR": "Malaysian Ringgit",
"NOK": "Norwegian Krone",
"NZD": "New Zealand Dollar",
"PEN": "Peruvian Nuevo Sol",
"PHP": "Philippine Peso",
"PLN": "Polish Zloty",
"RON": "Romanian Leu",
"RUB": "Russian Ruble",
"SEK": "Swedish Krona",
"SGD": "Singapore Dollar",
"THB": "Thai Baht",
"TRY": "Turkish Lira",
"TWD": "Taiwanese Dollar",
"USD": "US Dollar",
"XAG": "Silver (troy ounce)",
"XAU": "Gold (troy ounce)",
"ZAR": "South African Rand"
},
"endpoint": "live_currencies"
}
Response Parameters:
| Field | Type | Description |
|---|---|---|
| currencies | JSON Object | Returns all currency pair codes and thier names in a (string) format that are available through the API |
Endpoints
The TraderMade exchange rates API has seven API endpoints serving different sets of data. Below is a summary of these endpoints.
Available Endpoints:
| API Endpoints |
|---|
| https://marketdata.tradermade.com/api/v1/live?&api_key=api_key¤cy=EURGBP,GBPJPY |
| https://marketdata.tradermade.com/api/v1/historical?date=2019-10-10&api_key=api_key |
| https://marketdata.tradermade.com/api/v1/minute_historical?currency=EURUSD&date_time=2019-10-09-13:24&api_key=api_key |
| https://marketdata.tradermade.com/api/v1/hour_historical?currency=EURUSD&date_time=2019-10-10-13:00&api_key=api_key |
| https://marketdata.tradermade.com/api/v1/convert?api_key=api_key&from=EUR&to=GBP&amount=1000 |
| https://marketdata.tradermade.com/api/v1/timeseries?start_date=2015-01-01&end_date=2015-05-01&api_key=api_key |
| https://marketdata.tradermade.com/api/v1/pandasDF?currency=EURUSD&start_date=2015-01-01&end_date=2015-05-01&api_key=api_key |
API Endpoints
Live Rates
Live rates endpoint provide live sub-second data for over 40 currencies
Request Parameters
| currency | EURUSD,GBPUSD |
| api_key | Your API key |
Request Example
https://marketdata.tradermade.com/api/v1/live?api_key=api_key¤cy=EURUSD,GBPUSD Sign Up
Response Example:
{
"endpoint": "live",
"quotes": [
{
"ask": 1.11121,
"base_currency": "EUR",
"bid": 1.1112,
"mid": 1.1112,
"quote_currency": "USD"
}
],
"requested_time": "Tue, 29 Oct 2019 22:47:57 GMT",
"timestamp": 1572389278
}
Historical Rates
The historical endpoint provides daily exchange rate data for the available currency pairs. Daily provides 10-years of data.
Request parameters
| currency | EURUSD,GBPUSD |
| date | 2019-10-09 |
| api_key | Your API key |
Request Example
https://marketdata.tradermade.com/api/v1/historical?api_key=api_key&date=2019-10-09¤cy=EURUSD,GBPUSD Sign Up
Response Example:
{
"date": "2019-10-09",
"endpoint": "historical",
"quotes": [
{
"base_currency": "EUR",
"close": 1.09702,
"high": 1.09905,
"low": 1.0952,
"open": 1.09571,
"quote_currency": "USD"
},
{
"base_currency": "GBP",
"close": 1.2206,
"high": 1.22925,
"low": 1.21977,
"open": 1.22188,
"quote_currency": "USD"
}
],
"request_time": "Thu, 31 Oct 2019 14:40:52 GMT"
}
Minute Historical Rates
The API provides minute historical rate for the past one-year for multiple currencies in single request.
Request parameters
| currency | EURUSD |
| date_time | 2019-10-10-13:24 |
| api_key | Your API key |
Request Example
https://marketdata.tradermade.com/api/v1/minute_historical?api_key=api_key&date=2019-10-09-13:24¤cy=EURUSD Sign Up
Response Example:
{
"endpoint": "hour_historical",
"currency": "EURUSD",
"date_time": "2019-10-10-13:24",
"high": 1.10225,
"low": 1.10203,
"open": 1.1021,
"close": 1.10215,
"request_time": "Thu, 31 Oct 2019 15:45:43 GMT"
}
Hour Historical Rates
The API provides historical rates (ohlc) for the given hour over the past two-years
Request parameters
| currency | EURUSD |
| date_time | 2019-10-10-13:00 |
| api_key | Your API key |
Request Example
https://marketdata.tradermade.com/api/v1/hour_historical?api_key=api_key&date=2019-10-09-13:00¤cy=EURUSD Sign Up
Response Example:
{
"endpoint": "minute_historical",
"currency": "EURUSD",
"date_time": "2019-10-10-13:00",
"high": 1.10282,
"low": 1.10158,
"open": 1.10234,
"close": 1.10193,
"request_time": "Thu, 31 Oct 2019 15:45:43 GMT"
}
Convert
The API provides daily exchange rate data for the past 10 years
Request parameters
| from | EUR |
| to | GBP |
| amount | 1000 |
| api_key | Your API key |
Request Example
https://marketdata.tradermade.com/api/v1/convert?api_key=api_key&from=EUR&to=GBP&amount=1000 Sign Up
Response Example
{
"base_currency": "EUR",
"quote": 0.861,
"quote_currency": "GBP",
"requested_time": "Thu, 31 Oct 2019 14:46:35 GMT",
"timestamp": 1572533196,
"total": 861
}
Timeseries
Time series api provides historical currency rates (OHLC) for daily, hourly and granular endpoints. Daily time-series data is available for up to 5-year. Hourly Data for up to 2-month and less than an hour for up to two days.
Request parameters
| currency | EURUSD |
| start_date | 2019-10-01 (YYYY-MM-DD) add (HH:MM for hourly or less interval) |
| end_date | 2019-10-10 (YYYY-MM-DD) (HH:MM for hourly or less interval) |
| interval | daily (other choices are - hourly or minute) |
| period | 1, (other choices are - 5, 10, 15, 30 ) only valid for minute interval |
| end_date | 2019-10-10 |
| format | records (other choices are - index , columns, split) |
Request Example
https://marketdata.tradermade.com/api/v1/timeseries?api_key=api_key¤cy=EURUSD&start_date=2019-10-01&end_date=2019-10-10&format=records Sign Up
Response Example
{
"base_currency": "EUR",
"end_date": "2019-10-10",
"endpoint": "timeseries",
"quote_currency": "USD",
"quotes": [
{
"close": 1.09331,
"date": "2019-10-01",
"high": 1.09437,
"low": 1.0879,
"open": 1.08991
},
{
"close": 1.09591,
"date": "2019-10-02",
"high": 1.09638,
"low": 1.09039,
"open": 1.09331
},
....
{
"close": 1.10055,
"date": "2019-10-10",
"high": 1.10341,
"low": 1.09702,
"open": 1.09711
}
],
"request_time": "Thu, 31 Oct 2019 15:34:09 GMT",
"start_date": "2019-10-01"
}
Pandas Data Frame
PandasDF api endpoint provides OHLC data for the currency requested in a pandas Data Frame that makes it really easy for python developers to use historical currency data.
Request Parameters
| currency | EURUSD |
| start_date | 2019-10-01 |
| end_date | 2019-10-10 |
| format | records (other choices are - index , columns, split) |
| fields | ohlc (other choice is - close) |
Request Example
https://marketdata.tradermade.com/api/v1/pandasDF?api_key=api_key¤cy=EURUSD&start_date=2019-10-01&end_date=2019-10-10&format=records&fields=ohlc Sign Up
Response Example
[
{
"close": 1.09331,
"date": "2019-10-01",
"high": 1.09437,
"low": 1.0879,
"open": 1.08991
},
{
"close": 1.09591,
"date": "2019-10-02",
"high": 1.09638,
"low": 1.09039,
"open": 1.09331
},
....
{
"close": 1.10055,
"date": "2019-10-10",
"high": 1.10341,
"low": 1.09702,
"open": 1.09711
}
]
PHP (CURL)
Below is an example for convert exchange rates data using PHP (CURL):
?php
$curl = curl_init();
curl_setopt_array( $curl, array(
CURLOPT_PORT => "443",
CURLOPT_URL => "https://marketdata.tradermade.com/api/v1/convert?from=EUR&to=USD&amount=1000&api_key=api_key",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
Python
Below is an example for live exchange rates data using Python:
import requests
url = "https://marketdata.tradermade.com/api/v1/live"
querystring = {"currency":"USDJPY","api_key":"api_key"}
response = requests.get(url, params=querystring)
print(response.json())
JavaScript (fetch)
Below is an example for historical exchange rates data using jQuery:
var requestOptions = { method : 'GET', redirect : 'follow' }; fetch( 'https://marketdata.tradermade.com/api/v1/historical?date=2019-10-09¤cy=EURUSD%2CGBPUSD&api_key=api_key', requestOptions) .then(response => response.text()) .then(result => console.log(result)) .catch(error => console.log( 'error', error));
JavaScript (jQuery)
Below is an example for historical exchange rates data using jQuery:
var settings = { "url": "/api/v1/historical?date=2019-10-09¤cy=EURUSD%2CGBPUSD&api_key=api_key", "method": "GET", "timeout": 0, }; $.ajax(settings).done(function (response) { console.log(response); });
TraderMade