Ask Your Question
4

How can I resolve the AttributeError in the robin_stocks.robinhood.stocks module where the function get_crypto is missing?

asked 2022-02-11 11:00:00 +0000

nofretete gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2021-05-02 05:00:00 +0000

plato gravatar image

It looks like the get_crypto() function is not available in the stocks module of the Robinhood API. Instead, you can use the crypto module to interact with cryptocurrency data.

Here is an example of how to use the crypto module to get information about cryptocurrency:

import robin_stocks as rs

# log in to Robinhood
rs.login()

# get information about Ethereum
eth_info = rs.crypto.get_crypto_info('ETH')

# get the current market price of Ethereum
eth_price = rs.crypto.get_crypto('ETH')['last_trade_price']

# log out of Robinhood
rs.logout()

You can also use other functions in the crypto module, such as get_crypto_currency_pairs() to get a list of cryptocurrency trading pairs available on Robinhood.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-02-11 11:00:00 +0000

Seen: 20 times

Last updated: May 02 '21