Rest API Endpoints

Test Connectivity

GET /fapi/v1/ping

Test connectivity to the Rest API.

Weight: 1

Parameters: NONE

Response:

{}

Check Server Time

GET /fapi/v1/time

Test connectivity to the Rest API and get the current server time.

Weight: 1

Parameters: NONE

Response:

{
  "serverTime": 1499827319559
}

Exchange Information

GET /fapi/v1/exchangeInfo

Current exchange trading rules and symbol information

Weight: 1

Parameters: NONE

Response:

{
    "exchangeFilters": [],
    "rateLimits": [
        {
            "interval": "MINUTE",
            "intervalNum": 1,
            "limit": 6000,
            "rateLimitType": "REQUEST_WEIGHT"
        },
        {
            "interval": "MINUTE",
            "intervalNum": 1,
            "limit": 6000,
            "rateLimitType": "ORDERS"
        }
    ],
    "serverTime": 1565613908500,
    "symbols": [
        {
            "filters": [
                {
                    "filterType": "PRICE_FILTER",
                    "maxPrice": "10000000",
                    "minPrice": "0.00000100",
                    "tickSize": "0.00000100"
                },
                {
                    "filterType": "LOT_SIZE",
                    "maxQty": "10000000",
                    "minQty": "0.00100000",
                    "stepSize": "0.00100000"
                },
                {
                    "filterType": "MARKET_LOT_SIZE",
                    "maxQty": "10000000",
                    "minQty": "0.00100000",
                    "stepSize": "0.00100000"
                },
                {
                    "filterType": "MAX_NUM_ORDERS",
                    "limit": 100
                }
            ],
            "maintMarginPercent": "2.5000",
            "pricePrecision": 2,
            "quantityPrecision": 3,
            "requiredMarginPercent": "5.0000",
            "status": "TRADING",
            "OrderType": [
                "LIMIT",
                "MARKET",
                "STOP"
            ],
            "symbol": "BTCUSDT",
            "timeInForce": [
                "GTC",    // Good Till Cancel
                "IOC",    // Immediate or Cancel
                "FOK",    // Fill or Kill
                "GTX"     // Post only or kill
            ]
        }
    ],
    "timezone": "UTC"
}


Order Book

GET /fapi/v1/depth

Weight: Adjusted based on the limit:

Limit Weight
5, 10, 20, 50, 100 1
500 5
1000 10

Parameters:

Name Type Mandatory Description
symbol STRING YES
limit INT NO Default 100; max 1000. Valid limits:[5, 10, 20, 50, 100, 500, 1000]

Response:

{
  "lastUpdateId": 1027024,
  "bids": [
    [
      "4.00000000",     // PRICE
      "431.00000000"    // QTY
    ]
  ],
  "asks": [
    [
      "4.00000200",
      "12.00000000"
    ]
  ]
}

Recent Trades List

GET /fapi/v1/trades

Get recent trades (up to last 500).

Weight: 1

Parameters:

Name Type Mandatory Description
symbol STRING YES
limit INT NO Default 500; max 1000.

Response:

[
  {
    "id": 28457,
    "price": "4.00000100",
    "qty": "12.00000000",
    "quoteQty": "8000.00",
    "time": 1499865549590,
    "isBuyerMaker": true,
  }
]

Old Trades Lookup

GET /fapi/v1/historicalTrades

Get older market historical trades.

Weight: 5

Parameters:

Name Type Mandatory Description
symbol STRING YES
limit INT NO Default 500; max 1000.
fromId LONG NO TradeId to fetch from. Default gets most recent trades.
  • X-MBX-APIY required

Response:

[
  {
    "id": 28457,
    "price": "4.00000100",
    "qty": "12.00000000",
    "quoteQty": "8000.00",
    "time": 1499865549590,
    "isBuyerMaker": true,
  }
]

Compressed/Aggregate Trades List

GET /fapi/v1/aggTrades

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

Weight: 1

Parameters:

Name Type Mandatory Description
symbol STRING YES
fromId LONG NO ID to get aggregate trades from INCLUSIVE.
startTime LONG NO Timestamp in ms to get aggregate trades from INCLUSIVE.
endTime LONG NO Timestamp in ms to get aggregate trades until INCLUSIVE.
limit INT NO Default 500; max 1000.
  • If both startTime and endTime are sent, time between startTime and endTime must be less than 1 hour.
  • If fromId, startTime, and endTime are not sent, the most recent aggregate trades will be returned.

Response:

[
  {
    "a": 26129,         // Aggregate TradeId
    "p": "0.01633102",  // Price
    "q": "4.70443515",  // Quantity
    "f": 27781,         // First TradeId
    "l": 27781,         // Last TradeId
    "T": 1498793709153, // Timestamp
    "m": true,          // Was the buyer the maker?
  }
]

Kline/Candlestick data

GET /fapi/v1/klines

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

Weight: 1

Parameters:

Name Type Mandatory Description
symbol STRING YES
interval ENUM YES
startTime LONG NO
endTime LONG NO
limit INT NO Default 500; max 1000.
  • If startTime and endTime are not sent, the most recent klines are returned.

Response:

[
  [
    1499040000000,      // Open Time
    "0.01634790",       // Open
    "0.80000000",       // High
    "0.01575800",       // Low
    "0.01577100",       // Close
    "148976.11427815",  // Volume
    1499644799999,      // Close Time
    "2434.19055334",    // Quote Asset Volume
    308,                // Number of Trades
    "1756.87402397",    // Taker Buy Base Asset Volume
    "28.46694368",      // Taker Buy Quote Asset Volume
    "17928899.62484339" // Ignore.
  ]
]

Mark Price

GET /fapi/v1/premiumIndex

mark price and funding rate

Weight: 1

Parameters:

Name Type Mandatory Description
symbol STRING YES

Response:

{
    "symbol": "BTCUSDT",
    "markPrice": "11012.80409769",
    "lastFundingRate": "-0.03750000",
    "nextFundingTime": 1562569200000,
    "time": 1562566020000
}

24hr Ticker Price Change Statistics

GET /fapi/v1/ticker/24hr

24 hour rolling window price change statistics. Careful when accessing this with no symbol.

Weight: 1 for a single symbol; 40 when the symbol parameter is omitted

Parameters:

Name Type Mandatory Description
symbol STRING NO
  • If the symbol is not sent, tickers for all symbols will be returned in an array.

Response:

{
  "symbol": "BTCUSDT",
  "priceChange": "-94.99999800",
  "priceChangePercent": "-95.960",
  "weightedAvgPrice": "0.29628482",
  "prevClosePrice": "0.10002000",
  "lastPrice": "4.00000200",
  "lastQty": "200.00000000",
  "openPrice": "99.00000000",
  "highPrice": "100.00000000",
  "lowPrice": "0.10000000",
  "volume": "8913.30000000",
  "quoteVolume": "15.30000000",
  "openTime": 1499783499040,
  "closeTime": 1499869899040,
  "firstId": 28385,   // First tradeId
  "lastId": 28460,    // Last tradeId
  "count": 76         // Trade count
}

Symbol Price Ticker

GET /fapi/v1/ticker/price

Latest price for a symbol or symbols.

Weight: 1 for a single symbol; 2 when the symbol parameter is omitted

Parameters:

Name Type Mandatory Description
symbol STRING YES
  • If the symbol is not sent, prices for all symbols will be returned in an array.

Response:

{
  "symbol": "BTCUSDT",
  "price": "6000.01"
}

Symbol Order Book Ticker

GET /fapi/v1/ticker/bookTicker

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

Weight: 1 for a single symbol; 2 when the symbol parameter is omitted

Parameters:

Name Type Mandatory Description
symbol STRING YES
  • If the symbol is not sent, bookTickers for all symbols will be returned in an array.

Response:

{
  "symbol": "BTCUSDT",
  "bidPrice": "4.00000000",
  "bidQty": "431.00000000",
  "askPrice": "4.00000200",
  "askQty": "9.00000000"
}