Closed AmeliorateOr closed 4 years ago
I check this out but im sure there is a better way to get the expiration date data.
That would be great.
I do agree, I'm sure there is a better way for the expiration date data, but to acquire historical data, this method may the best route. Plus I wanted to let you know it was not working as expected and confirm that it was indeed something with the API and not something I improperly input on my end.
A quick aside, your code is amazing. So clean and readable, I especially enjoyed 'the explicit vs implicit' in your talk about how you chose to write, it really shows and shines. Really great to see the progress and learn from reading. So let me give you the proper thanks that everyone using this should! :)
I'm running into this same issue and trying to troubleshoot.. am having a tough time finding any formal API documentation for Robinhood's private API. Thanks @jmfernandes for all the great work you've put into this
Hi,
I attempted to use the same function for retrieving historical options data but received a similar error message (below). I tried variations of the input variables but received similar messages each time. I see that this issue was closed, was a resolution found?
Getting the option ID failed. Perhaps the expiration date is the wrong format, or the strike price is wrong. 404 Client Error: Not Found for url: https://api.robinhood.com/marketdata/options/historicals/None/?span=week&interval=hour&bounds=regular
My base code below:
import robin_stocks as rs
import os
login = rs.login(os.environ['robinhood_user'],os.environ['robinhood_pass'])
rs.options.get_option_historicals('TSLA', '2020-08-28', '500.0000', 'call')
I haven't tested this out since it was closed, but I'm suspicious this function is only meant to return option historicals for positions that you actively hold. The documentation said it's used to pull data that's "used to make the charts", and the only place the app gives you option historical charts is for positions that you currently hold. Just a thought
Hi,
I attempted to use the same function for retrieving historical options data but received a similar error message (below). I tried variations of the input variables but received similar messages each time. I see that this issue was closed, was a resolution found?
Getting the option ID failed. Perhaps the expiration date is the wrong format, or the strike price is wrong. 404 Client Error: Not Found for url: https://api.robinhood.com/marketdata/options/historicals/None/?span=week&interval=hour&bounds=regular
My base code below:
import robin_stocks as rs import os login = rs.login(os.environ['robinhood_user'],os.environ['robinhood_pass']) rs.options.get_option_historicals('TSLA', '2020-08-28', '500.0000', 'call')
Did you fix your problem ? and if you do - HOW ?
I am trying to use robin_stocks. get_option_historicals to access historical TSLA option prices. Although I am able to access the history for options that have not expired yet, I cannot access data for previously expired options. This may be because the ‘span’ must not include the time after options expiration for the request to be valid.
Is there a way to access the historical time series of options that have already expired? Or, is there a way to adjust the 'span' argument to not include the time points after expiration?
Thank you!
Hey did anyone end up figuring this out? Heres what I know:
@jessie5555
It works for future expiration but not previous ones, unless theres something you can do there.
I had just spent a couple hours trying to figure out what I was doing wrong and it was just this... ughh. Anyone know a good way to get historical data, as in PAST data?
Trying to find an alternative way of getting the expiry day data, I figured I would try to get the historical option data and run through each strike as desired. Unfortunately, I got the following error:
Here is my code:
import robin_stocks as r
username = ""' password = ""
symbol = 'SPY' expirationDate = '2018-12-21' strike = '245.00' optionType = 'call' #I think 'both' or empty '' may yield both, but am unsure. span = 'week'
r.login(username, password)
data = r.options.get_option_historicals(symbol, expirationDate, strike, optionType, span)
print(data)
Something to do with the optionID for this request it seems.