Historical Up/Down/Returns

symbol_updown


Results
Get historical up/down/returns direction data for a global symbol for any given historical date range

Specification
Endpoint
symbol_updown?symbol={symbol}&start_date={start_date}&end_date={end_date}

Support
Current and Historical values

API Call Counts
20 per API call.

API Plan
silver



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



Output Descriptions
symbol

The common/local symbol/ticker of the symbol

Type: string


start_date

The start date

Type: date


end_date

The End Date

Type: date


day_name

The name of the date day

Type: string


date_from

The from date i.e. the first date when the symbol prices gain a momentum to go UP/DOWN or UNCHANGED

Type: date


days

The total number of days during an UP/DOWN or UNCHANGED event

Type: number


date_from_price

The price of the security on the "from date"

Type: number


last_price

The last price of the security during an UP/DOWN or UNCHANGED direction

Type: number


direction_return

The returns during an UP/DOWN or UNCHANGED event

Type: number



Sample Output
{
  "status": "ok",
  "info": {
    "symbol": {
      "symbol": "BTCUSD",
      "symbol_name": "Bitcoin/US Dollar",
      "exchange": "gemini",
      "symbol_pair": "BTC/USD"
    }
  },
  "total_records": 17,
  "page_size": 10,
  "current_page": 1,
  "total_pages": 2,
  "results": [
    {
      "day_name": "Sunday",
      "direction": "DOWN",
      "date_from": "2022-02-20",
      "days": 1,
      "date_from_price": 38383.27,
      "last_price": 37011.77,
      "direction_return": -3.57
    },
    {
      "day_name": "Monday",
      "direction": "UP",
      "date_from": "2022-02-21",
      "days": 1,
      "date_from_price": 37011.77,
      "last_price": 38261.62,
      "direction_return": 3.38
    },
    {
      "day_name": "Tuesday",
      "direction": "DOWN",
      "date_from": "2022-02-22",
      "days": 1,
      "date_from_price": 38261.62,
      "last_price": 37254.44,
      "direction_return": -2.63
    },
    {
      "day_name": "Wednesday",
      "direction": "UP",
      "date_from": "2022-02-23",
      "days": 2,
      "date_from_price": 37254.44,
      "last_price": 39227.98,
      "direction_return": 5.3
    },
    {
      "day_name": "Friday",
      "direction": "DOWN",
      "date_from": "2022-02-25",
      "days": 2,
      "date_from_price": 39227.98,
      "last_price": 37706.31,
      "direction_return": -3.88
    },
    {
      "day_name": "Sunday",
      "direction": "UP",
      "date_from": "2022-02-27",
      "days": 2,
      "date_from_price": 37706.31,
      "last_price": 44441.25,
      "direction_return": 17.86
    },
    {
      "day_name": "Tuesday",
      "direction": "DOWN",
      "date_from": "2022-03-01",
      "days": 3,
      "date_from_price": 44441.25,
      "last_price": 39168,
      "direction_return": -11.87
    },
    {
      "day_name": "Friday",
      "direction": "UP",
      "date_from": "2022-03-04",
      "days": 1,
      "date_from_price": 39168,
      "last_price": 39411.56,
      "direction_return": 0.62
    },
    {
      "day_name": "Saturday",
      "direction": "DOWN",
      "date_from": "2022-03-05",
      "days": 2,
      "date_from_price": 39411.56,
      "last_price": 38000,
      "direction_return": -3.58
    },
    {
      "day_name": "Monday",
      "direction": "UP",
      "date_from": "2022-03-07",
      "days": 1,
      "date_from_price": 38000,
      "last_price": 38771.15,
      "direction_return": 2.03
    }
  ]
}

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