'investpy RuntimeError: ERR#0019: fund not found, check if it is correct

I would like to load stock quotes automatically from the Internet. Preferably by entering the ISIN or WKN. During the search I came across investpy. Investpy obtains data from https://www.investing.com/

import investpy
df = investpy.funds.get_fund_historical_data('AT0000705678', 'austria', '01/01/2020', '01/01/2021', as_json = False, order = 'ascending', interval = 'Daily')

Leads to an error:

RuntimeError: ERR#0019: fund at0000705678 not found, check if it is correct.

But on the website the ISIN is found: https://www.investing.com/funds/at0000705678



Solution 1:[1]

The investpy API doesn't support searching for ISINs. See here: https://investpy.readthedocs.io/_api/funds.html#investpy.funds.get_fund_historical_data

In general, there are many assets that are listed on investing.com but not (yet) accessible via investpy.

I use this approach, using package tessa:

pip install tessa
from tessa import search, price_history
r = search('Erste Wwf Stock Environment Eur R01 T')
prices, currency = price_history(r[0], 'searchobj')
prices, currency = price_history(r['investing_searchobj_perfect'][0], 'searchobj')

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1