LogoLogo
  • Analytics
    • Create Chart
      • Select Mode
      • Function mode
        • 1. How to import data
          • Select Data
          • Select Time Range
          • Data Setting
        • 2. How to analyze data
          • Data Details
          • Function Setting
          • How to write functions
          • Function Library
          • Function Chart Examples
        • 3. How to visualize data
          • Line & Bar Chart
          • Doughnut Chart
          • Number Chart
          • Table Chart
          • Color Setting
      • Python mode
        • 1. How to preview data
        • 2. How to analyze data
          • Python Setting
          • How to write Python
          • Python Chart Examples
        • 3. How to visualize data
          • Line & Bar Chart
          • Table Chart
    • Publish Chart
    • Chart Examples
    • Fork Chart
  • Terminal
    • Create Bot Strategy
      • 0. How to write code
      • 1. How to preview data
    • Fork Strategy
    • Strategy Examples
    • 🔜Deploy Bot
  • Workspace
    • Manage Strategy
      • Strategy Published
      • Strategy saved as draft
    • 🔜Manage Bot
  • Account Setting
    • Change Password
    • 🔜Register Exchange Account
    • 🔜Register OTP
    • 🔜Register Payment
  • library
    • 📍Function Library
    • 📍Python Library
      • Private API
        • Binance
      • Public API
  • FAQ
    • Data
      • Dataset
        • data list
      • What type of data can I use?
      • How customizable are the data?
    • Security
      • Is UnBlinked safe?
    • Account
      • I forgot my OTP device
      • I forgot password
Powered by GitBook

Copyright © 2023, UnBlinked Co., Ltd. | All rights reserved.

On this page
  • Binance Spot
  • 1. Get Account Information
  • 2. Get Asset Balance
  • 3. Market Order by Amount
  • 4. Market Order by Quote Asset Quantity
  • 5. Limit Order by Amount
  • 6. Cancel Orders on Symbol
  • Binance USDⓈ-M Futures
  • 1. Get Account Balance
  • 2. Get Account Information
  • 3. Get Position Information
  • 4. Market Order
  • 5. Limit Order
  • 6. Cancel Orders on Symbol
  • Binance COIN-M Futures
  • 1. Get Account Information
  • 2. Get Position Information
  • 3. Market Order
  • 4. Limit Order
  • 5. Cancel Orders on Symbol
  1. library
  2. Python Library
  3. Private API

Binance

Binance-only functions

PreviousPrivate APINextPublic API

Last updated 1 year ago

Binance Spot

The names of the functions related to the Binance spot start with privateAPI.binance_.


1. Get Account Information

privateAPI.binance_account_info() -> dict

Get an account information, including the balance, fee rate, and etc.

Arguments

None

Response

Same as the response in the API documentation.


2. Get Asset Balance

privateAPI.binance_asset_balance(asset: str) -> dict

Get the tradable amount(free) and locked amount(locked) of the asset in the Binance spot account.

Arguments

  • asset : (string) The name of the asset to get the balance.

Response

  • asset : (string) The name of the asset.

  • free : (string) The tradable amount of the asset.

  • locked : (string) The amount of locked asset.

# response example
{ 
    "asset": "BTC",
    "free": "4723846.89208129",
    "locked": "0.00000000"
}

3. Market Order by Amount

privateAPI.binance_market_order_by_amount(amount: float, symbol: str, orderside: str) -> dict

Create a new market order. In this function, the currency of the amount is a base asset. For example, If the symbol = 'BTCUSDT'(base asset = BTC, quote asset = USDT) and amount=0.15, then it creates an order of size 0.15 BTC.

Arguments

  • amount : (float) The amount of the order.

  • symbol : (string) The name of the symbol to trade.

  • orderside : (string) To buy, set it as 'buy', or 'sell' to sell.

Response

Same as the response in the API documentation.


4. Market Order by Quote Asset Quantity

privateAPI.binance_market_order_by_quote_qty(quoteqty: float, symbol: str, orderside: str) -> dict

Create a new market order by the amount of the order in the quote asset. In this function, the currency of the amount is a quote asset. For example, If the symbol = 'BTCUSDT'(base asset = BTC, quote asset = USDT) and quoteqty=120, then it creates an order of size 120 USDT.

Arguments

  • quoteqty : (float) The amount of the order in quote asset.

  • symbol : (string) The name of the symbol to trade.

  • orderside : (string) To buy, set it as 'buy', or 'sell' to sell.

Response

Same as the response in the API documentation.


5. Limit Order by Amount

privateAPI.binance_limit_order_by_amount(amount: float, price: float, symbol: str, orderside: str) -> dict

Create a new limit order. In this function, the currency of the amount is a base asset.

Arguments

  • amount : (float) The amount of the order.

  • price : (float) The price for the order to be filled.

  • symbol : (string) The name of the symbol to trade.

  • orderside : (string) To buy, set it as 'buy', or 'sell' to sell.

Response

Same as the response in the API documentation.


6. Cancel Orders on Symbol

privateAPI.binance_cancel_orders_on_symbol(symbol: str) -> any

Cancel all open orders of the symbol.

