get_quotes does not work for options #197
Replies: 1 comment
-
Well after building my own option parser I found the symbol tag in there. Turns out all you have to do is format it a little differently. Why TD has TOS and the API be slightly diff is beyond me. Sample SPY_071221P435. If you give this to TDSession.get_quotes it just works. It is way easier then to just create the correct text string vs having to parse the json. I guess no one knew this. Anyways hope it helps someone. If you do want to parse check out this article https://medium.com/analytics-vidhya/an-introduction-to-the-td-ameritrade-api-in-python-8c9d462e966c base_url = 'https://api.tdameritrade.com/v1/marketdata/chains?&symbol={stock_ticker}\ print (content[dateMap][optionDate + ":" + dte][strikePrice][0]["last"]) |
Beta Was this translation helpful? Give feedback.
-
When using option symbols get_quotes returns {}. Using the symbol works in TOS so not sure why a quote will not come back?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions