Kline Data
Kline candlestick bars for a symbol.
  • Kline history information can be viewed with kline endpoint.
  • Can be used with symbol, resolution, from and to parameters
    • https://graph-api.btcturk.com/v1/klines/history?from=1602925320&resolution=60&symbol=BTCTRY&to=1603152000
  • You can get minute, hourly and daily data with resolution parameter
The from and to parameters must be used with Unix time in seconds.
t
Timestamp
h
High
o
Open
l
Low
c
Close
v
Volume
get
https://graph-api.btcturk.com
/v1/klines/history
Kline Data
PHP
Python
1
<?php
2
$base = "https://graph-api.btcturk.com";
3
$method = "/v1/klines/history?from=1602925320&resolution=60&symbol=BTCTRY&to=1603152000";
4
$uri = $base.$method;
5
6
$ch = curl_init();
7
curl_setopt($ch, CURLOPT_URL, $uri);
8
curl_setopt($ch, CURLOPT_HTTP_VERSION, "CURL_HTTP_VERSION_1_2");
9
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
10
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
11
$result = curl_exec($ch);
12
13
if (curl_errno($ch)) {
14
print_r(curl_error($ch));
15
}
16
$answer = json_decode($result);
17
print_r($answer);
Copied!
1
import time, base64, hmac, hashlib, requests, json
2
3
base = "https://graph-api.btcturk.com"
4
method = "/v1/klines/history?from=1602925320&resolution=60&symbol=BTCTRY&to=1603152000"
5
uri = base+method
6
7
result = requests.get(url=uri)
8
result = result.json()
9
print(json.dumps(result, indent=2))t
Copied!
Copy link