alvarobartt / investpy

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

Indices futures not exist #245

Open pythagorea1 opened 3 years ago

pythagorea1 commented 3 years ago

Hello,

Thank you for creating a wonderful api, however I can't find indices futures.

I would appreciate it if you could tell me where indices futures is.

macedd commented 3 years ago

For futures usage you'll have to search and use the API to retrieve data from the SearchObject.

search_results = investpy.search_quotes(text='DOL',
                                        products=['fxfutures'],
                                        countries=['brazil'],
                                        n_results=20)
for search_object in search_results:
     print(search_object)
     search_object.retrieve_information()
     print(search_object.info)
     df = search_object.retrieve_historical_data(from_date='01/01/2019', to_date='01/01/2020')
     print(df.head())

Currently the package does not contain a list of fxfutures. By the way that would be super helpful to have.

alvarobartt commented 3 years ago

HI both @pythagorea1 and @thiagof! 👍🏻

Yes, as Thiago mentions currently the Index Futures feature is not included, but it will, as a lot of you are requesting it! Also, the sample code Thiago is sharing with you seems to solve the issue, as the investpy.search_quotes function is using Investing.com Search Engine.

More information available at: https://github.com/alvarobartt/investpy/wiki/investpy.search_quotes()