Daily Queries

bars/daily


Results

This API allows you to specify a minute interval and a date. The API will return a maxium of 5,000 records, or one month of data.

For example: 

  • If you pass 1 for the interval, you would receive 5,000 1-minute bars
  • If you were to pass 30 you would receive one month of 30-minute bars.

The format of the request URL is:

/{interval}/{symbol.exchange}/{start_date}

Endpoint:

https://api.cryptoquote.io/v1/bars/minutes/30/btcusd.gdax/2019-05-01T11:30:00Z?limit=5

Specification
Endpoint
bars/daily

Support
Current and Historical values

API Call Counts
100 per API call.

API Plan
gold


Quick Examples

Input Parameters
symbol

The common/local symbol/ticker of the symbol

Example : BTCUSD


format

Output format e.g. CSV or JSON output (default is JSON)

Example : JSON



Output Descriptions
symbol

The common/local symbol/ticker of the symbol

Type: string


date

returns date of the return query data

Type: date


price

Price of the symbol

Type: number



Sample Output
{
    "bars": {
        "symbol": "BTCUSD",
        "bars": [
            {
                "time": "2021-09-02T23:27:00+00:00",
                "open": "49399.97203330",
                "high": "49400.32221505",
                "low": "49242.26300002",
                "close": "49247.97885053",
                "vol": "28.86982208",
                "amount": "5548785.692168690732446649685697"
            },
            {
                "time": "2021-09-02T22:18:00+00:00",
                "open": "49691.84334608",
                "high": "49771.01177436",
                "low": "49382.00000001",
                "close": "49397.66859134",
                "vol": "27.98531712",
                "amount": "2358213.470638636025701955727452"
            }]
    }
}

REST
GET https://api.cryptoquote.io/v1/bars/daily&https://api.cryptoquote.io/v1/bars/daily/ethusd.hitbtc?start=2019-01-01&end=2022-05-12&format=csv&key=&key=your_api_key
Python
import requests 
r = requests.get("https://api.cryptoquote.io/v1/bars/daily&https://api.cryptoquote.io/v1/bars/daily/ethusd.hitbtc?start=2019-01-01&end=2022-05-12&format=csv&key=&key=your_api_key")
data = r.json()
print(data)
Node.js
var http = require('http');
var buffer = '';
var options = {
	host: 'https://api.cryptoquote.io/v1/bars/daily&https://api.cryptoquote.io/v1/bars/daily/ethusd.hitbtc?start=2019-01-01&end=2022-05-12&format=csv&key=&key=your_api_key',
	port: 80,
	path: 'https://api.cryptoquote.io/v1/bars/daily&https://api.cryptoquote.io/v1/bars/daily/ethusd.hitbtc?start=2019-01-01&end=2022-05-12&format=csv&key=&key=your_api_key',
	headers: headers
};
callback = function(response) {
	response.on('data', function (chunk) {
	buffer += chunk;
});
response.on('end', function () {
	// your code here if you want to use the results !
});
}

var req = http.get(options, callback).end();
C#
using (var client = new HttpClient())
{
	client.BaseAddress = new Uri("{$api_host}");
	client.DefaultRequestHeaders.Clear();
	//ADD Acept Header to tell the server what data type you want
	client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
	//SET Parameters
	HttpResponseMessage response = await client.GetAsync("https://api.cryptoquote.io/v1/bars/daily&https://api.cryptoquote.io/v1/bars/daily/ethusd.hitbtc?start=2019-01-01&end=2022-05-12&format=csv&key=&key=your_api_key");
	if (response.IsSuccessStatusCode)
	{
		//Your custom response parser code
	}
}
Java
String uri = "https://api.cryptoquote.io/v1/bars/daily&https://api.cryptoquote.io/v1/bars/daily/ethusd.hitbtc?start=2019-01-01&end=2022-05-12&format=csv&key=&key=your_api_key";
URL url = new URL(uri);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
	connection.setRequestMethod("GET");
	connection.setRequestProperty("Accept", "application/json");
InputStream xml = connection.getInputStream();
R
1 - Install package
install.packages("RCurl")
install.packages("jsonlite")
2 - Request the data:
library('RCurl')
require('jsonlite')
json <- getURL(URLencode('https://api.cryptoquote.io/v1/bars/daily&https://api.cryptoquote.io/v1/bars/daily/ethusd.hitbtc?start=2019-01-01&end=2022-05-12&format=csv&key=&key=your_api_key'))
obj <- fromJSON(json)
PHP
$url = 'https://api.cryptoquote.io/v1/bars/daily&https://api.cryptoquote.io/v1/bars/daily/ethusd.hitbtc?start=2019-01-01&end=2022-05-12&format=csv&key=&key=your_api_key';
$handle = curl_init(); 
	curl_setopt($handle, CURLOPT_URL, $url);
	curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);

	$data = curl_exec($handle);
curl_close($handle);
//parse your data as per your needs....
Javascript
var url = 'https://api.cryptoquote.io/v1/bars/daily&https://api.cryptoquote.io/v1/bars/daily/ethusd.hitbtc?start=2019-01-01&end=2022-05-12&format=csv&key=&key=your_api_key';
$.ajax({
		url: url,
		type: "GET",
		dataType: 'json'
}).done(function (data) {
	console.log(data);
});