verata-veritatis / pybit

Python3 API connector for Bybit's HTTP and Websockets APIs.
MIT License
114 stars 189 forks source link

Parsing Returned Data #62

Closed g1thub11 closed 2 years ago

g1thub11 commented 2 years ago

Could you provide an example of how to parse data for pybit in Python? To get just the order_id from session.get_active_order(symbol="XRPUSDT") what would I need to do?

Marcus020 commented 2 years ago

Multiple ways of doing that, two examples:

contract_size = session.my_position(symbol="BTCUSD") print(contract_size["result"]["size"])

contract_size = (session.my_position(symbol="BTCUSD"))["result"]["size"] print(contract_size)

etc.

Not sure if they have a .result() function like the previous library.