Open angel-mi-alvarez opened 3 years ago
Hi @angel-mi-alvarez, the function investpy.search_funds()
just searches between the indexed funds in the static file funds.csv
which is incomplete and not up to date... But for those financial products that are missing in the static files (which is a known error as Investing.com indexing is not that good which makes scraping really hard) you can use the function investpy.search_quotes()
so as to search for any financial product available at Investing.com! 🤗
Here's a sample piece of code that you can use:
import investpy
search_result = investpy.search_quotes(text='ES0124143001', products=['funds'], countries=['spain'], n_results=1)
print(search_result)
historical = search_result.retrieve_historical_data(from_date='01/01/2020', to_date='01/01/2021')
print(historical.head())
Note: you need to install the latest investpy version which is investpy v1.0.6
, install it using pip install investpy --upgrade
.
Hi Alvaro
the search_funds gives an error when trying to search some existing funds by 'isin' e.g. couple of examples:
ES0124143001
ES0124143019
running this Python code you can reproduce the issue and see the error
search_results = investpy.funds.search_funds(by='isin', value='ES0124143001') search_results.head()
RuntimeError Traceback (most recent call last)