Arguments

  • symbol : (string) The name of the symbol to cancel.

Response

Same as the response in the API documentation.


Binance USDⓈ-M Futures

The names of the functions related to the Binance USDⓈ-M futures start with privateAPI.binance_futures_.

1. Get Account Balance

privateAPI.binance_futures_account_balance() -> list

Get the balance of the assets in the Binance USD-M futures account.

Arguments

None

Response

Same as the response in the API documentation.


2. Get Account Information

privateAPI.binance_futures_account_info() -> dict

Get the account information of the Binance USDⓈ-M futures account.

Arguments

None

Response

Same as the response in the API documentation.


3. Get Position Information

privateAPI.binance_futures_position_info() -> list

Get the open position information of the Binance USDⓈ-M futures account.

Arguments

None

Response

Same as the response in the API documentation.


4. Market Order

privateAPI.binance_futures_market_order(leverage: int, symbol: str, side: str, qty: float) -> dict

Set the leverage of the symbol and create a market order.

Arguments

  • leverage : (int) The leverage value to set.

  • symbol : (string) The name of the symbol.

  • side : (string) 'BUY' to open long & close short position, or 'SELL' to open short & close long position.

  • qty : (float) The contract size to set order. In most case, it is the amount in base asset. For instance, symbol=ETHUSDT, and qty=0.12 will create an order of contract size 0.12 ETH.

Response

Same as the response in the API documentation.


5. Limit Order

privateAPI.binance_futures_limit_order(leverage: int, symbol: str, side: str, qty: float, price: float) -> dict

Set the leverage of the symbol and create a limit order.

Arguments

  • leverage : (int) The leverage value to set.

  • symbol : (string) The name of the symbol.

  • side : (string) 'BUY' to open long & close short position, or 'SELL' to open short & close long position.

  • qty : (float) The contract size to set order. In most case, it is the amount in base asset. For instance, symbol=ETHUSDT and qty=0.12 will create an order of contract size 0.12 ETH.

  • price : (float) The price for the order to be filled.

Response

Same as the response in the API documentation.


6. Cancel Orders on Symbol

privateAPI.binance_futures_cancel_orders_on_symbol(symbol: str) -> any

Cancel all open orders of the symbol.

Arguments

  • symbol : (string) The name of the symbol to cancel.

Response

Same as the response in the API documentation.


Binance COIN-M Futures

The names of the functions related to the Binance COIN-M futures start with privateAPI.binance_cm_futures_.

1. Get Account Information

privateAPI.binance_cm_futures_account_info() -> dict

Get the account information in the Binance COIN-M Futures account.

Arguments

None

Response

Same as the response in the API documentation.


2. Get Position Information

privateAPI.binance_cm_futures_position_info() -> list

Get the open position information in the Binance COIN-M Futures account.

Arguments

None

Response

Same as the response in the API documentation.


3. Market Order

privateAPI.binance_cm_futures_market_order(leverage: int, symbol: str, side: str, qty: float) -> dict

Set the leverage of the symbol and create a market order.

Arguments

  • leverage : (int) The leverage value to set.

  • symbol : (string) The name of the symbol.

  • side : (string) 'BUY' to open long & close short position, or 'SELL' to open short & close long position.

  • qty : (float) The size of the contract(=CONT) to set order. In most case, 1 CONT is a size of 10 USD, while some symbols such as BTCUSD have 1 CONT as 100 USD. For instance, symbol=ETHUSD and qty=20 will create an order of ETHUSD with the contract size 200 USD, but symbol=BTCUSD and qty=20 will create an order of BTCUSD with the contract size 2000 USD.

Response

Same as the response in the API documentation.


4. Limit Order

privateAPI.binance_cm_futures_limit_order(leverage: int, symbol: str, side: str, qty: float, price: float) -> dict

Set the leverage of the symbol and create a limit order.

Arguments

  • leverage : (int) The leverage value to set.

  • symbol : (string) The name of the symbol.

  • side : (string) 'BUY' to open long & close short position, or 'SELL' to open short & close long position.

  • qty : (float) The size of the contract(=CONT) to set order. In most case, 1 CONT is a size of 10 USD, while some symbols such as BTCUSD have 1 CONT as 100 USD. For instance, symbol=ETHUSD and qty=20 will create an order of ETHUSD with the contract size 200 USD, but symbol=BTCUSD and qty=20 will create an order of BTCUSD with the contract size 2000 USD.

  • price : (float) The price for the order to be filled.

Response

Same as the response in the API documentation.


5. Cancel Orders on Symbol

privateAPI.binance_cm_futures_cancel_orders_on_symbol(symbol: str) -> any

Cancel all open orders of the symbol.

Arguments

  • symbol : (string) The name of the symbol to cancel.

Response

Same as the response in the API documentation.

This function filters the elements of the balance value in the response of the .

📍
API Documentation
binance_account_info()
API Documentation
API Documentation
API Documentation
API Documentation
API Documentation
API Documentation
API Documentation
API Documentation
API Documentation
API Documentation
API Documentation
API Documentation
API Documentation
API Documentation
API Documentation