Historical Averages

symbols_averages


Results
Historical averages for open/high/low/close/volume/change/returns

Specification
Endpoint
symbols_averages?symbols={symbols}&field={field}

Support
Current values

API Call Counts
50 per API call.

API Plan
silver



Input Parameters
symbols

input the symbols, seperated by commas (max 20)

Example : BTCUSD,ETHUSD


field

The code of the field. e.g. open = Open Price, high= High Price, low = Low Price, close = Close Prices, volume= Volume, chg = 1 Day Change ($), return = 1 Day Change (%)

Example : close



Output Descriptions
symbol

The common/local symbol/ticker of the symbol

Type: string


symbol_name

The name of the symbol

Type: string


exchange

the exchange code e.g. gemini

Type: string


symbol_pair

the exchange symbol pairs

Type: string



Sample Output
{
  "status": "ok",
  "total_records": 1,
  "page_size": 1,
  "current_page": 1,
  "total_pages": 1,
  "results": [
    {
      "symbol": "BTCUSD",
      "symbol_name": "Bitcoin/US Dollar",
      "exchange": "gemini",
      "symbol_pair": "BTC/USD",
      "close_avg_1w": 40577.21,
      "close_avg_10d": 40577.21,
      "close_avg_20d": 39892.7,
      "close_avg_21d": 40105.05,
      "close_avg_1m": 40813.82,
      "close_avg_50d": 40014.17,
      "close_avg_3m": 42875.96,
      "close_avg_100d": 43971.49,
      "close_avg_6m": 48981.02,
      "close_avg_200d": 48982.97,
      "close_avg_9m": 45870.02,
      "close_avg_ytd": 40897.14,
      "close_avg_1y": 47351.59,
      "close_avg_2y": 32210.92,
      "close_avg_3y": 24388.64,
      "close_avg_5y": 17007.13,
      "close_avg_10y": null,
      "close_avg_20y": null,
      "close_avg_alltime": 15560.92
    }
  ]
}

REST
GET https://www.cryptoquote.io/analytics/v1/?api=symbols_averages&symbols=BTCUSD.gdax,ETHUSD.kraken&field=close&key=your_api_key
Python
import requests 
r = requests.get("https://www.cryptoquote.io/analytics/v1/?api=symbols_averages&symbols=BTCUSD.gdax,ETHUSD.kraken&field=close&key=your_api_key")
data = r.json()
print(data)
Node.js
var http = require('http');
var buffer = '';
var options = {
	host: 'https://www.cryptoquote.io/analytics/v1/?api=symbols_averages&symbols=BTCUSD.gdax,ETHUSD.kraken&field=close&key=your_api_key',
	port: 80,
	path: 'https://www.cryptoquote.io/analytics/v1/?api=symbols_averages&symbols=BTCUSD.gdax,ETHUSD.kraken&field=close&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://www.cryptoquote.io/analytics/v1/?api=symbols_averages&symbols=BTCUSD.gdax,ETHUSD.kraken&field=close&key=your_api_key");
	if (response.IsSuccessStatusCode)
	{
		//Your custom response parser code
	}
}
Java
String uri = "https://www.cryptoquote.io/analytics/v1/?api=symbols_averages&symbols=BTCUSD.gdax,ETHUSD.kraken&field=close&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://www.cryptoquote.io/analytics/v1/?api=symbols_averages&symbols=BTCUSD.gdax,ETHUSD.kraken&field=close&key=your_api_key'))
obj <- fromJSON(json)
PHP
$url = 'https://www.cryptoquote.io/analytics/v1/?api=symbols_averages&symbols=BTCUSD.gdax,ETHUSD.kraken&field=close&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://www.cryptoquote.io/analytics/v1/?api=symbols_averages&symbols=BTCUSD.gdax,ETHUSD.kraken&field=close&key=your_api_key';
$.ajax({
		url: url,
		type: "GET",
		dataType: 'json'
}).done(function (data) {
	console.log(data);
});