robinhood-unofficial / pyrh

Python Framework to make trades with the unofficial Robinhood API
https://pyrh.readthedocs.io/en/latest/
MIT License
1.78k stars 603 forks source link

self.endpoint #247

Closed jgansl closed 4 years ago

jgansl commented 4 years ago

robinhood.py module has several references to 'self.endpoint(s)' for which there is not. Problematic in getting options data but found 'self.endpoints_ = """..." in one of the functions as well. Looking at the possible endpoint replacements, I do not have enough information about how this tool works as a whole but when I do, I will update.

jgansl commented 4 years ago

There was a pull requests but the files have completely changed for the fix to be integrated

FergusClare commented 4 years ago

@JesseGansler , I believe the endpoints you're looking for are inside of the Robinhood package in endpoints.py. Robinhood.py imports these. If you're wanting to add additional endpoints for options/crypto, I've had luck simply adding the new endpoint in the endpoints.py file and then creating new functions within Robinhood.py to handle. When a new Robinhood class object is instantiated, it's pulling in all of the endpoints from the other file.

Am I understanding what you're saying correctly? I'm unsure that this is an actual issue as much as an op for you to customize your install to your preference.

jgansl commented 4 years ago

Looks like I was referring to the master branch, for which in the 'get_historicalquotes' function, the first line in that functions is ```self.endpoint = """Fetch historical data for stock.``` and continues to describe the specifications of the function. I have realized that this is not the same branch that is used. So this is not an issue with the working version. Sorry about that.

jgansl commented 4 years ago
~/Documents/inverse/env/lib/python3.7/site-packages/pyrh/robinhood.py in get_option_chainid(self, symbol)
    877 
    878     def get_option_chainid(self, symbol):
--> 879         stock_info = self.get_url(self.endpoints["instruments"] + "?symbol=" + symbol)
    880         stock_id = stock_info["results"][0]["id"]
    881         params = {}

AttributeError: 'Robinhood' object has no attribute 'endpoints'
stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 4 years ago

Closing this issue automatically because it has not had any activity since it has been marked as stale. If you think it is still relevant and should be addressed, feel free to open a new one.