OHCL Data

Returns daily cumulative data.

get
OHCL Data

https://graph-api.btcturk.com/v1/ohlcs
Request
Response
Request
Query Parameters
pair
required
string
BTC_TRY, ETH_TRY etc.
from
optional
integer
Unix time in seconds
to
optional
integer
Unix time in seconds
Response
200: OK
[
{
"pair": "BTCTRY",
"time": 1582070400,
"open": 61940,
"high": 62698,
"low": 58500,
"close": 58801,
"volume": 549.1858885452384,
"total": 33566080.63598728,
"average": 61119.71,
"dailyChangeAmount": -3139,
"dailyChangePercentage": -5.07
},
{
"pair": "BTCTRY",
"time": 1582156800,
"open": 59150,
"high": 61000,
"low": 58477,
"close": 59100,
"volume": 663.4533811472954,
"total": 39211283.23027989,
"average": 59101.79,
"dailyChangeAmount": -50,
"dailyChangePercentage": -0.08
},
{
"pair": "BTCTRY",
"time": 1582243200,
"open": 59104,
"high": 60399,
"low": 58801,
"close": 59704,
"volume": 387.62553661495724,
"total": 23127026.682461508,
"average": 59663.32,
"dailyChangeAmount": 600,
"dailyChangePercentage": 1.02
}
]

Python Code Example

import time, base64, hmac, hashlib, requests, json
base = "https://graph-api.btcturk.com"
method = "/v1/ohlcs?pair=BTC_TRY"
uri = base+method
result = requests.get(url=uri)
result = result.json()
print(json.dumps(result, indent=2))

PHP Code Example

<?php
$base = "https://graph-api.btcturk.com";
$method = "/v1/ohlcs?pair=BTC_TRY";
$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);