Get 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
GoLang
Node.js
<?php
$base = "https://graph-api.btcturk.com";
$method = "/v1/klines/history?from=1602925320&resolution=60&symbol=BTCTRY&to=1603152000";
$uri = $base.$method;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $uri);
curl_setopt($ch, CURLOPT_HTTP_VERSION, "CURL_HTTP_VERSION_1_2");
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
if (curl_errno($ch)) {
print_r(curl_error($ch));
}
$answer = json_decode($result);
print_r($answer);
import time, base64, hmac, hashlib, requests, json
base = "https://graph-api.btcturk.com"
method = "/v1/klines/history?from=1602925320&resolution=60&symbol=BTCTRY&to=1603152000"
uri = base+method
result = requests.get(url=uri)
result = result.json()
print(json.dumps(result, indent=2))t
uri := "https://graph-api.btcturk.com/v1/klines/history?from=1602925320&resolution=60&symbol=BTCTRY&to=1603152000"
request, _ := http.NewRequest("GET", uri, nil)
request.Header.Add("Content-Type", "application/json")
response, _ := http.DefaultClient.Do(request)
defer response.Body.Close()
body, _ := ioutil.ReadAll(response.Body)
fmt.Println(response)
fmt.Println(string(body))
const base = 'https://graph-api.btcturk.com'
const method = '/v1/klines/history?from=1602925320&resolution=60&symbol=BTCTRY&to=1603152000'
const uri = base+method;
const options = {method: 'GET', headers: {'Content-type': 'application/json'}};
fetch(uri, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));
Copy link