Search code examples
pythoncryptocurrencyyfinance

How to get all cryptocurrencies pairs with yfinance in Python?


I'm exploring the yfinance module in Python following this article. As you can see, the author explains using BTC-USD pair but I want to know if there's some alternative to pull all cryptocurrencies pairs. Somebody asked same question before but I think answer was not appropriate. Would you suggest to do some kind of web scraping? Thanks in advance for any orientation, I've been a lot away from Python and I feel like I'm new again.


Solution

  • # Using coinbase pro
    # !pip3 install cbpro 
    import cbpro
    c = cbpro.PublicClient()
    data_ = pd.DataFrame(c.get_products())
    data_['id']