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
Parameter | Type | Required fields | Description |
---|---|---|---|
symbol | String | Yes | Securities code |
category | String | Yes | Security Type. Reference:Category |
timespan | String | Yes | K-line time granularity. Reference: Timespan |
count | Integer | No | The number of lines: the default is 200, and the maximum limit is 1200 |
Response Parameter
Field | Type | Description |
---|---|---|
time | String | UTC time, eg: "2021-12-28T09:00:09.945+0000" |
open | String | Opening price |
close | String | Closing price |
high | String | Highest price |
low | String | Lowest price |
volume | String | Trading volume |
Request Example
- Python
- Java
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()
try (QuotesApiClient quotesApiClient = QuotesApiClient.builder()
.appKey(Env.APP_KEY)
.appSecret(Env.APP_SECRET)
.regionId(Region.us.name())
.build()) {
List<Bar> bars = quotesApiClient.getBars(symbols, category, timespan);
}
Response Example
[
{
"time": "2021-12-28T09:00:00.000+0000",
"open": "100",
"close": "101",
"high": "105",
"low": "99",
"volume": "100000"
}
]