Closed lucas-leme closed 3 years ago
Hi @lucas-leme, if you check the investpy.search_funds()
documentation you will see that the function just searches between the funds stored in the static file resources/funds.csv
, which means that this function is not searching new funds.
In order to do so, just use the investpy.search_quotes()
function, this is a simple example that may be useful to you:
import investpy
search_result = investpy.search_quotes(text='0P0001I7OT', products=['funds'], n_results=1)
recent_data = search_result.retrieve_recent_data()
historical_data = search_result.retrieve_historical_data(from_date='01/01/2020', to_date='01/01/2021')
information = search_result.retrieve_information()
Let me know whether this worked for you or not! :+1:
More information available at https://github.com/alvarobartt/investpy/wiki/investpy.search_quotes()
:pushpin: Note. In the recent investpy
versions, the investpy.search_quotes()
function just returns one search result whenever the value for n_results
is 1, which means that instead of expecting a list of SearchObj
class instances, you should just expect one, as shown in the example presented above.
Hi @alvarobartt, it worked for me! Thank you very much. I didn't know about the investpy.search_quotes()
module, it will help me a lot.
Hi Alvaro!
It is possible to increase decimal places from 3 to 8? Not sure if Investing.com doesn't record with full precision or if its possible to get the full number.
I was trying to get the historical data of this fund:
https://www.investing.com/funds/br025jctf005
But the investpy does not find it.
inv.search_funds(by='symbol', value='0P0001I7OT')
Error: