Skip to content

Commit c165dcb

Browse files
committed
fixed 401 error on quotes and fundamentals
1 parent 53959e1 commit c165dcb

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Robinhood/Robinhood.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def quote_data(self, stock=''):
230230

231231
#Check for validity of symbol
232232
try:
233-
req = requests.get(url, timeout=15)
233+
req = self.session.get(url, timeout=15)
234234
req.raise_for_status()
235235
data = req.json()
236236
except requests.exceptions.HTTPError:
@@ -255,7 +255,7 @@ def quotes_data(self, stocks):
255255
url = str(endpoints.quotes()) + "?symbols=" + ",".join(stocks)
256256

257257
try:
258-
req = requests.get(url, timeout=15)
258+
req = self.session.get(url, timeout=15)
259259
req.raise_for_status()
260260
data = req.json()
261261
except requests.exceptions.HTTPError:
@@ -681,7 +681,7 @@ def get_fundamentals(self, stock=''):
681681

682682
#Check for validity of symbol
683683
try:
684-
req = requests.get(url, timeout=15)
684+
req = self.session.get(url, timeout=15)
685685
req.raise_for_status()
686686
data = req.json()
687687
except requests.exceptions.HTTPError:

0 commit comments

Comments
 (0)