简体   繁体   中英

How do i get the orderId of an order with python-binance?

I have recently started looking at python-binance . I have read through the entire API and spent a frustratingly long time on Google, trying to find out how to get an orderId .

The API frequently states that you need the orderId for certain functions, but never how to actually get the orderId of an order.

Can anyone help me please?

You need to create an order first and you will get the orderId in the response:

{
    "symbol": "BTCUSDT",
    "orderId": 28,
    "clientOrderId": "6gCrw2kRUAF9CvJDGP16IP",
    "transactTime": 1507725176595,
    "price": "0.00000000",
    "origQty": "10.00000000",
    "executedQty": "10.00000000",
    "status": "FILLED",
    "timeInForce": "GTC",
    "type": "MARKET",
    "side": "SELL"
}

See here https://python-binance.readthedocs.io/en/latest/binance.html?highlight=create_order#binance.client.Client.create_order

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM