403 when getting historical data

See original GitHub issue

Thanks for building and running this project.

I’m trying to run the sample code from https://pypi.org/project/investpy/:

import investpy

df = investpy.get_stock_historical_data(stock='AAPL',
                                        country='United States',
                                        from_date='01/01/2010',
                                        to_date='01/01/2020')
print(df.head())

and I’m getting a 403:


Traceback (most recent call last):
  File ["Untitled.py", line 5](coderunner://Untitled.py#5:0!), in <module>
    df = investpy.get_stock_historical_data(stock='AAPL',
  File ["/Users/kartick/Library/Python/3.8/lib/python/site-packages/investpy/stocks.py", line 664](coderunner:///Users/kartick/Library/Python/3.8/lib/python/site-packages/investpy/stocks.py#664:0!), in get_stock_historical_data
    raise ConnectionError(
ConnectionError: ERR#0015: error 403, try again later.

I tried five times over 12 hours, so it’s not transient.

Is there another way to make it work? Apologies if it’s a mistake on my side.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

5reactions
alvarobarttcommented, Sep 16, 2022

Hi everyone, please check https://github.com/alvarobartt/investpy/issues/600, I’m currently fixing it, the patch shouldn’t take too long! Hopefully by the end of the day 😄

I’ll post more information at https://twitter.com/alvarobartt/status/1570661023262310402

2reactions
hscho77commented, Sep 19, 2022

File “D:\Anaconda3\lib\site-packages\investpy\currency_crosses.py”, line 674, in get_currency_cross_historical_data raise ConnectionError( ConnectionError: ERR#0015: error 403, try again later.

Hi, alvarobartt

When will you fix “get_currency_cross_historical_data”?

Read more comments on GitHub >

github_iconTop Results From Across the Web

What Is the 403 Forbidden Error and How to Fix It (8 Methods ...
8. Clear Your Web History/Cache ... Your browser's cache and cookies may also cause a 403 error. Cache stores data to make a...
Read more >
Why do I get 403 message when trying to download stock ...
Hi,. I always use [temp, status] = urlread(url) to get data from yahoo. For example here is what I used. ... Last Friday...
Read more >
Response [403] Error on requests.get to get historical data
@mkhushwali, It seems like you have not subscribed to historical data. You can go to developers console and subscribe to the same.
Read more >
403 Forbidden error: What it is and how to fix it - Allconnect.com
Disable your VPN – If you use a VPN and get a 403 status code, try disabling it and reloading the page, as...
Read more >
403 Forbidden - HTTP - MDN Web Docs - Mozilla
The HTTP 403 Forbidden response status code indicates that the server understands the request but refuses to authorize it.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found