Market Snapshot
Interface Description
Function description:
- Query the latest stock market snapshots in batches according to the stock code list.
Request URL: /market-data/snapshot
Request method: Support HTTP and GRPC protocol.
HTTP only supports A-share (China Connect) and Hong Kong stock BMP query.
GRPC can support all market quotations, if the user have the corresponding quotation authority.
Frequency limit: The calling frequency of each AppId is limited to one time per second.
Request Parameters
Parameter | Type | Required fields | Description |
---|---|---|---|
symbols | String | Yes | List of security codes; for example: single: 00700 multiple: 00700,00981; For each request,up to 100 symbols can be subscribed; Under the authority of Hong Kong stock BMP, a single request supports up to 20 symbols |
category | String | Yes | Security type, enumeration, reference: Category, such as: HK_STOCK |
Response Parameter
Field | Type | Description |
---|---|---|
symbol | String | Securities code |
price | String | Current price |
open | String | Opening price: the opening price during the market time in the U.S. market, excluding pre-market and post-market data. If there is no transaction on the day, there is no return value |
high | String | Today's highest price: the highest intraday price in the U.S. market, excluding pre-market and post-market data. If there is no transaction on the day, there is no return value |
low | String | Today's lowest price: the lowest intraday price in the U.S. market, excluding pre-market and post-market data. If there is no transaction on the day, there is no return value |
pre_close | String | Yesterday's closing price |
volume | String | Volume: if there is no transaction on the day, there is no return value |
change | String | The amount of change: if there is no transaction on the day, there is no return value |
change_ratio | String | Change: if there is no transaction on the day, there is no return value |
Request Example
HTTP
- Python
- Java
from webullsdktrade.api import API
from webullsdkcore.client import ApiClient
from webullsdkcore.common.region import Region
api_client = ApiClient(your_app_key, your_app_secret, Region.HK.value)
api = API(api_client)
response = api.market_data.get_snapshot(symbols, category)
if response.status_code == 200:
bars = response.json()
HttpApiConfig apiConfig = HttpApiConfig.builder()
.appKey(Env.APP_KEY)
.appSecret(Env.APP_SECRET)
.regionId(Region.hk.name())
.build();
try (QuotesApiClient quotesApiClient = new HttpQuotesApiClient(apiConfig)) {
List<Snapshot> quotes = quotesApiClient.getSnapshots(symbols, category);
}
gRPC
- 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.HK.value)
api = API(grpc_client)
response = api.market_data.get_snapshot(symbols, category)
if response.status_code == 200:
result = response.json()
try (QuotesApiClient quotesApiClient = QuotesApiClient.builder()
.appKey(Env.APP_KEY)
.appSecret(Env.APP_SECRET)
.regionId(Region.hk.name())
.build()) {
List<Snapshot> quotes = quotesApiClient.getSnapshots(symbols, category);
}