spot.market
Public methods exposed through client.spot.market.
agg_trades
Return aggregate public trades for a spot symbol.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol
|
str
|
Spot symbol. |
required |
limit
|
int | None
|
Maximum number of aggregate trades. |
None
|
start_time
|
Timestamp | None
|
Start timestamp in milliseconds. |
None
|
end_time
|
Timestamp | None
|
End timestamp in milliseconds. |
None
|
validate
|
bool | None
|
Validation override for this request. |
None
|
Returns:
| Type | Description |
|---|---|
list[AggTradesItem]
|
The validated endpoint response. |
References
Source code in pkg/src/mexc/spot/market/agg_trades.py
avg_price
Return current average price for a spot symbol.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol
|
str
|
Spot symbol. |
required |
validate
|
bool | None
|
Validation override for this request. |
None
|
Returns:
| Type | Description |
|---|---|
AvgPriceResponse
|
The validated endpoint response. |
References
Source code in pkg/src/mexc/spot/market/avg_price.py
book_ticker
Return best bid and ask for one spot symbol or all symbols.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol
|
str | None
|
Spot symbol. If omitted, returns all symbols. |
None
|
validate
|
bool | None
|
Validation override for this request. |
None
|
Returns:
| Type | Description |
|---|---|
BookTickerResponse | list[BookTickerListItem]
|
The validated endpoint response. |
References
Source code in pkg/src/mexc/spot/market/book_ticker.py
candles
Return spot kline/candlestick rows for a symbol.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol
|
str
|
Spot symbol. |
required |
interval
|
Literal['1m', '5m', '15m', '30m', '60m', '4h', '1d', '1W', '1M']
|
Kline interval. |
required |
start_time
|
Timestamp | None
|
Start timestamp in milliseconds. |
None
|
end_time
|
Timestamp | None
|
End timestamp in milliseconds. |
None
|
limit
|
int | None
|
Maximum number of candles. |
None
|
validate
|
bool | None
|
Validation override for this request. |
None
|
Returns:
| Type | Description |
|---|---|
list[SpotCandle]
|
The validated endpoint response. |
References
Source code in pkg/src/mexc/spot/market/candles.py
default_symbols
Return MEXC spot default symbols.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
validate
|
bool | None
|
Validation override for this request. |
None
|
Returns:
| Type | Description |
|---|---|
DefaultSymbolsResponse
|
The validated endpoint response. |
References
Source code in pkg/src/mexc/spot/market/default_symbols.py
depth
Return a spot order book snapshot for a symbol.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol
|
str
|
Spot symbol. |
required |
limit
|
int | None
|
Number of bids and asks to return. |
None
|
validate
|
bool | None
|
Validation override for this request. |
None
|
Returns:
| Type | Description |
|---|---|
OrderBook
|
The validated endpoint response. |
References
Source code in pkg/src/mexc/spot/market/depth.py
etf_info
Return spot ETF information such as net value, leverage, and fund fee.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol
|
str | None
|
ETF symbol. |
None
|
validate
|
bool | None
|
Validation override for this request. |
None
|
Returns:
| Type | Description |
|---|---|
EtfInfoResponse | list[EtfInfoListItem]
|
The validated endpoint response. |
References
Source code in pkg/src/mexc/spot/market/etf_info.py
exchange_info
Return spot exchange metadata and symbol trading rules.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol
|
str | None
|
Single spot symbol to query. |
None
|
symbols
|
str | None
|
Comma-separated spot symbols to query. |
None
|
validate
|
bool | None
|
Validation override for this request. |
None
|
Returns:
| Type | Description |
|---|---|
ExchangeInfoResponse
|
The validated endpoint response. |
References
Source code in pkg/src/mexc/spot/market/exchange_info.py
historical_trades
Return older public spot trades for a symbol.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol
|
str
|
Spot symbol. |
required |
limit
|
int | None
|
Maximum number of trades to return. |
None
|
from_id
|
str | None
|
Trade id to fetch from. |
None
|
validate
|
bool | None
|
Validation override for this request. |
None
|
Returns:
| Type | Description |
|---|---|
list[HistoricalTradesItem]
|
The validated endpoint response. |
References
Source code in pkg/src/mexc/spot/market/historical_trades.py
historical_trades_paged
Yield historical trade pages by advancing the fromId cursor.
Source code in pkg/src/mexc/spot/market/historical_trades.py
ping
Test connectivity to the MEXC spot REST API.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
validate
|
bool | None
|
Validation override for this request. |
None
|
Returns:
| Type | Description |
|---|---|
PingResponse
|
The validated endpoint response. |
References
Source code in pkg/src/mexc/spot/market/ping.py
ticker_24hr
Return 24-hour ticker statistics for one spot symbol or all symbols.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol
|
str | None
|
Spot symbol. If omitted, returns all symbols. |
None
|
validate
|
bool | None
|
Validation override for this request. |
None
|
Returns:
| Type | Description |
|---|---|
Ticker24hrStats | list[Ticker24hrStatsListItem]
|
The validated endpoint response. |
References
Source code in pkg/src/mexc/spot/market/ticker_24hr.py
ticker_price
Return latest price for one spot symbol or all symbols.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol
|
str | None
|
Spot symbol. If omitted, returns all symbols. |
None
|
validate
|
bool | None
|
Validation override for this request. |
None
|
Returns:
| Type | Description |
|---|---|
TickerPriceResponse | list[TickerPriceListItem]
|
The validated endpoint response. |
References
Source code in pkg/src/mexc/spot/market/ticker_price.py
time
Return the current MEXC spot server time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
validate
|
bool | None
|
Validation override for this request. |
None
|
Returns:
| Type | Description |
|---|---|
TimeResponse
|
The validated endpoint response. |
References
Source code in pkg/src/mexc/spot/market/time.py
trades
Return recent public trades for a spot symbol.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol
|
str
|
Spot symbol. |
required |
limit
|
int | None
|
Maximum number of trades to return. |
None
|
validate
|
bool | None
|
Validation override for this request. |
None
|
Returns:
| Type | Description |
|---|---|
list[TradesItem]
|
The validated endpoint response. |