Closed ajit1310 closed 2 years ago
Hi @ajit1310, thanks for reporting it, let me check!
Soooo I've tried the following piece of code and it worked! :weary: So could you please provide me more information so as to be able to reproduce the exact same error that you ran into? Thanks!
import investpy
data = investpy.get_stock_historical_data(
stock='aapl',
country='united states',
from_date='01/01/2020',
to_date='01/01/2021'
)
I am getting the same error...
Exception has occurred: ConnectionError (note: full exception trace is shown but execution is paused at:
I also get the error running the previously example code with AAPL.
In the web I found that #429 stands for "Too Many Requests", which is a bit odd in my case since I haven't used investpy quite a while. Could it be that some IP's get blocked by investing in case of 'too many' requests? How much is too much?
Hi @alvarobartt, i'm also having an error, but the code is 503 for me. I tried your example too and it doesn't work for me also.
$ python invest.py
Traceback (most recent call last):
File "invest.py", line 3, in
Mmm so the error code that you provided @ugurilter is something affecting Investing.com as that's directly related to the API of Investing.com (something I cannot handle), so just wait a bit and it should be back working soon 😩 Sorry I cannot help you more!
And I assume that @ajit1310 error was thrown because he/she sent way too many requests to Investing.com, which led to an IP-blacklisting by Investing.com which means that you'll need to wait some time until your IP is released to start sending requests again...
alvarobartt , you seems to be correct , now it working for few stocks . then it throws error .
File "C:\Python38\lib\site-packages\investpy\stocks.py", line 559, in get_stock_historical_data raise ConnectionError("ERR#0015: error " + str(req.status_code) + ", try again later.") ConnectionError: ERR#0015: error 429, try again later.
@ajit1310, maybe you can just include a timeout between the requests so that Investing.com doesn't blacklists your IP 😩
getting same error.
Traceback (most recent call last):
File "C:\Python38\Lib\site-packages\investpy\temp1.py", line 3, in
Process finished with exit code 1
it may be something to do with the headers and params .
Hi, Not sure what this Error is about , can you please look into it .
File "C:\Python38\lib\site-packages\investpy\stocks.py", line 559, in get_stock_historical_data raise ConnectionError("ERR#0015: error " + str(req.status_code) + ", try again later.") ConnectionError: ERR#0015: error 429, try again later.