Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/binance/binance-websocket-examples
Example code in Nodejs that demonstrate how to subscribe to Binance Websocket server.
https://github.com/binance/binance-websocket-examples
api binance examples orderbook websocket
Last synced: 4 days ago
JSON representation
Example code in Nodejs that demonstrate how to subscribe to Binance Websocket server.
- Host: GitHub
- URL: https://github.com/binance/binance-websocket-examples
- Owner: binance
- License: mit
- Created: 2020-06-29T11:09:24.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-03-19T23:25:48.000Z (9 months ago)
- Last Synced: 2024-12-10T00:35:54.980Z (12 days ago)
- Topics: api, binance, examples, orderbook, websocket
- Language: JavaScript
- Homepage:
- Size: 485 KB
- Stars: 154
- Watchers: 8
- Forks: 52
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Binance Websocket Examples
## Local orderbook (Spot)
```bash
# Cache local orderbook and echo best price
# btcusdt by default
npm run orderbook# or provide the trading pair
SYMBOL=bnbusdt npm run orderbook```
## Spot user data stream
```bash
# get user data steam
APIKEY=xxxxxx npm run user# Get margin account update from websocket
APIKEY=xxxxxx APISECRET=xxxxx npm run margin-user
```## Futures user data stream
```bash
# Get user data steam on production
APIKEY=xxxxxx APISECRET=xxxxx npm run futures-user# On testnet
APIKEY=xxxxxx APISECRET=xxxxx WSS_BASE_URL="wss://stream.binancefuture.com/" HTTP_BASE_URL="https://testnet.binancefuture.com/" npm run futures-user
```## Delivery Futures user data stream
```bash
# Get user data steam - defaults to production
APIKEY=xxxxxx APISECRET=xxxxx npm run delivery-futures-user
```## Combined streams
```bash
# Get multi pairs stream, setting the pairs in src/multi-stream-depth
npm run multi-stream
```## Spot trade stream delay monitoring
```bash
npm run monitor-spot-trade
```## Spot depth stream delay monitoring
```bash
npm run monitor-spot-depth
```## Futures depth stream delay monitoring
```bash
npm run monitor-futures
```## How to setup
```bash
npm install
# run test
npm run test```
## License
MIT