Skip to content
K-Lines and Intraday

Get K-lines

Returns K-lines for a security by period, count, price adjustment, and trading session, for the K-line main chart on the security detail page. When the user switches the period, omit timestamp to get the latest batch. When the user scrolls left to load older data, pass the timestamp of the earliest K-line currently shown and set direction to 0. K-lines are returned in ascending time order. This endpoint also serves K-line overlay comparison (loading K-lines of the overlay securities) and the price charts in news and signal pages.

WhaleCore's quoteService() wraps this endpoint as the typed method getKlines. If you use WhaleCore, prefer that method.

GEThttps://api.lbkrs.com/v3/quote/kline

Parameters

counter_idstringqueryRequired

Security ID (counter_id), for example ST/US/AAPL or ST/HK/700

line_typeintegerqueryRequired

K-line period:

  • 1 - 1 minute
  • 5 - 5 minutes
  • 15 - 15 minutes
  • 30 - 30 minutes
  • 60 - 60 minutes
  • 1000 - Daily
  • 2000 - Weekly
  • 3000 - Monthly
  • 3500 - Quarterly
  • 4000 - Yearly

1515306010002000300035004000

line_numintegerqueryRequired

Number of K-lines to return, at most 1000 per request. The Broker App passes 310 on phones and 620 on tablets

timestampintegerquery

Paging reference time as a Unix timestamp in seconds. Omit it to query the latest K-lines

directionintegerquery

Paging direction, used with timestamp:

  • 0 - Older data before timestamp
  • 1 - Newer data after timestamp

01

adjust_typeintegerquery

Price adjustment type:

  • 0 - Unadjusted
  • 1 - Forward-adjusted

01

kline_sessionintegerqueryRequired

Trading sessions included in the K-lines:

  • 0 - Regular session only
  • 100 - All trading sessions
  • 101 - Pre-market, regular, and post-market
  • 102 - Overnight and regular

The Broker App chooses the value from the user's pre/post-market and overnight K-line settings, and passes 100 when both are on.

0100101102

new_version_klinebooleanqueryRequired

Whether to use the new price adjustment algorithm. The Broker App always passes true

include_turnover_ratebooleanqueryRequired

Whether to return the turnover rate turnover_rate for each K-line

Responses

HTTP 200The request succeeded. The response body contains the result of the “Get K-lines” operation.
Standard response envelopecodemessagedata
dataobjectdata structure
klinesarray<object>

K-lines in ascending time order; an empty array when there is no data

Child attributes
timestampinteger

K-line time as a Unix timestamp in seconds

openstring

Open price

highstring

High price

lowstring

Low price

closestring

Close price; for a K-line that has not ended, the latest price

prev_closestring

Close price of the previous K-line, used to calculate the change

amountnumber

Volume, in the trading unit of the security (such as shares or contracts)

balancestring

Turnover, in the quote currency of the security

turnover_ratestring

Turnover rate; returned only when include_turnover_rate is true

factor_astring

Adjustment factor A, used with factor_b to convert adjusted prices

factor_bstring

Adjustment factor B, used with factor_a to convert adjusted prices

latest_float_sharesnumber

Latest free-float shares, which can be used with volume to calculate the turnover rate

Whale Docs