investpy icon indicating copy to clipboard operation
investpy copied to clipboard

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

Open GunduzYuruyen opened this issue 2 years ago • 16 comments

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ı

GunduzYuruyen avatar Sep 06 '21 20:09 GunduzYuruyen

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.

davetromp avatar Sep 11 '21 18:09 davetromp

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.

GunduzYuruyen avatar Sep 11 '21 18:09 GunduzYuruyen

Try with a different ip before..

eyalk5 avatar Oct 31 '21 12:10 eyalk5

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.

Monarca100 avatar Dec 18 '21 12:12 Monarca100

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 avatar Dec 18 '21 23:12 ilyasozdogan

1

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

i have python 3.10 and pycharm 2021.3

ilyasozdogan avatar Dec 19 '21 11:12 ilyasozdogan

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

gokerbakir avatar Dec 26 '21 20:12 gokerbakir

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).

TangentAlpha avatar Jan 10 '22 07:01 TangentAlpha

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)

fearles7810 avatar Apr 25 '22 19:04 fearles7810

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.

Hcevahir34 avatar Jul 25 '22 21:07 Hcevahir34

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

fatihhguvenn avatar Aug 09 '22 19:08 fatihhguvenn

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

ersaayan avatar Sep 27 '22 16:09 ersaayan

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 avatar Oct 02 '22 20:10 Hcevahir34

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ü.

Hcevahir34 avatar Oct 02 '22 20:10 Hcevahir34

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ı.

ersaayan avatar Oct 04 '22 15:10 ersaayan

Privado VPN adında bir masaüstü uygulamasında aylık 10 GB ücretsiz kullanım hakkı var. Londra üzerinden bağlanarak denersen çalışacaktır.

4 Eki 2022 Sal 18:07 tarihinde Eren Ali Şavk @.***> şunu yazdı:

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. [image: Ekran Alıntısı] https://user-images.githubusercontent.com/90219621/132259850-28d960e0-8388-4199-b18b-f1165ee70590.JPG

dostum çözebildin mi sorunu

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

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

— Reply to this email directly, view it on GitHub https://github.com/alvarobartt/investpy/issues/440#issuecomment-1267153495, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZHLGC4YAEIS2K4YWX3CD3DWBRB4FANCNFSM5DRBYN4Q . You are receiving this because you commented.Message ID: @.***>

Hcevahir34 avatar Oct 04 '22 18:10 Hcevahir34

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:

  • https://github.com/alvarobartt/investpy/discussions/612
  • https://github.com/alvarobartt/investpy/issues/611

alvarobartt avatar Oct 05 '22 06:10 alvarobartt