Lodol Docs

Binance

API actions for the Binance integration.

Binance

Access public market data from Binance.


Get average price

Fetch the current average price for a trading pair.

Parameters

ParameterTypeRequiredDescription
symbolstringYesThe trading pair to look up, for example BTCUSDT.

Response

{
  "avg_price": {
    "mins": 5,
    "price": "42152.75"
  }
}

Get exchange info

Retrieve Binance's trading rules and details about each trading pair.

Parameters

ParameterTypeRequiredDescription
symbolstringNoThe trading pair to look up, for example BTCUSDT.

Response

{
  "exchange_info": {
    "serverTime": 1706097600000,
    "symbols": [
      {
        "baseAsset": "BTC",
        "quoteAsset": "USDT",
        "status": "TRADING",
        "symbol": "BTCUSDT"
      }
    ],
    "timezone": "UTC"
  }
}

Get order book

Retrieve the current order book (open buy and sell orders) for a trading pair.

Parameters

ParameterTypeRequiredDescription
symbolstringYesThe trading pair to look up, for example BTCUSDT.
limitnumberNoMaximum number of price levels to return on each side of the order book.

Response

{
  "order_book": {
    "asks": [
      [
        "42150.50",
        "0.75"
      ]
    ],
    "bids": [
      [
        "42150.00",
        "0.50"
      ]
    ],
    "lastUpdateId": 9876543210
  }
}

List recent trades

List the most recent trades for a trading pair.

Parameters

ParameterTypeRequiredDescription
symbolstringYesThe trading pair to look up, for example BTCUSDT.
limitnumberNoMaximum number of trades.

Response

{
  "trades": [
    {
      "id": 12345678,
      "isBuyerMaker": true,
      "price": "42150.50",
      "qty": "0.05",
      "time": 1706097600000
    }
  ]
}

Get server time

Fetch the current time from Binance's servers so your timestamps stay in sync with Binance.

Response

{
  "server_time": {
    "serverTime": 1706097600000
  }
}

Get 24-hour price stats

Retrieve price and volume statistics for a trading pair over the last 24 hours.

Parameters

ParameterTypeRequiredDescription
symbolstringYesThe trading pair to look up, for example BTCUSDT.

Response

{
  "ticker": {
    "lastPrice": "42150.50",
    "priceChange": "850.50",
    "priceChangePercent": "2.05",
    "symbol": "BTCUSDT"
  }
}

On this page