Quote

History Candlesticks

WSRequest · cmd 27

This API is used to obtain the history candlestick data of security.

message SecurityHistoryCandlestickRequest {
  string symbol = 1;
  Period period = 2;
  AdjustType adjust_type = 3;
  HistoryCandlestickQueryType query_type = 4;
  OffsetQuery offset_request = 5;
  DateQuery date_request = 6;
}

message SecurityCandlestickResponse {
  string symbol = 1;
  repeated Candlestick candlesticks = 2;
}
Quote Permission RequiredFree
  • Quota-based access: 100–3,000 unique symbols per calendar month depending on account tier (resets monthly; see quota table in the docs).
  • US stocks: US LV1 included free by default (pre-market, regular, after-hours, and overnight sessions).
  • HK stocks: LV1 included by default.
  • US options: no permission by default — purchase "OPRA US Options Quotes (OpenAPI)".

Request parameters

NameTypeRequiredDescription
symbolstringRequiredSecurity code, in ticker.region format, e.g. 700.HK
periodint32RequiredCandlestick period
adjust_typeint32RequiredAdjustment type
query_typeint32RequiredType of query (1-by offset, 2-by date)
date_requestobjectOptionalRequired when querying by date
└ start_datestringOptionalDate of query begin, in YYYYMMDD format
└ end_datestringOptionalDate of query end, in YYYYMMDD format
offset_requestobjectOptionalRequired when querying by offset
└ directionint32RequiredQuery direction (0-historical, 1-latest)
└ datestringOptionalQuery date, in YYYYMMDD format; default latest trading day
└ minutestringOptionalQuery time, in HHMM format; only valid for minute-level data
└ countint32OptionalCount of candlestick, range [1,1000]; default 10
trade_sessionint32OptionalTrading session, 0: intraday, 100: All (pre, intraday, post, overnight)

Response fields

NameTypeRequiredDescription
symbolstringOptionalSecurity code, e.g. AAPL.US
candlesticksobject[]OptionalCandlestick data
└ closestringOptionalClose price
└ openstringOptionalOpen price
└ lowstringOptionalLow price
└ highstringOptionalHigh price
└ volumeint64OptionalVolume
└ turnoverstringOptionalTurnover
└ timestampint64OptionalTimestamp
└ trade_sessionint32OptionalTrade session

Response JSON example

{
  "symbol": "700.HK",
  "candlesticks": [
    {
      "close": "362.000",
      "open": "364.600",
      "low": "361.600",
      "high": "368.800",
      "volume": 10853604,
      "turnover": "3954556819.000",
      "timestamp": 1650384000
    }
  ]
}