API
Python functions for phBot Crypto
get_bars(exchange, pair, granularity)
get_bars(exchange, pair, granularity)
This function retrieves historical bars for a given pair from an exchange. Granularity is in seconds.
Usage
get_bars(EX_COINBASE, 'BTC-USD', 60)
Returns
None
or a list
containing the historical bars in JSON.
get_dominance()
get_dominance()
This function returns the Bitcoin and Ethereum dominance values from CoinMarketCap. A CMC API key must be configured in the phBot.ini
file.
Usage
get_dominance()
Returns
None
or a dict
containing dominance data from CMC. Data is cached for 2 minutes before being refreshed.
get_fear_greed()
get_fear_greed()
This function returns the crypto fear and greed index from CoinMarketCap.
Usage
get_fear_greed()
Returns
None
or a dict
containing the latest fear/greed index from CMC. Data is cached for 2 minutes before being refreshed.
Last updated