Tea
Tea

Reputation: 5

ByBit API: How to get info on all positions?

I cannot use the get_positions() function to get information about all positions. I can only get information about each individual position. How can I get info of all existing positions?

session = HTTP(testnet=False, api_key=API_KEY, api_secret=API_SECRET)
session.get_positions(category="linear")
Error: File "I:\Python\Python312\Lib\site-packages\pybit\_http_manager.py", line 379, in _submit_request
 raise InvalidRequestError(
pybit.exceptions.InvalidRequestError: Missing some parameters that must be filled in, symbol or settleCoin (ErrCode: 10001) (ErrTime: 13:51:04).
Request → GET https://api.bybit.com/v5/position/list: category=linear.

It works if I get the information of each existing position. Ex: session.get_positions(category="linear", symbol="BTCUSDT")

Upvotes: -3

Views: 1995

Answers (1)

Abraham Guzman
Abraham Guzman

Reputation: 1

https://bybit-exchange.github.io/docs/v5/position

You have to specify the symbolr OR the settleCoin (USDT, USDC) :)

Upvotes: 0

Related Questions