Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConnectionError: ERR#0015: error 503, try again later. #440

Open
GunduzYuruyen opened this issue Sep 6, 2021 · 16 comments
Open

ConnectionError: ERR#0015: error 503, try again later. #440

GunduzYuruyen opened this issue Sep 6, 2021 · 16 comments

Comments

@GunduzYuruyen
Copy link

Hi,

I ve tried many different codes to receive historical datas of some of financial instruments but i m taking "ConnectionError: ERR#0015: error 503, try again later." error. Normally i had been using investpy without any error.

Ekran Alıntısı

@davetromp
Copy link
Contributor

I ran above code with investpy 1.0.7 without encountering the error. Please note that investpy "simply" scrapes the data from investing.com. If you do many requests in a short period, then Investing.com might block your IP. Also the 503 error indicates something went wrong on the side of investing.com. It could be they were experiencing some issues and that these are currently resolved. So try again later is a good suggestion.

@GunduzYuruyen
Copy link
Author

I ran above code with investpy 1.0.7 without encountering the error. Please note that investpy "simply" scrapes the data from investing.com. If you do many requests in a short period, then Investing.com might block your IP. Also the 503 error indicates something went wrong on the side of investing.com. It could be they were experiencing some issues and that these are currently resolved. So try again later is a good suggestion.

Thanks for your reply Dave. I m not sendıng so many request so ı mean that cant be reason of this problem.
Pycharm is updated with ıts last versıon, also investpy is updated too.
But still i m taking same error..
As a last option i will delete python also pycharm and setup all them again.
Thank you so much for your reply.

@eyalk5
Copy link

eyalk5 commented Oct 31, 2021

Try with a different ip before..

@Monarca100
Copy link

Good morning. I´ve got the same issue. I´ve changed my internet provider and I´ve got CR-NAT IP protocol. Maybe the problem related to this?. Thank you so much.

@ilyasozdogan
Copy link

I have also the same problem

raise ConnectionError("ERR#0015: error " + str(req.status_code) + ", try again later.")
ConnectionError: ERR#0015: error 503, try again later.

@ilyasozdogan
Copy link

ilyasozdogan commented Dec 19, 2021

1

It'is working on chrome but on pycharm i cant get 200

i have python 3.10 and pycharm 2021.3

@gokerbakir
Copy link

Hi, I have got the same ERR#15: error 503 problem. Is there any exact solution to this problem? Thanks in advance..

@TangentAlpha
Copy link

Can confirm this is a general issue in mainland China.

Sent the following POST request (extracted from stocks.py in the package):

import requests

params = {
    "curr_id": 6408,
    "smlID": "89993585",
    "header": "AAPL Historical Data",
    "st_date": "01/12/2021",
    "end_date": "01/01/2022",
    "interval_sec": "Daily",
    "sort_col": "date",
    "sort_ord": "DESC",
    "action": "historical_data",
}
head = {
    "User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1623.0 Safari/537.36",
    "X-Requested-With": "XMLHttpRequest",
    "Accept": "text/html",
    "Accept-Encoding": "gzip, deflate",
    "Connection": "keep-alive",
}
url = "https://www.investing.com/instruments/HistoricalDataAjax"
req = requests.post(url, headers=head, data=params)
print(req.__dict__)

And here was the response content received (i.e. the access was likely blocked by Investing.com).

Alternatively, the package akshare is usable in mainland China (VPN is not required).

@fearles7810
Copy link

Hi,

I ve tried many different codes to receive historical datas of some of financial instruments but i m taking "ConnectionError: ERR#0015: error 503, try again later." error. Normally i had been using investpy without any error.

Ekran Alıntısı
Hello,
import requests
headers_param = {"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.113 Safari/537.36"}
df = investpy.get_stock_historical_data(stock='AAPL',
country='United States',
from_date='01/01/2010',
to_date='01/01/2020',headers=headers_param)

@Hcevahir34
Copy link

I ran above code with investpy 1.0.7 without encountering the error. Please note that investpy "simply" scrapes the data from investing.com. If you do many requests in a short period, then Investing.com might block your IP. Also the 503 error indicates something went wrong on the side of investing.com. It could be they were experiencing some issues and that these are currently resolved. So try again later is a good suggestion.

Thanks for your reply Dave. I m not sendıng so many request so ı mean that cant be reason of this problem. Pycharm is updated with ıts last versıon, also investpy is updated too. But still i m taking same error.. As a last option i will delete python also pycharm and setup all them again. Thank you so much for your reply.

Merhaba, bahsettiğniz soruna çözüm bulabildiniz mi? Aynı hatayı ben de alıyorum. Python ve Pycharmı silip yeniden yüklememe rağmen çözüm bulamadım. Bir çözüm bulduysanız ve paylaşırsanız sevinirim. Teşekkürler.

@ersaayan
Copy link

Hi,

I ve tried many different codes to receive historical datas of some of financial instruments but i m taking "ConnectionError: ERR#0015: error 503, try again later." error. Normally i had been using investpy without any error.

Ekran Alıntısı

dostum çözebildin mi sorunu

@Hcevahir34
Copy link

Hi,
I ve tried many different codes to receive historical datas of some of financial instruments but i m taking "ConnectionError: ERR#0015: error 503, try again later." error. Normally i had been using investpy without any error.
Ekran Alıntısı

You should change your IP, Turkey is blocked by that service. Try VPN or setup your own VPN on a server not located in Turkey

VPN app solved the problem, thank you!

@Hcevahir34
Copy link

Hi,
I ve tried many different codes to receive historical datas of some of financial instruments but i m taking "ConnectionError: ERR#0015: error 503, try again later." error. Normally i had been using investpy without any error.
Ekran Alıntısı

dostum çözebildin mi sorunu

Evet, VPN uygulaması ile sorun çözüldü.

@ersaayan
Copy link

ersaayan commented Oct 4, 2022

Hi,
I ve tried many different codes to receive historical datas of some of financial instruments but i m taking "ConnectionError: ERR#0015: error 503, try again later." error. Normally i had been using investpy without any error.
Ekran Alıntısı

dostum çözebildin mi sorunu

Evet, VPN uygulaması ile sorun çözüldü.

hangi vpn ile çözdün hotspot shield denedim olmadı.

@Hcevahir34
Copy link

Hcevahir34 commented Oct 4, 2022 via email

@alvarobartt
Copy link
Owner

Hi everyone, so the VPN may temporarily solve the issue but block you after N requests so you’ll end up having the same issue (503 HTTP), so please use investiny instead as currently investpy is not stable due to the latest changes on Investing.com.

Refer to:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests