on-internet
← Community

How to stream trades from Binance web socket API in Node.js?

Stack Overflow ·

I am trying to use the Binance API to get the latest trades on a crypto-currency pair. Here is the endpoint to the API, say for BTC/USDT: wss://stream.binance.com:9443/ws/btcusdt@trade I tested this API on https://www.websocket.org/echo.html, and was successful in getting a continuous stream of new trades. How do I use this API in Node.js to continuously output the trades on the console? Is there any specific library or package you recommend?

Comments

Sign in or sign up to comment and upvote.

No comments yet.