How to Connect to Binance Futures Testnet WebSocket? No Official Docs Found

Hi all,

I’m currently using the binance-futures-connector-python SDK and working with the Binance Futures Testnet for development purposes.

I’m able to connect to the REST API for the testnet by setting the base URL to https://testnet.binancefuture.com. However, I’m having trouble finding official documentation or examples for connecting to the WebSocket streams in the testnet environment.

Questions:

  1. What is the correct WebSocket base URL for the Binance Futures Testnet?
  2. Can I use public and user data WebSocket streams (like aggTrade, depth, or user data) on the testnet? If so, how?
  3. Does the binance-futures-connector-python package support WebSocket testnet connections natively? If not, what’s the recommended way to override or configure it?

I tried using wss://stream.binancefuture.com/ws, but would like to confirm if that’s officially supported.

Any clarification or example code would be greatly appreciated!

Thanks in advance :pray:

Hey

  • You can use the base URL wss://stream.binancefuture.com for Futures testnet WebSocket streams, and wss://testnet.binancefuture.com/ws-fapi/v1 for the WebSocket API used in order placement.
  • Yes, public and user data WebSocket streams are supported on the testnet. They work the same way as on mainnet—just make sure to update the base URL and the API Key accordingly.
  • Both testnet and mainnet WebSocket streams are supported. You can check out the following examples for reference:
    binance-futures-connector-python/examples/websocket at main · binance/binance-futures-connector-python · GitHub
    Make sure to specify the appropriate base URL when creating the client. However, WebSocket API is not supported.
1 Like

Thank you so much for the clarification — that really helped me understand the difference between WebSocket Streams and the WebSocket API. Appreciate the detailed guidance! :pray:

I have a follow-up question:

I’m using the binance-futures-connector-python SDK and I noticed it’s hosted under the official-looking GitHub organization: Binance · GitHub. However, when I checked the official Binance API documentation, this SDK isn’t listed under the “official SDKs” section.

So, I’m a bit confused — is this binance-futures-connector-python package officially supported or maintained by Binance? Or is it more of a community-contributed or semi-official tool?

Just want to be sure before I rely on it for something serious.

Thanks again for your help!

Hey,
it is an official Binance project.