Crypto Historical Data API
getCryptoHistory
The getCryptoHistory API provides historical price data for spot cryptocurrencies, including Bitcoin, Ethereum, Ripple, Litecoin and more. Bitcoin futures historical data is available through the getHistory API.
View All APIssymbolrequired
A valid cryptocurrency symbol.
^BTCUSD
typerequired
The type of historical data to return, including tick data, minute data, and end-of-day data.
minutes
startDateoptional
The start date of the historical data query. This parameter should be set to the desired start date/time for the query (the result set will include records back to, and including, this value). If not set, the value will default to the beginning of the day specified in the end parameter, if end is specified, or to the beginning of the current day, if end is not specified. The value should conform to the format yyyymmdd[hhmm[ss]], where fields in brackets are optional (Do not include the brackets themselves). Any optional fields that are not explicitly set will default to 0 (i.e. 20090203 will default to 20090203000000 or February 3, 2009 at 00:00:00).
20241220
endDateoptional
The end data of the historical data query. This parameter should be set to the desired end date/time for the query (the result set will include records up to, but not including, this value). If not set, the value will default to the end of the day specified in the start parameter, if specified, or to the end of the current day, if start is not specified. The value should conform to the format yyyymmdd[hhmm[ss]], where fields in brackets are optional (Do not include the brackets themselves). Any optional fields that are not explicitly set will default to 0 (i.e. 20090203 will default to 20090203000000 or February 3, 2009 at 00:00:00).
20241221
maxRecordsoptional
The maximum amount of records returned. This parameter should be set to the maximum number of records desired. If not specified, there number of records returned will be determined by the date/time parameters specified as well as any defaults that apply to the query.
10
intervaloptional
The number of minutes for a minute query.
60
orderoptional
An arrangement of fields within a particular record (ascending or descending). This parameter can be set to one of two values ("asc" and "desc") in order to specify the chronological order of the result set returned. If this parameter is not specified, the order results is not guaranteed.
asc
always returned
A sequence of characters. (example: GOOG)
always returned
A date and time in the format of YYYY-MM-DD HH:MI:SS<TIMEZONE_OFFSET>.
always returned
A date in the format of YYYY-MM-DD.
as requested
A sequence of characters. (example: GOOG)
as requested
A numeric type defining a number with fractional parts. (example: 2.14)
as requested
A numeric type defining a whole number. (example: 2)
as requested
A numeric type defining a number with fractional parts. (example: 2.14)
as requested
A numeric type defining a number with fractional parts. (example: 2.14)
as requested
A numeric type defining a number with fractional parts. (example: 2.14)
as requested
A numeric type defining a number with fractional parts. (example: 2.14)
as requested
A numeric type defining a whole number. (example: 2)
GET
GET https://ondemand.websol.barchart.com/getCryptoHistory.json?apikey=YOUR_API_KEY&symbol=%5EBTCUSD&type=minutes&startDate=20241220&endDate=20241221&maxRecords=10&interval=60&order=asc
Host: ondemand.websol.barchart.com
POST
POST https://ondemand.websol.barchart.com/getCryptoHistory.json
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
apikey=YOUR_API_KEY&symbol=%5EBTCUSD&type=minutes&startDate=20241220&endDate=20241221&maxRecords=10&interval=60&order=asc
Response
{
"status": {
"code": 200,
"message": "Success."
},
"results": [
{
"symbol": "^BTCUSD",
"timestamp": "2024-12-20T14:00:00-06:00",
"tradingDay": "2024-12-20",
"open": 97145.95,
"high": 97251.28,
"low": 96508.46,
"close": 96639.17,
"volume": 1581
},
{
"symbol": "^BTCUSD",
"timestamp": "2024-12-20T15:00:00-06:00",
"tradingDay": "2024-12-20",
"open": 96508.46,
"high": 96702.17,
"low": 95567.53,
"close": 96621.53,
"volume": 1670
},
{
"symbol": "^BTCUSD",
"timestamp": "2024-12-20T16:00:00-06:00",
"tradingDay": "2024-12-20",
"open": 96560.98,
"high": 97516.84,
"low": 96483.69,
"close": 97487.63,
"volume": 1633
},
{
"symbol": "^BTCUSD",
"timestamp": "2024-12-20T17:00:00-06:00",
"tradingDay": "2024-12-23",
"open": 97446.34,
"high": 97854.78,
"low": 97426.1,
"close": 97854.78,
"volume": 1619
},
{
"symbol": "^BTCUSD",
"timestamp": "2024-12-20T18:00:00-06:00",
"tradingDay": "2024-12-23",
"open": 97766.21,
"high": 97858.57,
"low": 97237.43,
"close": 97605.41,
"volume": 1721
},
{
"symbol": "^BTCUSD",
"timestamp": "2024-12-20T19:00:00-06:00",
"tradingDay": "2024-12-23",
"open": 97565.78,
"high": 97686.85,
"low": 97275.31,
"close": 97457.23,
"volume": 1710
},
{
"symbol": "^BTCUSD",
"timestamp": "2024-12-20T20:00:00-06:00",
"tradingDay": "2024-12-23",
"open": 97397.01,
"high": 97626.57,
"low": 97227.38,
"close": 97477.16,
"volume": 1702
},
{
"symbol": "^BTCUSD",
"timestamp": "2024-12-20T21:00:00-06:00",
"tradingDay": "2024-12-23",
"open": 97477.16,
"high": 97483.23,
"low": 97278.93,
"close": 97470.26,
"volume": 1644
},
{
"symbol": "^BTCUSD",
"timestamp": "2024-12-20T22:00:00-06:00",
"tradingDay": "2024-12-23",
"open": 97392.04,
"high": 97644.26,
"low": 97392.04,
"close": 97635.88,
"volume": 1544
},
{
"symbol": "^BTCUSD",
"timestamp": "2024-12-20T23:00:00-06:00",
"tradingDay": "2024-12-23",
"open": 97574.46,
"high": 98627.16,
"low": 97555.48,
"close": 98623.77,
"volume": 1550
}
]
}
GET
GET https://ondemand.websol.barchart.com/getCryptoHistory.xml?apikey=YOUR_API_KEY&symbol=%5EBTCUSD&type=minutes&startDate=20241220&endDate=20241221&maxRecords=10&interval=60&order=asc
Host: ondemand.websol.barchart.com
POST
POST https://ondemand.websol.barchart.com/getCryptoHistory.xml
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
apikey=YOUR_API_KEY&symbol=%5EBTCUSD&type=minutes&startDate=20241220&endDate=20241221&maxRecords=10&interval=60&order=asc
Response
<?xml version="1.0" encoding="utf-8"?>
<getCryptoHistory>
<status>
<code>200</code>
<message>Success.</message>
</status>
<item>
<symbol>^BTCUSD</symbol>
<timestamp>2024-12-20T14:00:00-06:00</timestamp>
<tradingDay>2024-12-20</tradingDay>
<open>97145.95</open>
<high>97251.28</high>
<low>96508.46</low>
<close>96639.17</close>
<volume>1581</volume>
</item>
<item>
<symbol>^BTCUSD</symbol>
<timestamp>2024-12-20T15:00:00-06:00</timestamp>
<tradingDay>2024-12-20</tradingDay>
<open>96508.46</open>
<high>96702.17</high>
<low>95567.53</low>
<close>96621.53</close>
<volume>1670</volume>
</item>
<item>
<symbol>^BTCUSD</symbol>
<timestamp>2024-12-20T16:00:00-06:00</timestamp>
<tradingDay>2024-12-20</tradingDay>
<open>96560.98</open>
<high>97516.84</high>
<low>96483.69</low>
<close>97487.63</close>
<volume>1633</volume>
</item>
<item>
<symbol>^BTCUSD</symbol>
<timestamp>2024-12-20T17:00:00-06:00</timestamp>
<tradingDay>2024-12-23</tradingDay>
<open>97446.34</open>
<high>97854.78</high>
<low>97426.1</low>
<close>97854.78</close>
<volume>1619</volume>
</item>
<item>
<symbol>^BTCUSD</symbol>
<timestamp>2024-12-20T18:00:00-06:00</timestamp>
<tradingDay>2024-12-23</tradingDay>
<open>97766.21</open>
<high>97858.57</high>
<low>97237.43</low>
<close>97605.41</close>
<volume>1721</volume>
</item>
<item>
<symbol>^BTCUSD</symbol>
<timestamp>2024-12-20T19:00:00-06:00</timestamp>
<tradingDay>2024-12-23</tradingDay>
<open>97565.78</open>
<high>97686.85</high>
<low>97275.31</low>
<close>97457.23</close>
<volume>1710</volume>
</item>
<item>
<symbol>^BTCUSD</symbol>
<timestamp>2024-12-20T20:00:00-06:00</timestamp>
<tradingDay>2024-12-23</tradingDay>
<open>97397.01</open>
<high>97626.57</high>
<low>97227.38</low>
<close>97477.16</close>
<volume>1702</volume>
</item>
<item>
<symbol>^BTCUSD</symbol>
<timestamp>2024-12-20T21:00:00-06:00</timestamp>
<tradingDay>2024-12-23</tradingDay>
<open>97477.16</open>
<high>97483.23</high>
<low>97278.93</low>
<close>97470.26</close>
<volume>1644</volume>
</item>
<item>
<symbol>^BTCUSD</symbol>
<timestamp>2024-12-20T22:00:00-06:00</timestamp>
<tradingDay>2024-12-23</tradingDay>
<open>97392.04</open>
<high>97644.26</high>
<low>97392.04</low>
<close>97635.88</close>
<volume>1544</volume>
</item>
<item>
<symbol>^BTCUSD</symbol>
<timestamp>2024-12-20T23:00:00-06:00</timestamp>
<tradingDay>2024-12-23</tradingDay>
<open>97574.46</open>
<high>98627.16</high>
<low>97555.48</low>
<close>98623.77</close>
<volume>1550</volume>
</item>
</getCryptoHistory>
GET
GET https://ondemand.websol.barchart.com/getCryptoHistory.csv?apikey=YOUR_API_KEY&symbol=%5EBTCUSD&type=minutes&startDate=20241220&endDate=20241221&maxRecords=10&interval=60&order=asc
Host: ondemand.websol.barchart.com
POST
POST https://ondemand.websol.barchart.com/getCryptoHistory.csv
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
apikey=YOUR_API_KEY&symbol=%5EBTCUSD&type=minutes&startDate=20241220&endDate=20241221&maxRecords=10&interval=60&order=asc
Response
symbol,timestamp,tradingDay,open,high,low,close,volume
"^BTCUSD","2024-12-20T14:00:00-06:00","2024-12-20","97145.95","97251.28","96508.46","96639.17","1581"
"^BTCUSD","2024-12-20T15:00:00-06:00","2024-12-20","96508.46","96702.17","95567.53","96621.53","1670"
"^BTCUSD","2024-12-20T16:00:00-06:00","2024-12-20","96560.98","97516.84","96483.69","97487.63","1633"
"^BTCUSD","2024-12-20T17:00:00-06:00","2024-12-23","97446.34","97854.78","97426.1","97854.78","1619"
"^BTCUSD","2024-12-20T18:00:00-06:00","2024-12-23","97766.21","97858.57","97237.43","97605.41","1721"
"^BTCUSD","2024-12-20T19:00:00-06:00","2024-12-23","97565.78","97686.85","97275.31","97457.23","1710"
"^BTCUSD","2024-12-20T20:00:00-06:00","2024-12-23","97397.01","97626.57","97227.38","97477.16","1702"
"^BTCUSD","2024-12-20T21:00:00-06:00","2024-12-23","97477.16","97483.23","97278.93","97470.26","1644"
"^BTCUSD","2024-12-20T22:00:00-06:00","2024-12-23","97392.04","97644.26","97392.04","97635.88","1544"
"^BTCUSD","2024-12-20T23:00:00-06:00","2024-12-23","97574.46","98627.16","97555.48","98623.77","1550"
<?php
$ondemand = new SoapClient('https://ondemand.websol.barchart.com/service?wsdl');
$params = [
'apikey' => 'YOUR_API_KEY',
'symbol' => '^BTCUSD',
'type' => 'minutes',
'startDate' => '20241220',
'endDate' => '20241221',
'maxRecords' => '10',
'interval' => '60',
'order' => 'asc',
];
$result = $ondemand->getCryptoHistory($params);
var_dump($result);
Dim ondemand
Dim result
Set ondemand = Server.CreateObject("MSSOAP.SoapClient30")
ondemand.ClientProperty("ServerHTTPRequest") = True
ondemand.MSSoapInit("https://ondemand.websol.barchart.com/service?wsdl")
Set result = ondemand.getCryptoHistory("YOUR_API_KEY", "^BTCUSD", "minutes", "20241220", "20241221", "10", "60", "asc")
use SOAP::Lite;
use SOAP::WSDL;
my $ondemand = SOAP::Lite
-> service('https://ondemand.websol.barchart.com/service?wsdl');
my $result = $ondemand->getCryptoHistory('YOUR_API_KEY', '^BTCUSD', 'minutes', '20241220', '20241221', '10', '60', 'asc');
print $result;
from suds.client import Client
ondemand = Client('https://ondemand.websol.barchart.com/service?wsdl')
result = ondemand.service.getCryptoHistory('YOUR_API_KEY', '^BTCUSD', 'minutes', '20241220', '20241221', '10', '60', 'asc')
print(result)
require 'savon'
ondemand = Savon.client(wsdl: 'https://ondemand.websol.barchart.com/service?wsdl')
response = ondemand.call(
:getCryptoHistory,
message: {
apikey: 'YOUR_API_KEY',
symbol: '^BTCUSD',
type: 'minutes',
startDate: '20241220',
endDate: '20241221',
maxRecords: '10',
interval: '60',
order: 'asc',
}
)
response.body