OHLC Data
Returns daily cumulative data.
This is the data that is shown in our charting interface.
  • open, high, low, close, volume, total and average information can be viewed with OHLC enpoint.

Response

1
{
2
"pair": "BTCUSDT",
3
"time": 1639526400,
4
"open": 48250.0,
5
"high": 49500.0,
6
"low": 46601.0,
7
"close": 48820.0,
8
"volume": 199.490950394233,
9
"total": 9634561.91977406,
10
"average": 48295.73,
11
"dailyChangeAmount": 570.0,
12
"dailyChangePercentage": 1.18
13
}
Copied!
  • Can be used with pair, from and to parameters
    • https://graph-api.btcturk.com/v1/ohlcs?pair=BTCUSDT&from=1638316800&to=1639526400
The from and to parameters must be used with Unix time in seconds.
The from and to parameters must be used with Unix time in seconds.
get
https://graph-api.btcturk.com
/v1/ohlcs
OHLC Data

Code Example

PHP
Python
1
<?php
2
$base = "https://graph-api.btcturk.com";
3
$method = "/v1/ohlcs?pair=BTCTRY";
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/ohlcs?pair=BTCTRY"
5
uri = base+method
6
7
result = requests.get(url=uri)
8
result = result.json()
9
print(json.dumps(result, indent=2))t
Copied!