Skip to main content

Market Data Endpoints

Download Historical Market Data

Provides kline and trading data for all Spot pairs since 01-01-2023:Historical Market Data

Test Connectivity

Response

{}
  • GET /api/v3/ping

Test connectivity to the Rest API.

Weight(IP): 1

Parameter:

NONE

Check Server Time

Response

{
"serverTime" : 1645539742000
}
  • GET /api/v3/time

Weight(IP): 1

Parameter:

NONE

API default symbol

Request

GET /api/v3/defaultSymbols

Response

{
"code": 200,
"data": [
"GENE1USDT",
"SNTUSDT",
"SQUAWKUSDT",
"HEGICUSDT",
"GUMUSDT"
],
"msg": null
}
  • GET /api/v3/defaultSymbols

Weight(IP): 1

Request

NONE

Response

NameTypeDescription
symbolstringsymbol

Exchange Information

Response

{
"symbol": "METALUSDT",
"status": "1",
"baseAsset": "METAL",
"baseAssetPrecision": 2,
"quoteAsset": "USDT",
"quotePrecision": 5,
"quoteAssetPrecision": 5,
"baseCommissionPrecision": 2,
"quoteCommissionPrecision": 5,
"orderTypes": [
"LIMIT",
"MARKET",
"LIMIT_MAKER"
],
"isSpotTradingAllowed": true,
"isMarginTradingAllowed": false,
"quoteAmountPrecision": "1",
"baseSizePrecision": "0.1",
"permissions": [
"SPOT",
],
"filters": [
{
"filterType": "PERCENT_PRICE_BY_SIDE",
"bidMultiplierUp": "5",
"askMultiplierDown": "0.2"
},

],
"maxQuoteAmount": "2000000",
"makerCommission": "0",
"takerCommission": "0.0005",
"quoteAmountPrecisionMarket": "1",
"maxQuoteAmountMarket": "100000",
"fullName": "Metal Blockchain",
"tradeSideType":"1",
"contractAddress": "xtokens",
"st": false
}

  • GET /api/v3/exchangeInfo

Current exchange trading rules and symbol information

Weight(IP): 10

Parameter:

There are 3 possible options:

MethodExample
No parametercurl -X GET "https://api.mexc.com/api/v3/exchangeInfo"
symbolcurl -X GET "https://api.mexc.com/api/v3/exchangeInfo?symbol=MXUSDT"
symbolscurl -X GET "https://api.mexc.com/api/v3/exchangeInfo?symbols=MXUSDT,BTCUSDT"

Response:

NameTypeDescription
timezonestringtimezone
serverTimelongserver Time
rateLimitsArrayrate Limits
exchangeFiltersArrayexchange Filters
symbolStringsymbol
statusStringstatus:1 - online, 2 - Pause, 3 - offline
baseAssetStringbase Asset
baseAssetPrecisionIntbase Asset Precision
quoteAssetStringquote Asset
quotePrecisionIntquote Precision
quoteAssetPrecisionIntquote Asset Precision
baseCommissionPrecisionIntbase Commission Precision
quoteCommissionPrecisionIntquote Commission Precision
orderTypesArrayOrder Type
isSpotTradingAllowedBooleanallow api spot trading
isMarginTradingAllowedBooleanallow api margin trading
permissionsArraypermissions
filterTypeStringfilter type:PERCENT_PRICE_BY_SIDE
bidMultiplierUpStringbidMultiplierUp
askMultiplierDownStringaskMultiplierDown
maxQuoteAmountStringmax Quote Amount
makerCommissionStringmarker Commission
takerCommissionStringtaker Commission
quoteAmountPrecisionstringmin order amount
baseSizePrecisionstringmin order quantity
quoteAmountPrecisionMarketstringmin order amount in market order
maxQuoteAmountMarketStringmax quote Amount in market order
tradeSideTypeStringtradeSide Type:1 - All, 2 - buy order only, 3 - Sell order only, 4 - Close
contractAddressStringcontract Address
stStringsymbol st status:false,true

filter parameter description:

  • lastPrice means using the latest trade price, orderPrice means the order placement price.
  • For buy orders (only for LIMIT, IMMEDIATE_OR_CANCEL, FILL_OR_KILL): orderPrice <= lastPrice * bidMultiplierUp
  • For sell orders: orderPrice >= lastPrice * askMultiplierDown

Order Book

Response

{
"lastUpdateId": 1112416,
"bids": [
["15.00000", "49999.00000"]
],
"asks": [
["14.0000", "1.0000"]
]
}
  • GET /api/v3/depth

Weight(IP): 1

Parameter:

NameTypeMandatoryDescriptionScope
symbolstringYESSymbol
limitintegerNOReturen numberdefault 100; max 5000

Response:

NameTypeDescription
lastUpdateIdlongLast Update Id
bidslistBid [Price, Quantity ]
askslistAsk [Price, Quantity ]

Recent Trades List

Response

[
{
"id": null,
"price": "23",
"qty": "0.478468",
"quoteQty": "11.004764",
"time": 1640830579240,
"isBuyerMaker": true,
"isBestMatch": true
}
]
  • GET /api/v3/trades

Weight(IP): 5

Parameter:

NameTypeMandatoryDescriptionScope
symbolstringYES
limitintegerNODefault 500; max 1000

Response:

NameDescription
idTrade id
pricePrice
qtyNumber
quoteQtyTrade total
timeTrade time
isBuyerMakerWas the buyer the maker?
isBestMatchWas the trade the best price match?

Compressed/Aggregate Trades List

Response

[
{
"a": null,
"f": null,
"l": null,
"p": "46782.67",
"q": "0.0038",
"T": 1641380483000,
"m": false,
"M": true
}
]
  • GET /api/v3/aggTrades

