TraderMade Docs
Getting Started
Welcome to TraderMade. We provide clean forex and CFD data via easy-to-use delivery methods. We use HTTPS and RESTful structures that make it easier to request data. Authentication is over a secure HTTPS protocol, and responses are in JSON Format.
Following are a few simple steps to start getting data:
- Sign up for API: Sign Up
- Get your API Key: API Key
- Start getting data: API Endpoints
Quick Start Guide
We have created a number of tutorials to help you get started with our REST API. Our tutorials cover topics such as Excel, Python, C#.
See our quick start tutorials: Visit Tutorials
Introducing our all new: API Playground
Authentication
You need to include your API Key with each request to get data. You can find your API Key in your Dashboard once you sign in. We will prepopulate your API Key for you to run sample API queries once you Sign In.
You can also learn more on how to use our forex data API on the Tutorials Page.
Supported Currencies
We support over 8000+ currency pairs on our API endpoints. It includes 4000+ cryptocurrency pairs. A list of Forex and Crypto codes for live endpoints can be accessed by visiting our live currencies list page. We also have CFDs. Visit the CFD list page for codes.
Available SDKs
Python SDK
pip install tradermade
Python users can install our SDK to start using our API in seconds. We recommend going through our python SDK documentation. Alternatively, you can read our tutorial on how to use our Python-SDK for Forex Data.
import tradermade as tm
# set api key
tm.set_rest_api_key("api_key")
# get data
tm.live(currency='EURUSD,GBPUSD', fields=["bid", "mid", "ask"]) # returns live data
tm.historical(currency='EURUSD,GBPUSD', date="2021-04-22", interval="daily", fields=["open", "high", "low", "close"]) # returns historical data
tm.timeseries(currency='EURUSD', start="2025-04-10 00:00", end="2025-04-11 04:23", interval="hourly", fields=["open", "high", "low", "close"]) # returns time series data
tm.cfd_list() # gets list of all CFDs available
tm.currency_list() # gets list of all currency codes available
Kotlin client JVM
package io.tradermade.test_client_jvm
Java and Android users can set up our SDK in seconds. We recommend going through our Kotlin JVM Client.
// set api key
val api = TraderMadeAPI("api_key")
// get data
val liveData = api.getLiveData("EURUSD,GBPUSD") // returns live data
val historicalData = api.getHistoricalData("EURUSD", "2023-08-01") // returns historical data
val timeSeriesData = api.getTimeSeriesData("EURUSD", "2023-08-01", "2023-08-10") // returns time series data
val convertedAmount = api.convertCurrency("EUR", "USD", 1000.0) // returns converted amount
Go SDK
package io.tradermade.test_client_jvm
You can learn about our Go SDK here. To use this SDK in your Go project, run:
This Go SDK provides easy access to TraderMade's forex data API. It allows you to fetch live rates, historical data, perform currency conversions, and retrieve time series data. We recommend going through our TraderMade Go Library Tutorial.
import (
tradermade "github.com/tradermade/Go-SDK/rest"
)
client := tradermade.NewRESTClient("api_key")
currencyPairs := []string{"EURUSD", "GBPUSD", "USDJPY"}
liveRates, err := client.GetLiveRates(currencyPairs)
if err != nil {
log.Fatalf("Error fetching live rates: %v", err)
}
for _, quote := range liveRates.Quotes {
fmt.Printf("Base: %s, Quote: %s, Bid: %f, Ask: %f, Mid: %f\n",
quote.BaseCurrency, quote.QuoteCurrency, quote.Bid, quote.Ask, quote.Mid)
}
Data Endpoints
Live Currencies List
You can request the live_currencies_list endpoint to access a list of the available currencies for the live and the convert endpoints. Add the currency codes to form a currency pair and request currency data. For example, EURUSD can be requested by adding EUR and USD together. Reverse the quote to USDEUR to get the inverse of the same pair. To access the JSON object containing all available currency codes used, append your api_key to the TraderMade exchange rates API api/currencies
endpoint.
Request URL
https://marketdata.tradermade.com/api/v1/live_currencies_list?api_key=api_key
Response JSON
{
"available_currencies": {
"AED":"UAE Dirham",
"ARS":"Argentine Peso",
"AUD":"Australian Dollar",
"BHD":"Bahraini Dinar",
"BRL":"Brazilian Real",
"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",
"NGN":"Nigerean Naira",
"NOK":"Norwegian Krone",
"NZD":"New Zealand Dollar",
"OMR":"Omani Rial",
"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",
"VND":"Vietnamese Dong",
"ZAR":"South African Rand"
},
"endpoint": "live_currencies"
}
Live Crypto List
We offer data for 4000+ cryptocurrency pairs. A list of Forex and Crypto codes for live endpoint can be accessed by visiting our live currencies list page. A list of the available cryptocurrencies for the live endpoint can be accessed through the live_crypto_list endpoint. Add the currency codes to form a currency pair. For example DOGEUSD can be requested by adding DOGE and USD together. To access the JSON object containing all available crypto codes used, append your api_key to the TraderMade live crypto API endpoint.
Request URL
https://marketdata.tradermade.com/api/v1/live_crypto_list?api_key=api_key
Response JSON
{
"available_currencies": {
"ADA": "Cardano",
"ATOM": "Atom",
"AVAX": "Avalanche",
"AXS": "Axis infinity",
"BCH": "Bitcoin Cash",
"BNB": "Binance Coin",
"BTC": "Bitcoin",
"BTG": "Bitcoin Gold",
"BUSD": "Binance USD",
"DAI": "DAI",
"DASH": "Dashcoin",
"DOGE": "DogeCoin",
"DOT": "Polkadot",
"EGLD": "Elrond Egold",
"ENJ": "ENJ",
"EOS": "EOS Platform",
"ETC": "Ethereum Classic",
"ETH": "Ethereum",
"FIL": "Filecoin",
"FLOW": "Flow",
"FTM": "Fantom USD",
"FTT": "FTX Token",
"GALA": "Gala",
"HBAR": "Hbar",
"HNT": "Helium",
"ICP": "Internet Computer Price ",
"LINK": "Chainlink",
"LRC": "Loopring",
"LTC": "Litecoin",
"LUNA": "Luna",
"MANA": "Decentraland",
"MATIC": "Matic",
"NEAR": "Near",
"NEO": "NEO",
"ROSE": "Rose",
"SAND": "Sandbox",
"SHIB": "Shiba inu",
"SOL": "Solana",
"THETA": "Theta",
"TRX": "Tron",
"UNI": "Uniswap",
"USDT": "Tether",
"UST": "Terra USD",
"VET": "Vechain",
"XLM": "Stellar",
"XMR": "Monero",
"XRP": "Ripple",
"XTZ": "Tezos"
},
"endpoint": "live_crypto"
}
Historical Currencies List
We support over 1500 currency pairs on our historical data endpoints. Request the historical_currencies_list endpoint or visit the historical currencies list page for a complete list of codes. Historical Tick data is available for 50+ currency pairs and can be accessed using the tick_historical endpoint.
Request URL
https://marketdata.tradermade.com/api/v1/historical_currencies_list?api_key=api_key
Response JSON
{
"available_currencies": {
"ADA": "Cardano",
"ATOM": "Atom",
"AVAX": "Avalanche",
"AXS": "Axis infinity",
"BCH": "Bitcoin Cash",
"BNB": "Binance Coin",
"BTC": "Bitcoin",
"BTG": "Bitcoin Gold",
"BUSD": "Binance USD",
"DAI": "DAI",
"DASH": "Dashcoin",
"DOGE": "DogeCoin",
"DOT": "Polkadot",
"EGLD": "Elrond Egold",
"ENJ": "ENJ",
"EOS": "EOS Platform",
"ETC": "Ethereum Classic",
"ETH": "Ethereum",
"FIL": "Filecoin",
"FLOW": "Flow",
"FTM": "Fantom USD",
"FTT": "FTX Token",
"GALA": "Gala",
"HBAR": "Hbar",
"HNT": "Helium",
"ICP": "Internet Computer Price ",
"LINK": "Chainlink",
"LRC": "Loopring",
"LTC": "Litecoin",
"LUNA": "Luna",
"MANA": "Decentraland",
"MATIC": "Matic",
"NEAR": "Near",
"NEO": "NEO",
"ROSE": "Rose",
"SAND": "Sandbox",
"SHIB": "Shiba inu",
"SOL": "Solana",
"THETA": "Theta",
"TRX": "Tron",
"UNI": "Uniswap",
"USDT": "Tether",
"UST": "Terra USD",
"VET": "Vechain",
"XLM": "Stellar",
"XMR": "Monero",
"XRP": "Ripple",
"XTZ": "Tezos"
},
"endpoint": "live_crypto"
}
Exchange Rates API
The TraderMade exchange rates API has nine endpoints serving different sets of data. Below is one example for each of the endpoints.
Request URL
// live endpoint
https://marketdata.tradermade.com/api/v1/live?currency=EURUSD,GBPUSD&api_key=api_key
// historical
https://marketdata.tradermade.com/api/v1/historical?currency=EURUSD&date=2019-10-09&api_key=api_key
// tick_historical
https://marketdata.tradermade.com/api/v1/tick_historical/GBPUSD/2025-04-10-08:30/2025-04-10-09:00?api_key=api_key
// tick_historical_sample
https://marketdata.tradermade.com/api/v1/tick_historical_sample?api_key=api_key
// minute_historical
https://marketdata.tradermade.com/api/v1/minute_historical?currency=EURUSD&date_time=2025-04-10-12:30&api_key=api_key
// hour_historical
https://marketdata.tradermade.com/api/v1/hour_historical?currency=EURUSD&date_time=2019-10-10-13:00&api_key=api_key
// convert
https://marketdata.tradermade.com/api/v1/convert?api_key=api_key&amount=1000&from=EUR&to=USD
// timeseries
https://marketdata.tradermade.com/api/v1/timeseries?start_date=2025-04-10&end_date=2025-04-11¤cy=EURUSD&api_key=api_key
// pandasDF
https://marketdata.tradermade.com/api/v1/pandasDF?currency=EURUSD&api_key=api_key
Live Rates
The live rates endpoint provides live sub-second data for over 4200+ currency pairs and 200+ CFDs. For the endpoint, visit the live currencies list page or request the live_currencies_list endpoint.
Request URL
https://marketdata.tradermade.com/api/v1/live?currency=EURUSD,GBPUSD&api_key=api_key
Response JSON
{
"endpoint": "live",
"quotes": [
{
"ask": 1.18183,
"base_currency": "EUR",
"bid": 1.18181,
"mid": 1.18182,
"quote_currency": "USD"
},
{
"ask": 1.31705,
"base_currency": "GBP",
"bid": 1.31704,
"mid": 1.31705,
"quote_currency": "USD"
},
{
"ask": 6310.5,
"bid": 6309.8,
"instrument": "UK100",
"mid": 6310.1499
}
],
"requested_time": "Fri, 13 Nov 2020 11:42:51 GMT",
"timestamp": 1605267771
}
Historical Rates
The historical endpoint provides daily exchange rate data for the available currency pairs. Daily bars are 22:22 as in the norm in financial markets.
Request URL
https://marketdata.tradermade.com/api/v1/historical?currency=EURUSD&date=2019-10-09&api_key=api_key
Response JSON
{
"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"
}
Tick Historical Rates
The tick_historical endpoint provides tick FX rate data for 50+ currency pairs.
Request URL
https://marketdata.tradermade.com/api/v1/tick_historical/GBPUSD/2025-04-10-08:30/2025-04-10-09:00?api_key=api_key
Response JSON
{
"end_date": "2020-10-13 09:00",
"endpoint": "tick_historical",
"instrument": "GBPUSD",
"quotes": [
{
"ask": 1.30363,
"bid": 1.30359,
"inst": "GBPUSD",
"time": 1602577800339
},
{
"ask": 1.30363,
"bid": 1.30361,
"inst": "GBPUSD",
"time": 1602577800539
},
{
"ask": 1.3036,
"bid": 1.30357,
"inst": "GBPUSD",
"time": 1602577800941
},
{
"ask": 1.30363,
"bid": 1.3036,
"inst": "GBPUSD",
"time": 1602577801739
}
...
],
"start_date": "2020-10-13 08:30"
}
Minute Historical Rates
The API lets you query historical data for any minute for the past 30 years.
Request URL
https://marketdata.tradermade.com/api/v1/minute_historical?currency=EURUSD&date_time=2025-04-10-12:30&api_key=api_key
Response JSON
{
"endpoint": "minute_historical",
"currency": "EURUSD",
"date_time": "2019-10-09-13:24",
"close": 1.09802,
"high": 1.09816,
"low": 1.09798,
"open": 1.09807,
"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 URL
https://marketdata.tradermade.com/api/v1/hour_historical?currency=EURUSD&date_time=2019-10-10-13:00&api_key=api_key
Response JSON
{
"currency": "EURUSD",
"date_time": "2019-10-10-13:00",
"endpoint": "hour_historical",
"close": 1.10193,
"high": 1.10282,
"low": 1.10158,
"open": 1.10234,
"request_time": "Thu, 31 Oct 2019 15:45:43 GMT"
}
Timeseries
Time series API provides historical currency rates (OHLC) for daily, hourly and granular endpoints. Daily timeseries data is available for up to 15 years (for some exotic currency pairs, history may be less). But the max request is one-year per request. You can get hourly data for up to 12 months (max one-month data per request) and minute interval data for up to one month (max 2-days data per call). For example, if you request 15-minute data on Friday, you can only request a start date from Thursday 00:00 GMT (in one call). You can seek one currency pair per call.
History - daily - fifteen years | hourly - 12 months | minute - 1 Month
You can also use our timeseries endpoint to plot data in highcharts - replace apikey with your API key. You can read the chart tutorial here
Parameters
Params | Description |
---|---|
currency | EURUSD |
start_date | daily - 2019-10-01 (YYYY-MM-DD) | hourly / minute - (YYYY-MM-DD-HH:MM) |
end_date | daily - 2019-10-10 (YYYY-MM-DD) | hourly / minute - (YYYY-MM-DD-HH:MM) |
interval | daily (other choices are - hourly or minute) |
period | Daily Interval equals 1 | Hourly interval, choices are - 1, 2, 4, 6, 8, 24 | Minute interval, choices are - 1, 5, 10, 15, 30 |
format | records (other choices are - csv, index, columns, split) |
api_key | Your API key |
Request URL: Daily
https://marketdata.tradermade.com/api/v1/timeseries?currency=EURUSD&api_key=api_key&start_date=2019-10-01&end_date=2019-10-10&format=records
Request URL: Hourly
https://marketdata.tradermade.com/api/v1/timeseries?currency=EURUSD&api_key=api_key&start_date=2025-06-10-00:00&end_date=2025-06-11-10:29&format=records&interval=hourly
Request URL: Minute
https://marketdata.tradermade.com/api/v1/timeseries?currency=EURUSD&api_key=api_key&start_date=2025-06-10-00:00&end_date=2025-06-11-10:29&format=records&interval=minute&period=15
Response JSON
{
"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 daily OHLC data for the currency requested in a pandas Data Frame that makes it easy for python developers to use historical currency data. Request single currency when field parameter is "OHLC". You can request multiple currency when the field is "close". Data is available for upto 15 years (for some exotic currency pairs history may be less) but the max request is one-year per request.
Parameters
Params | Description |
---|---|
currency | EURUSD |
start_date | 2019-10-01 |
end_date | 2019-10-10 |
format | records (other choices are - index, columns, split) |
fields | ohlc (another choice is - close) |
api_key | Your API key |
Request URL
https://marketdata.tradermade.com/api/v1/pandasDF?currency=EURUSD&api_key=api_key&start_date=2019-10-01&end_date=2019-10-10&format=records&fields=ohlc
Response JSON
[
{
"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
}
]
Convert
The API provides conversion from one currency to another in real time.
Parameters
Params | Description |
---|---|
from | EUR |
to | GBP |
amount | 1000 |
api_key | Your API key |
Request URL
https://marketdata.tradermade.com/api/v1/convert?api_key=api_key&from=EUR&to=GBP&amount=1000
Response JSON
{
"base_currency": "EUR",
"quote": 0.861,
"quote_currency": "GBP",
"requested_time": "Thu, 31 Oct 2019 14:46:35 GMT",
"timestamp": 1572533196,
"total": 861
}
Error Codes
Below are the error codes and responses for all the API endpoints.
Codes | HTTP Status | Message |
---|---|---|
401 | 200 - OK | API Key is invalid | Your plan doesn't allow access to this dataset |
204 | 200 - OK | Data for the date requested not available | Currency pair currently not available |
400 | 400 - BAD REQUEST | Input payload validation failed (often due to a missing parameter or wrong input). Reasons may be an incorrect currency code, date format, or end date before the start date. |
403 | 403 - Forbidden | No data for weekend | Data outside max historical data we provide |
Example Error Response
// 400 will return error which includes the details of the error
{
"errors": {
"date": "YYYY-MM-DD time data '2019-10-' does not match format '%Y-%m-%d'"
},
"message": "Input payload validation failed"
}
Examples
Below is an example showing the convert exchange rates data.
Select Language
$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;
}