Skip to main content

Candlesticks

The market data request is not supported via Webull OpenAPI at the moment. Please keep tuned.

Interface Description

  • Function description:

    • Returns to Instrument in the window aggregated data.

    • According to the last N K-lines of the stock code, it supports various granularity K-lines such as m1 and m5. Currently, only the K-line with the previous weight is provided for the daily K-line and above, and only the un-weighted K-line is provided for the minute K.

  • Request URL: /market-data/bars

  • Request method: The interface provides the GRPC protocol for query.

  • Frequency limit: The calling frequency of each App ID is limited to 60 times per minute.

Request Parameters

ParameterTypeRequired fieldsDescription
symbolStringYesSecurities code
categoryStringYesSecurity Type. Reference:Category
timespanStringYesK-line time granularity. Reference: Timespan
countIntegerNoThe number of lines: the default is 200, and the maximum limit is 1200

Response Parameter

FieldTypeDescription
timeStringUTC time, eg: "2021-12-28T09:00:09.945+0000"
openStringOpening price
closeStringClosing price
highStringHighest price
lowStringLowest price
volumeStringTrading volume

Request Example

from webullsdktrade.grpc_api import API
from webullsdkquotescore.grpc.grpc_client import GrpcApiClient
from webullsdkcore.common.region import Region

grpc_client = GrpcApiClient(your_app_key, your_app_secret, Region.US.value)
api = API(grpc_client)
response = api.market_data.get_history_bar(symbols, category, timespan)
if response.status_code == 200:
bars = response.json()

Response Example

[
{
"time": "2021-12-28T09:00:00.000+0000",
"open": "100",
"close": "101",
"high": "105",
"low": "99",
"volume": "100000"
}
]