GET Single Product K line query
English / 中文
GET /kline
Please refer to the complete URL in API Address Description
API Endpoints
US Stocks, Hong Kong Stocks, A Shares, Major Index Data API Endpoints:
Base Path:
/quote-stock-b-api/kline
Full URL:
https://quote.tradeswitcher.com/quote-stock-b-api/kline
Forex, Precious Metals, Cryptocurrencies, Commodities API Endpoints:
Base Path:
/quote-b-api/kline
Full URL:
https://quote.tradeswitcher.com/quote-b-api/kline
Request Examples
Request Example for US Stocks, Hong Kong Stocks, A Shares, Major Index Data:
When sending a query request, you must include the method name and token information. An example request is as follows:
https://quote.tradeswitcher.com/quote-stock-b-api/kline?token=your_token&query=queryData
Request Example for Forex, Precious Metals, Cryptocurrencies, Commodities:
When sending a query request, you must include the method name and token information. An example request is as follows:
https://quote.tradeswitcher.com/quote-b-api/kline?token=your_token&query=queryData
Request Parameters
token
query
string
No
query
query
string
No
See explanation for query request parameter below
Explanation for query request parameter
Encode the following JSON using URL encoding and assign it to the 'query' query string in the URL:
Query Request Parameters
trace
string
Yes
Trace code used for logging purposes, ensure uniqueness for each request
data
object
Yes
» code
string
Yes
Refer to the code list and select the code you want to query
» kline_type
integer
Yes
Type of K-line: 1 minute K, 2 for 5-minute K, 3 for 15-minute K, 4 for 30-minute K, 5 for hourly K, 6 for 2-hour K, 7 for 4-hour K, 8 for daily K, 9 for weekly K, 10 for monthly K (Note: Stocks do not support 2-hour K and 4-hour K)
» kline_timestamp_end
integer
Yes
Indicates the time point to query backward from. Set to 0 for current time, only effective for non-stock type codes
» query_kline_num
integer
Yes
Number of K-lines to query, maximum of 1000
» adjust_type
integer
Yes
Adjustment type, effective only for stock codes, e.g., 0: ex-rights, 1: pre-adjustment, currently only supports 0
Response Example OK
Response Results
200
OK
OK
Inline
» ret
integer
true
» msg
string
true
» trace
string
true
» data
object
true
»» code
string
true
Code
»» kline_type
integer
true
Type of K-line: 1 minute K, 2 for 5-minute K, 3 for 15-minute K, 4 for 30-minute K, 5 for hourly K, 6 for 2-hour K, 7 for 4-hour K, 8 for daily K, 9 for weekly K, 10 for monthly K (Note: Stocks do not support 2-hour K and 4-hour K)
»» kline_list
[object]
true
»»» timestamp
string
true
Timestamp of the K-line
»»» open_price
string
true
Opening price of the K-line
»»» close_price
string
true
Closing price of the K-line
»»» high_price
string
true
Highest price of the K-line
»»» low_price
string
true
Lowest price of the K-line
»»» volume
string
true
Trading volume of the K-line
»»» turnover
string
true
Trading turnover of the K-line
Official Website
Official website: https://alltick.co/
Last updated