investpy icon indicating copy to clipboard operation
investpy copied to clipboard

tickers exist on website but impossible to find with api

Open BWF88 opened this issue 3 years ago • 3 comments

Hi, thanks for this great tool. I was looking around in the HK equity market and noticed that some tickers are recognized on the website but can't download the historical data using the api . For example, LI Auto Inc's ticker is 2015 and it is recognized on the investing.com website. But when I try to download the data with the api using python, I get the following error message: ERR#0018: stock 2015 not found, check if it is correct.

I'm not sure if this is due to a formatting problem or if it's more complex, but maybe other people would have similar issues so decided to raise a ticket.

BWF88 avatar Mar 03 '22 12:03 BWF88

Same here; this thread might help [((https://stackoverflow.com/questions/65323421/python-investpy-package-to-get-data-of-nifty50-index-get-stock-historical-dat))]

You can do a searching by the country using their api

OGsiji avatar Mar 08 '22 12:03 OGsiji

OGsiji avatar Mar 08 '22 12:03 OGsiji

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

In your case you could do:

from tessa import search, price_history
r = search("2015")
print(r["investing_searchobj_perfect"])
prices, currency = price_history(r["investing_searchobj_perfect"][1], "searchobj")

ymyke avatar Apr 30 '22 08:04 ymyke