0.0.2 • Published 5 years ago
binance-api-cli v0.0.2
Binance API cli
A simple cli that interact with Binance API
Installation
npm install -g binance-api-cli
install locally
// download the code
npm install
npm install -g ./
Usage
// get server time
binance-cli t
// get exchange infomation
binance-cli i
// get BTCUSDT pair's filters
binance-cli i | jq '.symbols[] | select(.symbol == "BNBUSDT") |.filters'
// get order book
//
// binance-cli book <symbol>
// binance-cli book --limit <limit> <symbol>
binance-cli book bnbusdt
binance-cli book --limit 10 bnbusdt
// get trades
// binance-cli t <symbol>
binance-cli t bnbusdt
// get aggregate Trades List
// binance-cli at <symbol>
binance-cli at bnbusdt
// get aggregate Trades List with parameters
// binance-cli at <symbol>
binance-cli at --limit 10 --startTime 1595937694913 --endTime 1595937794913 bnbusdt
// get klines data
// binance-cli k <symbol> <interval>
binance-cli k bnbusdt 1m
binance-cli k --limit 1 bnbusdt 1m
// get average price
// binance-cli ag <symbol>
binance-cli ag bnbusdt
// get 24hr ticker
// binance-cli ticker --s <symbol>
binance-cli ticker bnbusdt
// get ticker price
// binance-cli price
// binance-cli price --s <symbol>
binance-cli price --s bnbusdt
// get order book ticker
// binance-cli bt
// binance-cli bt --s <symbol>
binance-cli bt --s bnbusdt
// listen to key
//
// binance-cli listen <stream> <stream> <stream>
binance-cli listen bnbusdt@depth bnbusdt@bookTicker
Why Cli
Postman collection is a cool tool that has all endpoints supported. It's always a nice one to test a endpoint. However a cli tool can be a better choice for some user.
- Easy to start. I know you aways work on terminal.
- Not a fan of postman.
- You like cli tool chain, e.g
jq
, command history, etc. - You can even integrate this cli tool into you shell file. Why not.