bitbns-official / bitbnspy

MIT License
9 stars 6 forks source link

How to get tickers data for the last n hours? #75

Open phaniparsa opened 2 years ago

phaniparsa commented 2 years ago

Hello All,

Is there a way to get tickers data (last traded price) for the last "n" hours? If yes, could someone please post the method to get thsi data?

Also, can we restrict the fetchTickers method to get the data for a specified coin? When I checked the source code, looks like fetchTickers is not accepting any parameters. Is there any other method to retrieve tickers data for a specific coin?

Thanks!

sanket-buyhatke commented 2 years ago

Hi @phaniparsa,

you can explore bitbnsObj.fetchOHLCV('BTC', 'INR', page = 1) to get the price for previous hour close etc, currently the data shared is of 5 min resolution, it can be resampled to suit your needs.

you can just extract the needed info from the fetchTickers function rite ? we do offer an other function getTickerApi('BTC')), where you can get the ticker info for a specific ticker, would suggest using the fetchTickers function, as all the ticker info is passed as 1 object.