Order Book
Interface Description
Function description:
- Query the depth quote of securities according to the crypto code list.
URL: /market-data/quotes
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 |
---|---|---|---|
symbol | String | Yes | example: single:BTCUSD |
category | String | Yes | Security type,enumeration, reference: Category, such as: CRYPTO |
Response Parameter
Field | Type | Description |
---|---|---|
symbol | String | Securities code |
instrument_id | String | Unique identifier for the security |
asks | []AskBid | Ask |
bids | []AskBid | Bid |
AskBid
Field | Type | Description |
---|---|---|
price | String | Current price |
Request Example
- Python
- Java
from webullpaysdkcore.client import ApiClient
from webullpaysdkmdata.common.category import Category
from webullpaysdkmdata.request.get_quotes_request import GetQuotesRequest
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 = GetQuotesRequest()
request.set_category(Category.CRYPTO.name)
request.set_symbol("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 quote
Quote quote = quotesApiClient.getQuote("BTCUSD", Category.CRYPTO.name());
// print
System.out.println(JsonSerializer.toJson(quote, SerializeConfig.builder().underscoresToCamel(true).build()));
}
Response Example
{
"symbol": "BTCUSD",
"instrumentId": "913255275",
"asks": [
{
"price": "90013.900000"
}
],
"bids": [
{
"price": "90013.900000"
}
]
}