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

Kline Data

GET https://graph-api.btcturk.com/v1/klines/history

Query Parameters

NameTypeDescription

symbol

string

BTCTRY, ETHUSDT etc.

resolution

integer

for minute (1, 15, 30, 60, 240) 1 day, 1 week or 1 year

from

integer

Unix time in seconds

to

integer

Unix time in seconds

// 20220203093519
// https://graph-api.btcturk.com/v1/klines/history?symbol=BTCTRY&resolution=60&from=1602925320&to=1603152000

{
  "s": "ok",
  "t": [
    1602925200,
    1602928800,
    1602932400,
    1602936000,
    1602939600,
    1602943200,
    1602946800,
    1602950400,
    1602954000,
    1602957600,
    1602961200,
    1602964800,
    1602968400,
    1602972000,
    1602975600,
    1602979200,
    1602982800,
    1602986400,
    1602990000,
    1602993600,
    1602997200,
    1603000800,
    1603004400,
    1603008000,
    1603011600,
    1603015200,
    1603018800,
    1603022400,
    1603026000,
    1603029600,
    1603033200,
    1603036800,
    1603040400,
    1603044000,
    1603047600,
    1603051200,
    1603054800,
    1603058400,
    1603062000,
    1603065600,
    1603069200,
    1603072800,
    1603076400,
    1603080000,
    1603083600,
    1603087200,
    1603090800,
    1603094400,
    1603098000,
    1603101600,
    1603105200,
    1603108800,
    1603112400,
    1603116000,
    1603119600,
    1603123200,
    1603126800,
    1603130400,
    1603134000,
    1603137600,
    1603141200,
    1603144800,
    1603148400,
    1603152000
  ],
  "h": [
    90599.0,
    90700.0,
    90661.0,
    90666.0,
    90700.0,
    90619.0,
    90793.0,
    90745.0,
    90657.0,
    90621.0,
    90706.0,
    90749.0,
    90749.0,
    90749.0,
    90750.0,
    90800.0,
    90801.0,
    90790.0,
    90820.0,
    90798.0,
    90720.0,
    90840.0,
    90900.0,
    90930.0,
    90914.0,
    90930.0,
    90998.0,
    91077.0,
    91145.0,
    91344.0,
    91223.0,
    91319.0,
    91304.0,
    91455.0,
    91398.0,
    91335.0,
    91340.0,
    91397.0,
    91399.0,
    91471.0,
    91387.0,
    91371.0,
    91341.0,
    91177.0,
    91119.0,
    91247.0,
    91246.0,
    91024.0,
    91130.0,
    91150.0,
    91480.0,
    91485.0,
    92222.0,
    92226.0,
    93243.0,
    93289.0,
    92950.0,
    92858.0,
    92549.0,
    92808.0,
    92980.0,
    92999.0,
    92990.0,
    92990.0
  ],
  "o": [
    90396.0,
    90480.0,
    90594.0,
    90661.0,
    90461.0,
    90401.0,
    90604.0,
    90615.0,
    90650.0,
    90598.0,
    90522.0,
    90507.0,
    90734.0,
    90579.0,
    90659.0,
    90686.0,
    90705.0,
    90790.0,
    90653.0,
    90635.0,
    90675.0,
    90655.0,
    90840.0,
    90844.0,
    90886.0,
    90762.0,
    90897.0,
    90970.0,
    90946.0,
    91131.0,
    91223.0,
    91170.0,
    91295.0,
    91296.0,
    91213.0,
    91335.0,
    91084.0,
    91113.0,
    91306.0,
    91313.0,
    91230.0,
    91371.0,
    91200.0,
    90900.0,
    91074.0,
    91015.0,
    91100.0,
    90899.0,
    90969.0,
    91048.0,
    90970.0,
    91370.0,
    91386.0,
    92096.0,
    92139.0,
    93199.0,
    92879.0,
    92777.0,
    92336.0,
    92512.0,
    92808.0,
    92980.0,
    92909.0,
    92990.0
  ],
  "l": [
    90312.0,
    90340.0,
    90475.0,
    90350.0,
    90293.0,
    90140.0,
    90477.0,
    90423.0,
    90302.0,
    90500.0,
    90420.0,
    90420.0,
    90548.0,
    90579.0,
    90551.0,
    90611.0,
    90586.0,
    90649.0,
    90602.0,
    90626.0,
    90551.0,
    90592.0,
    90786.0,
    90709.0,
    90730.0,
    90700.0,
    90800.0,
    90871.0,
    90946.0,
    91131.0,
    91080.0,
    91170.0,
    91213.0,
    91213.0,
    91213.0,
    90991.0,
    90945.0,
    91113.0,
    91050.0,
    91199.0,
    91200.0,
    91100.0,
    90829.0,
    90700.0,
    90933.0,
    90857.0,
    90608.0,
    90700.0,
    90752.0,
    90850.0,
    90959.0,
    91120.0,
    91326.0,
    92000.0,
    92108.0,
    92675.0,
    92700.0,
    92275.0,
    92300.0,
    92401.0,
    92647.0,
    92767.0,
    92750.0,
    92990.0
  ],
  "c": [
    90551.0,
    90599.0,
    90661.0,
    90599.0,
    90540.0,
    90610.0,
    90615.0,
    90541.0,
    90499.0,
    90620.0,
    90652.0,
    90749.0,
    90578.0,
    90748.0,
    90673.0,
    90705.0,
    90690.0,
    90649.0,
    90635.0,
    90675.0,
    90633.0,
    90840.0,
    90900.0,
    90752.0,
    90861.0,
    90919.0,
    90975.0,
    91010.0,
    91131.0,
    91135.0,
    91214.0,
    91213.0,
    91296.0,
    91213.0,
    91228.0,
    91166.0,
    91111.0,
    91307.0,
    91399.0,
    91329.0,
    91366.0,
    91156.0,
    90900.0,
    91070.0,
    91119.0,
    91245.0,
    90827.0,
    90969.0,
    91048.0,
    90971.0,
    91374.0,
    91325.0,
    92096.0,
    92145.0,
    93199.0,
    92878.0,
    92765.0,
    92350.0,
    92485.0,
    92808.0,
    92980.0,
    92844.0,
    92990.0,
    92990.0
  ],
  "v": [
    8.09832571113657,
    6.48704214645841,
    4.98000450055406,
    8.70534576219506,
    14.6523772459477,
    21.6375151482353,
    5.81418181699701,
    15.4183758810977,
    8.11767357616918,
    6.42723327624844,
    9.71644430121523,
    3.76605608397222,
    10.4928498093723,
    4.53828189604974,
    6.47717000254488,
    1.19435009677545,
    3.27047251659678,
    4.47022503254993,
    5.36127447601757,
    5.21730464594384,
    5.85419953557721,
    13.124876230082,
    7.2054278843716,
    7.08842105840449,
    2.73999110724253,
    5.02416682857438,
    6.40899810443503,
    10.3257011984242,
    6.03597197808995,
    25.6143727113522,
    8.9364711465314,
    16.4421541044285,
    9.97442417412822,
    22.9215879584663,
    12.9202487965522,
    16.1193481854134,
    9.02528516606253,
    4.37790278741159,
    4.81613441067748,
    2.16844665628742,
    5.19756007705655,
    3.55989973868418,
    8.09193260324537,
    6.8650017164764,
    5.2746907294204,
    14.2162662891205,
    30.2214654762065,
    16.2153633626294,
    29.8493101652712,
    19.7775526900659,
    21.7107152831159,
    18.957203682512,
    74.4823139742948,
    28.8026496879756,
    62.4349212504458,
    35.061275633052,
    22.2630931254243,
    24.5185737721622,
    19.9113919242809,
    23.1165148650762,
    15.8229785641888,
    11.9185098876769,
    3.787266536674,
    0.035005718935281
  ]
}
<?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);

Last updated