API Reference
1. Info
- Title: gRPC API
- Version: 1.0.0
- Description: This documentation is generated from protobuf files using protoc-gen-doc.
2. Paths
Market
Time
- Summary: Time
- Method:
Time - Endpoint:
market.Market/Time - Request:
- Content-Type:
application/grpc - Schema: Empty
- Content-Type:
- Response:
- Content-Type:
application/grpc - Schema: TimeResponse
- Content-Type:
Depth
- Summary: 深度信息
- Method:
Depth - Endpoint:
market.Market/Depth - Request:
- Content-Type:
application/grpc - Schema: DepthRequest
- Content-Type:
- Response:
- Content-Type:
application/grpc - Schema: DepthResponse
- Content-Type:
Trades
- Summary: 近期成交
- Method:
Trades - Endpoint:
market.Market/Trades - Request:
- Content-Type:
application/grpc - Schema: TradesRequest
- Content-Type:
- Response:
- Content-Type:
application/grpc - Schema: TradesResponse
- Content-Type:
Klines
- Summary: K线数据
- Method:
Klines - Endpoint:
market.Market/Klines - Request:
- Content-Type:
application/grpc - Schema: KlinesRequest
- Content-Type:
- Response:
- Content-Type:
application/grpc - Schema: KlinesResponse
- Content-Type:
MiniTicker
- Summary: 24hr价格变动情况
- Method:
MiniTicker - Endpoint:
market.Market/MiniTicker - Request:
- Content-Type:
application/grpc - Schema: MiniTickerRequest
- Content-Type:
- Response:
- Content-Type:
application/grpc - Schema: MiniTickerResponse
- Content-Type:
GetSymbolMiniTicker
- Summary: 指定symbol的24小时价格变动
- Method:
GetSymbolMiniTicker - Endpoint:
market.Market/GetSymbolMiniTicker - Request:
- Content-Type:
application/grpc - Schema: GetSymbolMiniTickerRequest
- Content-Type:
- Response:
- Content-Type:
application/grpc - Schema: GetSymbolMiniTickerResponse
- Content-Type:
3. Components
3.1 Schemas
DepthRequest
| Field | Type | Description |
|---|---|---|
| symbol | string | 交易对(btc_usdt_perp|eth_usdt_perp) |
| limit | int32 | 页数:默认 100; 最大 5000. 可选值:[5, 10, 20, 50, 100, 500, 1000, 5000] 如果 limit > 5000, 最多返回5000条数据. |
DepthResponse
| Field | Type | Description |
|---|---|---|
| symbol | string | 交易对 |
| bids | bytes | 买单:{价格,数量} |
| asks | bytes | 卖单:{价格,数量} |
| lastUpdateId | int64 | none |
GetSymbolMiniTickerRequest
| Field | Type | Description |
|---|---|---|
| symbol | string | 交易对(btc_usdt_perp|eth_usdt_perp) |
GetSymbolMiniTickerResponse
| Field | Type | Description |
|---|---|---|
| symbol | string | 交易对 |
| openPrice | string | 开盘价:24小时前开始第一笔成交价格 |
| highPrice | string | 最高价 |
| lowPrice | string | 最低价 |
| closePrice | string | 收盘价:最新成交价格 |
| volume | string | 成交量 |
| quoteVolume | string | 成交额 |
| time | int64 | none |
KlinesRequest
| Field | Type | Description |
|---|---|---|
| symbol | string | 交易对(btc_usdt_perp|eth_usdt_perp) |
| interval | string | 详见枚举定义:K线间隔(1m|3m|5m|15m|30m|1h|2h|4h|6h|8h|12h|1d|3d|1w|1M) |
| startTime | int64 | 从该时刻之后的成交记录开始返回结果 |
| endTime | int64 | 返回该时刻为止的成交记录 |
| limit | int32 | Default 500; max 1500. |
KlinesResponse
| Field | Type | Description |
|---|---|---|
| list | KlinesResponse.Kline | none |
Kline
| Field | Type | Description |
|---|---|---|
| openTime | int64 | 开盘时间 |
| closeTime | int64 | 收盘时间 |
| symbol | string | 交易对 |
| interval | string | 时间间隔 |
| open | string | 开盘价 |
| close | string | 收盘价 |
| high | string | 最高价 |
| low | string | 最低价 |
| volume | string | 交易量 |
| quoteVolume | string | 交易额 |
| num | int64 | 交易次数 |
| time | int64 | 时间 |
MiniTickerRequest
| Field | Type | Description |
|---|---|---|
| symbols | string | none |
MiniTickerResponse
| Field | Type | Description |
|---|---|---|
| list | GetSymbolMiniTickerResponse | none |
TimeResponse
| Field | Type | Description |
|---|---|---|
| serverTime | int64 | 当前服务器时间 |
TradesRequest
| Field | Type | Description |
|---|---|---|
| symbol | string | 交易对(btc_usdt_perp|eth_usdt_perp) |
| limit | int32 | Default 500; max 1000. |
TradesResponse
| Field | Type | Description |
|---|---|---|
| list | TradesResponse.Trade | none |
Trade
| Field | Type | Description |
|---|---|---|
| price | string | 价格 |
| qty | string | 成交量 |
| quoteQty | string | 成交额 |
| time | int64 | 成交时间 |
| isBuyerMaker | bool | 买方是否为挂单方:true-是,false-否 |
| symbol | string | 交易对 |
3.2 Enums
4. Scalar Value Types
| Proto Type | Go Type | C++ Type | Java Type | Python Type | Notes |
|---|---|---|---|---|---|
| double | float64 | double | double | float | |
| float | float32 | float | float | float | |
| int32 | int32 | int32 | int | int | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. |
| int64 | int64 | int64 | long | int/long | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. |
| uint32 | uint32 | uint32 | int | int/long | Uses variable-length encoding. |
| uint64 | uint64 | uint64 | long | int/long | Uses variable-length encoding. |
| sint32 | int32 | int32 | int | int | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. |
| sint64 | int64 | int64 | long | int/long | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. |
| fixed32 | uint32 | uint32 | int | int | Always four bytes. More efficient than uint32 if values are often greater than 2^28. |
| fixed64 | uint64 | uint64 | long | int/long | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. |
| sfixed32 | int32 | int32 | int | int | Always four bytes. |
| sfixed64 | int64 | int64 | long | int/long | Always eight bytes. |
| bool | bool | bool | boolean | boolean | |
| string | string | string | String | str/unicode | A string must always contain UTF-8 encoded or 7-bit ASCII text. |
| bytes | []byte | string | ByteString | str | May contain any arbitrary sequence of bytes. |
