two questions. #401
-
I have two questions. First. Second. Example code I tried |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @oda9, first of all sorry for answering too late! 😩 I've moved this issue to a Q&A discussion. Regarding your first question, currerntly the static data for cryptos is pretty limited and just the USD conversion is offered, but you can use So import investpy
search_result = investpy.search_quotes(text='BTC JPY', products=['cryptos'], 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') But take into consideration that Investing.com offers different exchanges, which means that the first result may not be the information that you are looking for, so lets assume that you want the information provided by the exchange "BTCBOX" not the one provided by "bitFlyer" which is the first entry, then you could for example use the following piece of code: import investpy
search_results = investpy.search_quotes(text='BTC JPY', products=['cryptos'])
for search_result in search_results:
if search_result.exchange == 'BTCBOX':
print('BTC/JPY from BTCBOX available at Investing.com!')
break
recent_data = search_result.retrieve_recent_data()
historical_data = search_result.retrieve_historical_data(from_date='01/01/2020', to_date='01/01/2021') Note that Also for more information regarding the search functionality, you should check the documentation at https://investpy.readthedocs.io/_info/usage.html#search-live-data And, regarding your second question, could you please open an issue describing the error that you are running into so that I can fix it before the next release Thanks a lot and hope this was useful to you! 🤗 |
Beta Was this translation helpful? Give feedback.
Hi @oda9, first of all sorry for answering too late! 😩
I've moved this issue to a Q&A discussion.
Regarding your first question, currerntly the static data for cryptos is pretty limited and just the USD conversion is offered, but you can use
investpy.search_quotes()
to search the crypto in the currency that you want, and then retrieve the data.So
investpy.get_crypto_recent_data()
won't work since it just contains the main crypto currencies in USD, but using the following piece of code will work: