Historical Volatility

symbol_volatility


Results
Get historical volatility of any global symbol by providing the date range, volatility and days factors

Specification
Endpoint
symbol_volatility?symbol={symbol}&start_date={start_date}&end_date={end_date}&volatility={volatility}&daysfactor={daysfactor}

Support
Current and Historical values

API Call Counts
20 per API call.

API Plan
gold


Quick Examples

Get BTCUSD.gdax historical volatility time series data between 2019-11-01 and 2019-12-20 with 10 days volatility and days factor set to 260 days.

https://www.cryptoquote.io/analytics/v1/?api=symbol_volatility&symbol=BTCUSD.gdax&start_date=2020-11-01&end_date=2021-12-20&volatility=10&daysfactor=260&key=your_api_key

Input Parameters
symbol

The common/local symbol/ticker of the symbol

Example : BTCUSD


start_date

Start Date

Example : 2019-01-01


end_date

End Date

Example : 2019-01-01


volatility

Volatility days to calculate e.g '10' is used for a 10 day volatility

Example : 10


daysfactor

Days Factor e.g 260 or 265

Example : 260



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


date

returns date of the return query data

Type: date


volatility

Calculated volatility number

Type: number



Sample Output
{
  "status": "ok",
  "info": {
    "symbol": {
      "symbol": "BTCUSD",
      "symbol_name": "Bitcoin/US Dollar",
      "exchange": "gemini",
      "symbol_pair": "BTC/USD"
    }
  },
  "total_records": 36,
  "page_size": 10,
  "current_page": 1,
  "total_pages": 4,
  "results": [
    {
      "date": "2022-02-11",
      "volatility": 65.23
    },
    {
      "date": "2022-02-12",
      "volatility": 58.23
    },
    {
      "date": "2022-02-13",
      "volatility": 58.84
    },
    {
      "date": "2022-02-14",
      "volatility": 27.95
    },
    {
      "date": "2022-02-15",
      "volatility": 34.74
    },
    {
      "date": "2022-02-16",
      "volatility": 35.09
    },
    {
      "date": "2022-02-17",
      "volatility": 49.35
    },
    {
      "date": "2022-02-18",
      "volatility": 48.94
    },
    {
      "date": "2022-02-19",
      "volatility": 48.56
    },
    {
      "date": "2022-02-20",
      "volatility": 51.13
    },
    {
      "date": "2022-02-21",
      "volatility": 52.06
    },
    {
      "date": "2022-02-22",
      "volatility": 56.74
    },
    {
      "date": "2022-02-23",
      "volatility": 57.18
    },
    {
      "date": "2022-02-24",
      "volatility": 59.66
    },
    {
      "date": "2022-02-25",
      "volatility": 54.73
    },
    {
      "date": "2022-02-26",
      "volatility": 54.92
    },
    {
      "date": "2022-02-27",
      "volatility": 44.11
    },
    {
      "date": "2022-02-28",
      "volatility": 82.63
    },
    {
      "date": "2022-03-01",
      "volatility": 83.04
    },
    {
      "date": "2022-03-02",
      "volatility": 78.9
    },
    {
      "date": "2022-03-03",
      "volatility": 78.54
    },
    {
      "date": "2022-03-04",
      "volatility": 89.73
    },
    {
      "date": "2022-03-05",
      "volatility": 88.37
    },
    {
      "date": "2022-03-06",
      "volatility": 88.54
    },
    {
      "date": "2022-03-07",
      "volatility": 87.82
    },
    {
      "date": "2022-03-08",
      "volatility": 88.54
    }
  ]
}

Examples

Get BTCUSD.gdax historical volatility time series data between 2019-11-01 and 2019-12-20 with 10 days volatility and days factor set to 260 days.

https://www.cryptoquote.io/analytics/v1/?api=symbol_volatility&symbol=BTCUSD.gdax&start_date=2020-11-01&end_date=2021-12-20&volatility=10&daysfactor=260&key=your_api_key
REST
GET https://www.cryptoquote.io/analytics/v1/?api=symbol_volatility&symbol=BTCUSD.gdax&start_date=2020-11-01&end_date=2021-12-20&volatility=10&daysfactor=260&key=your_api_key
Python
import requests 
r = requests.get("https://www.cryptoquote.io/analytics/v1/?api=symbol_volatility&symbol=BTCUSD.gdax&start_date=2020-11-01&end_date=2021-12-20&volatility=10&daysfactor=260&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=symbol_volatility&symbol=BTCUSD.gdax&start_date=2020-11-01&end_date=2021-12-20&volatility=10&daysfactor=260&key=your_api_key',
	port: 80,
	path: 'https://www.cryptoquote.io/analytics/v1/?api=symbol_volatility&symbol=BTCUSD.gdax&start_date=2020-11-01&end_date=2021-12-20&volatility=10&daysfactor=260&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=symbol_volatility&symbol=BTCUSD.gdax&start_date=2020-11-01&end_date=2021-12-20&volatility=10&daysfactor=260&key=your_api_key");
	if (response.IsSuccessStatusCode)
	{
		//Your custom response parser code
	}
}
Java
String uri = "https://www.cryptoquote.io/analytics/v1/?api=symbol_volatility&symbol=BTCUSD.gdax&start_date=2020-11-01&end_date=2021-12-20&volatility=10&daysfactor=260&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=symbol_volatility&symbol=BTCUSD.gdax&start_date=2020-11-01&end_date=2021-12-20&volatility=10&daysfactor=260&key=your_api_key'))
obj <- fromJSON(json)
PHP
$url = 'https://www.cryptoquote.io/analytics/v1/?api=symbol_volatility&symbol=BTCUSD.gdax&start_date=2020-11-01&end_date=2021-12-20&volatility=10&daysfactor=260&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=symbol_volatility&symbol=BTCUSD.gdax&start_date=2020-11-01&end_date=2021-12-20&volatility=10&daysfactor=260&key=your_api_key';
$.ajax({
		url: url,
		type: "GET",
		dataType: 'json'
}).done(function (data) {
	console.log(data);
});