get kline
API details
This API returns market candlestick (K-line) data.
Query parameters
MarketIdstringRequired
TickSpaceinteger Β· enumRequiredPossible values:
Limitinteger Β· int32Optional
maximum number of items to return. maximum value is 500.
Offsetinteger Β· int32Optional
number of items to skip before starting to collect the result set.
OrderBystringOptional
the sorting parameters for the list.
see https://learn.microsoft.com/en-us/azure/search/search-query-odata-orderby#examples for the format of the OrderBy string.
supported sorting parameters are: "Timestamp".
default sorting is by " Timestamp desc".
Responses
200
OK
400
Bad Request
401
Unauthorized
403
Forbidden
404
Not Found
500
Internal Server Error
501
Not Implemented
get
GET /v1/market/kline HTTP/1.1
Host: testnetopenapi.hibit.app
Accept: */*
{
"code": 1,
"message": "text",
"data": {
"items": [
{
"o": "text",
"h": "text",
"l": "text",
"c": "text",
"v": "text",
"a": "text",
"t": null
}
],
"totalCount": 1
}
}
Code example
import { hibitClient } from '@delandlabs/hibit-sdk';
const options = {
network: HibitNetwork.Testnet
};
hibitClient.setOptions(options);
const kline = await hibitClient.getMarketKline({
marketId: 10008n,
tickSpace: TickSpace.OneMinute,
limit: 100
});
SDK
Source code https://github.com/Deland-Labs/hibit-sdk
Example
Last updated