找回密码
 立即注册
搜索
查看: 34|回复: 0

Search code, repositories, users, issues, pull requests... (5)

[复制链接]

8万

主题

-651

回帖

26万

积分

论坛元老

积分
261546
发表于 2025-10-31 08:04:35 | 显示全部楼层 |阅读模式






  


This project is designed to help you make your own projects that interact with the Binance API. You can stream candlestick chart data, market depth, or use other advanced features such as setting stop losses and iceberg orders. This project seeks to have complete API coverage including WebSockets.





Futures API &
Streams •
Spot Trading API &
Streams •
Margin API •
Lending API

Examples •
Troubleshooting •
Changelog •
Support












https://t.me/nodebinanceapi


This project is powered by


Actively maintained, typed, and safe SDK for the Binance REST APIs and Websockets. Supports ESM and CJS out of the box.



Spot, Margin, Futures and Delivery API
Demo trading support
Testnet support (deprecated)
Proxy support (REST and WS)
Customizable HTTP headers
Customizable request parameters
RSA/ECDSA support
Portfolio Margin API *soon*
Websocket handling with automatic reconnection
RecvWindow and automatic timestamps generation
Ability to call any endpoint, even if not supported directly by the library
Overridable hostnames (.us, .jp, etc)
Verbose mode to debug http requests/responses



We highly advise you to update from 0.0.X but minor adjustments might be needed.


The library was fully refactored to use a modern and typed JavaScript/Typescript version, using the built-in await/async syntax and unifying some methods' signatures.
Some important changes include the removal of callbacks as parameters of REST methods, adaptation of signatures to directly receive some important request values (symbol, orderId, ...), among others.





























View Example











In some specific cases using a proxy is required, for example:


Exchange is not available in your location
You need to make a large amount of requests without getting blocked
...


This package supports the following proxy types, ,  and



To set a real http(s) proxy for your scripts, you need to have an access to a remote http or https proxy, so calls will be made directly to the target exchange, tunneled through your proxy server:




This property prepends an url to API requests. It might be useful for simple redirection or bypassing CORS browser restriction.




Tou can also use socks proxy with the following format:














































View Response





View Response





  View Response





View Response





View Response





View Response









View Response





View Response



















View Response












You can use the optional API parameters for getting historical candlesticks, these are useful if you want to import data from earlier back in time.
Optional parameters: limit (max/default 500), startTime, endTime.





This function pulls existing chart data before connecting to the WebSocket, and provides you realtime synchronized chart information including the most recent 500 candles.



View Response









View Response





View Response







View Response























Example Spot account transfer to USDⓈ-M Futures account , use ENUM -> "MAIN_UMFUTURE"



for more account transfers (ENUMs) see docs
















Instead of  use  and instead of  use .


For market orders use  and .


For order operations, use , , , , .


Usage and callbacks are the same as the 'regular account' counterparts.



Use  instead of .



View Response





  View response






  View response





exchangeInfo: Pull minimum order size, quantity, etc

Clamp order quantities to required amounts via minQty, minNotional, stepSize when placing orders

Show API Rate limits

Connect to all WebSockets at once

Get last order for a symbol

newOrderRespType example

Recent Trades (historicalTrades, recentTrades, aggTrades functions)

Terminate WebSocket connections

User Data: Account Balance Updates, Trade Updates, New Orders, Filled Orders, Cancelled Orders via WebSocket
Margin User Data: Account Balance Updates, Trade Updates, New Orders, Filled Orders, Cancelled Orders via WebSocket
Asynchronous Syntax Options




Verify that your system time is correct. If you have any suggestions don't hesitate to file an issue.


Having problems? Try adding  to your options or setting :



Problems getting your balance? Wrap the entry point of your application in useServerTime:



You can enable verbose mode to help with debugging WebSocket streams:












Give us a star ⭐
Fork and Clone! Awesome
Select existing issues or create a new issue and give us a PR with your bugfix or improvement after. We love it ❤️





您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|usdt交易

GMT+8, 2025-12-1 02:40 , Processed in 0.118620 second(s), 20 queries .

Powered by usdt cosino! X3.5

© 2001-2025 Bitcoin Casino

快速回复 返回顶部 返回列表