tedchou12 / webull

Unofficial APIs for Webull.
MIT License
601 stars 184 forks source link

does anyone know how to trading options of SPX #313

Closed BobLiu20 closed 2 years ago

BobLiu20 commented 2 years ago

I don't konw how to get option Id for SPX option. In my experience, other brokers generally use SPXW as symbol. But seems not working in webull api.

jeevanpillai commented 2 years ago

Here's the tickerId for SPXW

{ "name": "S&P 500", "symbol": "SPX", "tickerId": 913354362 }

You can get the list of SPXW options using the following Python code:

url = "https://quotes-gw.webullfintech.com/api/quote/option/strategy/list" payload = {"tickerId":913354362,"count":-1,"direction":"all","expireCycle":[3,2,4],"type":0,"quoteMultiplier":100} data = r.post(url=url, json=payload, headers=req_hdrs).json()

Here's the full list as of 30 June, 2022 along with a Python script to regenerate it. Link to GitHub Gist