Way to get the current price / volume for each coin?

See original GitHub issue

I want to be able to get the current price & volume for each coin, once per minute. I’m using the binance.prices(function(ticker) { to get back the current prices. I can then feed that into something like binance.websockets.candlesticks(['IOTABTC'], "1d", function(candlesticks) {, and I’ll get back all of the information I need.

But is there a way for me to disconnect from that websocket after that? In my code I’ve already stored the price to a database, and a minute later I’ll call the same endpoint to repeat the process. But I don’t want to kick off a new websocket every minute - I just want to close one after I get the info. from it.

It would be better if there was a non-websocket API to get the price/volume, but I don’t see it.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
napindccommented, Dec 6, 2017

“But a better way of doing what you want (once per minute) would be using the non-websocket chart call”

I would have to do this one per minute for all ~175 trading pairs though. I’m pretty sure my server would be slowed down by Binance or banned from using their API if I did that.

Perhaps the Binance team could update https://api.binance.com/api/v1/ticker/allPrices to include the 24h volume, in addition to the last price, so it would return:

{ "symbol": "ETHBTC", "price": "0.03796000", "24hVolume" : "123123" },

OR: https://api.binance.com/api/v1/ticker/24hr seems to show both price and volume as well. But for whatever reason - it does not show the coin. If the team could add the coin name to that API, it would solve this.

1reaction
jaggedsoftcommented, Dec 6, 2017

Thank you for your suggestion! I agree we would like 24 hour price statistics for all symbols, so we can easily get daily volume, etc. There is currently no easy way of doing this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Crypto Volume Indicators: How to Use Them? - TradeSanta
To calculate the A/D's value you should know the Money Flow Volume first. The formula is: Money Flow Volume = ((Close – Low)...
Read more >
Understanding Crypto Trading Volume & Its Significance
Learn Crypto explains what crypto trading volume can tell you about price movement & introduces some of the popular volume based technical indicators....
Read more >
On-chain volume vs. Trading volume: Differences explained
Read this guide to determine if a crypto project is good enough to invest in by using on-chain volume vs trading volume —...
Read more >
What Is Volume in Cryptocurrency? Beginner's Guide
Another way to measure volume is to calculate the total dollar value of all trades in a given period.
Read more >
CoinMarketCap: Cryptocurrency Prices, Charts And Market ...
# Name Price 1h % 24h % 7d % Market Cap Volume(24h) Circulating S... 1 Bitcoin $16,527.23 0.03% 0.51% 1.92% $318.10B $15,182,756,483 19,247,318 B... 2...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found