tedchou12 / webull

Unofficial APIs for Webull.
MIT License
597 stars 181 forks source link

get_positions for option ticker #303

Closed shalli2 closed 2 years ago

shalli2 commented 2 years ago

How do I get the strike price and expiry for the option ticker in account positions? The current feature seems to return only the underlying symbol.

mrazum commented 2 years ago

shalli2, try this: response = requests.get('https://tradeapi.webullbroker.com/api/trade/v4/home/' + self.account_id , headers=headers) result = response.json() print result['positions2']

shalli2 commented 2 years ago

How to use this request while I use the python version of webull. In other words, what should be the headers and account_id and how to reuse the MFA, secret questions, etc.. that is currently working with python webull in my case.

shalli2, try this: response = requests.get('https://tradeapi.webullbroker.com/api/trade/v4/home/' + self.account_id , headers=headers) result = response.json() print result['positions2']

shalli2 commented 2 years ago

shalli2, try this: response = requests.get('https://tradeapi.webullbroker.com/api/trade/v4/home/' + self.account_id , headers=headers) result = response.json() print result['positions2']

How to use this request while I use the python version of webull. In other words, what should be the headers and account_id and how to reuse the MFA, secret questions, etc.. that is currently working with python webull in my case.

mrazum commented 2 years ago

the same way as you using get_account(). Headers and account_id are the same.

shalli2 commented 2 years ago

the same way as you using get_account(). Headers and account_id are the same.

Thank you so much.. it worked.