Minutes Queries

bars/minutes


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}/{limit_number of bars}

Endpoint(s):

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

Minute Bar Date Range

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

https://api.cryptoquote.io/v1/bars/minutes/15/XRPUSDT.bitstamp?key=<API Key>&format=csv&start=2021-08-15&end=2021-08-23

Current Bar Data  

/{interval}/{symbol.exchange}/{limit_number of bars}

https://api.cryptoquote.io/v1/bars/minutes/1/btcusd.bittrex.internal/now?key=<Api Key>&format=csv&limit=100&update=1

 

 

Specification
Endpoint
bars/minutes

Support
Current and Historical values

API Call Counts
100 per API call.

API Plan
gold


Quick Examples

Get 60 Minute Bars from 2021-09-0 to1 2021-09-03 on BTCUSDT on Poloniex exchange

https://api.cryptoquote.io/v1/bars/minutes/60/btcusdt.poloniex?start=2021-09-01&end=2021-09-03&format=csv&key=

Get the current last real-time bar and return the last 250 1-minute bars from BTCUSD traded on Bitstamp.

https://api.cryptoquote.io/v1/bars/minutes/1/btcusd.bitstamp.internal/now?key=&format=csv&limit=250&update=1

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
{
    "requestSymbol": "BTCUSD",
    "vendorSymbol": "BTCUSD.gdax",
    "bars": {
        "interval": 1800,
        "symbol": "BTCUSD",
        "bars": [
            {
                "time": "2019-05-01T00:00:00+00:00",
                "open": "5270.68000000",
                "high": "5329.80000000",
                "low": "5265.61000000",
                "close": "5301.05000000",
                "volume": "480.62222241",
                "amount": "140214539.028889158007669507000000"
            },
            {
                "time": "2019-05-01T00:30:00+00:00",
                "open": "5301.04000000",
                "high": "5312.05000000",
                "low": "5295.54000000",
                "close": "5299.95000000",
                "volume": "173.19948006",
                "amount": "9014412.365487098962766717000000"
            },
            {
                "time": "2019-05-01T01:00:00+00:00",
                "open": "5301.32000000",
                "high": "5312.83000000",
                "low": "5296.70000000",
                "close": "5301.05000000",
                "volume": "162.26889009",
                "amount": "8397267.670704633696638049000000"
            }]
  }
}

Examples

Get 60 Minute Bars from 2021-09-0 to1 2021-09-03 on BTCUSDT on Poloniex exchange

https://api.cryptoquote.io/v1/bars/minutes/60/btcusdt.poloniex?start=2021-09-01&end=2021-09-03&format=csv&key=

Get the current last real-time bar and return the last 250 1-minute bars from BTCUSD traded on Bitstamp.

https://api.cryptoquote.io/v1/bars/minutes/1/btcusd.bitstamp.internal/now?key=&format=csv&limit=250&update=1
REST
GET https://api.cryptoquote.io/v1/bars/minutes&https://api.cryptoquote.io/v1/bars/minutes/1/btcusd.bitstamp.internal/now?key=&format=csv&limit=250&update=1&key=your_api_key
Python
import requests 
r = requests.get("https://api.cryptoquote.io/v1/bars/minutes&https://api.cryptoquote.io/v1/bars/minutes/1/btcusd.bitstamp.internal/now?key=&format=csv&limit=250&update=1&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/minutes&https://api.cryptoquote.io/v1/bars/minutes/1/btcusd.bitstamp.internal/now?key=&format=csv&limit=250&update=1&key=your_api_key',
	port: 80,
	path: 'https://api.cryptoquote.io/v1/bars/minutes&https://api.cryptoquote.io/v1/bars/minutes/1/btcusd.bitstamp.internal/now?key=&format=csv&limit=250&update=1&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/minutes&https://api.cryptoquote.io/v1/bars/minutes/1/btcusd.bitstamp.internal/now?key=&format=csv&limit=250&update=1&key=your_api_key");
	if (response.IsSuccessStatusCode)
	{
		//Your custom response parser code
	}
}
Java
String uri = "https://api.cryptoquote.io/v1/bars/minutes&https://api.cryptoquote.io/v1/bars/minutes/1/btcusd.bitstamp.internal/now?key=&format=csv&limit=250&update=1&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/minutes&https://api.cryptoquote.io/v1/bars/minutes/1/btcusd.bitstamp.internal/now?key=&format=csv&limit=250&update=1&key=your_api_key'))
obj <- fromJSON(json)
PHP
$url = 'https://api.cryptoquote.io/v1/bars/minutes&https://api.cryptoquote.io/v1/bars/minutes/1/btcusd.bitstamp.internal/now?key=&format=csv&limit=250&update=1&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/minutes&https://api.cryptoquote.io/v1/bars/minutes/1/btcusd.bitstamp.internal/now?key=&format=csv&limit=250&update=1&key=your_api_key';
$.ajax({
		url: url,
		type: "GET",
		dataType: 'json'
}).done(function (data) {
	console.log(data);
});