alvarobartt / investpy

Financial Data Extraction from Investing.com with Python
https://investpy.readthedocs.io/
MIT License
1.59k stars 374 forks source link

ConnectionError: ERR#0015: error 429, try again later. #544

Open af20 opened 2 years ago

af20 commented 2 years ago

using investpy.get_commodity_historical_data

ymyke commented 2 years ago

I wrote the tessa package to help with issues such as these. See here: https://github.com/alvarobartt/investpy/issues/557

af20 commented 2 years ago

But tessa does not support commodities.

df, currency = pricehistory(query="Crude Oil WTI", type="commodities") ===> ValueError: Unsupported asset type commodities.

How can I do?

ymyke commented 2 years ago

"commodity" was missing as a type. I just published v0.2.0. If you update to that version of tessa, you should be able to do:

from tessa import price_history
df, currency = price_history(query="Crude Oil WTI", type_="commodity")
wajihwajeh commented 2 years ago

How long is the timeout for?

ymyke commented 2 years ago

1 second – it's set here: https://github.com/ymyke/tessa/blob/master/tessa/rate_limiter.py

wajihwajeh commented 2 years ago

I got this error using investpy and now I can't run any search through investpy without receiving that error and I get the same error trying to run it through tessa, however, this is only for currency crosses, I checked with stocks and the search on investpy goes through

ymyke commented 2 years ago

Maybe investing.com has separate rate limiting for each API endpoint. Either wait >24h and try again or use a VPN to change your IP address and then try again and see if the problem still occurs.

wajihwajeh commented 2 years ago

using VPN works thank you

ozgurcelen commented 1 year ago

Evet bu hata ülkenin sınırlamasıyla ilgili. VPN kullandığımız zaman problem ortadan kalkıyor.