Market Snapshot
Interface Description
Function description:
- Query the latest crypto market snapshots in batches according to the crypto code list.
URL: /market-data/snapshot
Method: GET
Rate limit: The calling frequency of each App ID is limited to one time per second.
Request Parameters
Parameter | Type | Required fields | Description |
---|---|---|---|
symbols | String | Yes | List of security codes; for example: single: BTCUSD multiple: BTCUSD,ETHUSD; For each request,up to 100 symbols can be subscribed |
category | String | Yes | Security type, enumeration, reference: Category, such as: CRYPTO |
Response Parameter
Field | Type | Description |
---|---|---|
symbol | String | Securities code |
open | String | Opening price: the opening price during the market time, 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, 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, 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 |
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 |
instrument_id | String | Instrument ID |
trade_timestamp | Long | UTC timestamp, eg: 1739100939000 |
Request Example
- Python
- Java
from webullpaysdkcore.client import ApiClient
from webullpaysdkmdata.common.category import Category
from webullpaysdkmdata.request.get_snapshot_request import GetSnapshotRequest
from webullpaysdkcore.common.region import Region
your_app_key = "<your_app_key>"
your_app_secret = "<your_app_secret>"
api_client = ApiClient(your_app_key, your_app_secret, Region.US.value)
request = GetSnapshotRequest()
request.set_category(Category.CRYPTO.name)
request.set_symbols("BTCUSD")
response = api_client.get_response(request)
if response.status_code == 200:
result = response.json()
print(result)
HttpApiConfig apiConfig = HttpApiConfig.builder()
.appKey("<your_app_key>")
.appSecret("<your_app_secret>")
.regionId(Region.us.name())
.build();
try (QuotesApiClient quotesApiClient = new HttpQuotesApiClient(apiConfig)) {
// get snapshots
Set<String> symbols = new HashSet<>();
symbols.add("BTCUSD");
List<Snapshot> snapshots = quotesApiClient.getSnapshots(symbols, Category.CRYPTO.name());
// print
System.out.println(JsonSerializer.toJson(snapshots, SerializeConfig.builder().underscoresToCamel(true).build()));
}
Response Example
[
{
"symbol": "BTCUSD",
"open": "100",
"high": "105",
"low": "99",
"pre_close": "101",
"change": "1.0",
"change_ratio": "0.05",
"instrument_id": "950160802",
"trade_timestamp": 1739955675063
}
]