Weight(IP): 1

Get compressed, aggregate trades. Trades that fill at the time, from the same order, with the same price will have the quantity aggregated.

Parameters:

NameTypeMandatoryDescriptionScope
symbolstringYES
startTimelongNOTimestamp in ms to get aggregate trades from INCLUSIVE.
endTimelongNOTimestamp in ms to get aggregate trades until INCLUSIVE.
limitintegerNODefault 500; max 1000.

startTime and endTime must be used at the same time.

Response:

NameDescription
aAggregate tradeId
fFirst tradeId
lLast tradeId
pPrice
qQuantity
TTimestamp
mWas the buyer the maker?
MWas the trade the best price match?

Kline/Candlestick Data

Response

[
[
1640804880000,
"47482.36",
"47482.36",
"47416.57",
"47436.1",
"3.550717",
1640804940000,
"168387.3"
]
]
  • GET /api/v3/klines

Weight(IP): 1

Kline/candlestick bars for a symbol. Klines are uniquely identified by their open time.

Parameters:

NameTypeMandatoryDescription
symbolstringYES
intervalENUMYESENUM: Kline Interval
startTimelongNO
endTimelongNO
limitintegerNODefault 500; max 1000.

Response:

IndexDescription
0Open time
1Open
2High
3Low
4Close
5Volume
6Close time
7Quote asset volume

Current Average Price

Response

{
"mins": 5,
"price": "9.35751834"
}
  • GET /api/v3/avgPrice

Weight(IP): 1

Parameters:

NameTypeMandatoryDescription
symbolstringYES

Response:

NameDescription
minsAverage price time frame
pricePrice

24hr Ticker Price Change Statistics

Response

{
"symbol": "BTCUSDT",
"priceChange": "184.34",
"priceChangePercent": "0.00400048",
"prevClosePrice": "46079.37",
"lastPrice": "46263.71",
"bidPrice": "46260.38",
"bidQty": "",
"askPrice": "46260.41",
"askQty": "",
"openPrice": "46079.37",
"highPrice": "47550.01",
"lowPrice": "45555.5",
"volume": "1732.461487",
"quoteVolume": null,
"openTime": 1641349500000,
"closeTime": 1641349582808,
"count": null
}
or
[
{
"symbol": "BTCUSDT",
"priceChange": "184.34",
"priceChangePercent": "0.00400048",
"prevClosePrice": "46079.37",
"lastPrice": "46263.71",
"bidPrice": "46260.38",
"bidQty": "",
"askPrice": "46260.41",
"askQty": "",
"openPrice": "46079.37",
"highPrice": "47550.01",
"lowPrice": "45555.5",
"volume": "1732.461487",
"quoteVolume": null,
"openTime": 1641349500000,
"closeTime": 1641349582808,
"count": null
},
{
"symbol": "ETHUSDT",
"priceChange": "184.34",
"priceChangePercent": "0.00400048",
"prevClosePrice": "46079.37",
"lastPrice": "46263.71",
"bidPrice": "46260.38",
"bidQty": "",
"askPrice": "46260.41",
"askQty": "",
"openPrice": "46079.37",
"highPrice": "47550.01",
"lowPrice": "45555.5",
"volume": "1732.461487",
"quoteVolume": null,
"openTime": 1641349500000,
"closeTime": 1641349582808,
"count": null
}
]
  • GET /api/v3/ticker/24hr

Weight(IP):

ParameterSymbols ProvidedWeight
symbol11
symbolsall40

Parameters:

NameTypeMandatoryDescription
symbolstringNOIf the symbol is not sent, tickers for all symbols will be returned in an array.

Response:

NameDescription
symbolSymbol
priceChangeprice Change
priceChangePercentprice change percent
prevClosePricePrevious close price
lastPriceLast price
lastQtyLast quantity
bidPriceBid best price
bidQtyBid best quantity
askPriceAsk best price
askQtyAsk best quantity
openPriceOpen
highPriceHigh
lowPriceLow
volumeDeal volume
quoteVolumeQuote asset volume
openTimeStart time
closeTimeClose time
count

Symbol Price Ticker

Response

{
"symbol": "BTCUSDT",
"price": "184.34"
}
or
[
{
"symbol": "BTCUSDT",
"price": "6.65"
},
{
"symbol": "ETHUSDT",
"price": "5.65"
}
]
  • GET /api/v3/ticker/price

Weight(IP):

ParameterSymbols ProvidedWeight
symbol11
symbolsall2

Parameters:

NameTypeMandatoryDescription
symbolstringNOIf the symbol is not sent, all symbols will be returned in an array.

Response:

NameDescription
symbol
priceLast price

Symbol Order Book Ticker

Response

{
"symbol": "AEUSDT",
"bidPrice": "0.11001",
"bidQty": "115.59",
"askPrice": "0.11127",
"askQty": "215.48"
}
OR
[
{
"symbol": "AEUSDT",
"bidPrice": "0.11001",
"bidQty": "115.59",
"askPrice": "0.11127",
"askQty": "215.48"
},
{
"symbol": "AEUSDT",
"bidPrice": "0.11001",
"bidQty": "115.59",
"askPrice": "0.11127",
"askQty": "215.48"
}
]
  • GET /api/v3/ticker/bookTicker

Weight(IP): 1

Best price/qty on the order book for a symbol or symbols.

Parameters:

NameTypeMandatoryDescription
symbolstringNOIf the symbol is not sent, all symbols will be returned in an array.

Response:

NameDescription
symbolSymbol
bidPriceBest bid price
bidQtyBest bid quantity
askPriceBest ask price
askQtyBest ask quantity