How to Test My Functions on Binance Testnet?

2022-05-17 09:07

After developing your functions, you can use the Binance Spot Testnet and Futures Testnet to test your use cases for free. The Binance Spot Testnet and Futures Testnet are subject to the TestNet Terms of Use. Please read it carefully before proceeding.

How to test on the Spot Testnet?

1. Log in to the Binance Spot Test Network by clicking [Log In with GitHub].

2. You will be redirected to the GitHub website. Log in with your account or click [Create an account] if you don’t have a GitHub account yet.

3. Click [Authorize binance-exchange] to allow Binance Spot Testnet access.

4. You will be redirected back to the Spot Test Network page. Here you can see your testing API Keys.

  • If you don’t have any API Keys, click [Generate HMAC_SHA256 Key] and follow the instructions.
  • Please keep your Secret Key secure as it will not be shown again. Do not share this key with anyone. If you forget your Secret Key, you must click [Revoke] to delete the API and generate a new one.

5. Follow the official Spot API Key documentation to replace the API endpoint URLs with the following values:

Spot API URL

Spot Test Network URL

https://api.binance.com/apihttps://testnet.binance.vision/api
wss://stream.binance.com:9443/wswss://testnet.binance.vision/ws
wss://stream.binance.com:9443/streamwss://testnet.binance.vision/stream

6. You can now start testing on the Binance Spot Test Network.

  • All users registered on the Spot Test Network will automatically receive a balance in different assets.
  • Please note that these are not real assets and can only be used on the Spot Test Network. They cannot be transferred in or out of the Spot Test Network.
  • The Spot Test Network resets periodically, including all open and executed orders. After the reset, your asset balance will be automatically refreshed. Please note that we normally reset the Testnet Network once per month without prior notice.

How to test on the Futures Testnet?

1. Log in to your Binance Futures Testnet account. If you don’t have a testnet account, click [Create].

2. Scroll down and click [API Key] and you will see the API Key and Secret Key. Please keep your Secret Key securely as it will not be shown again. Do not share this key with anyone. If you forget your Secret Key, you will need to delete the API and create a new one.

3. Click the link next to [API Docs] to access the official Futures API Key documentation. Follow the documentation to replace the API endpoint URLs.

4. You can now start testing on the Binance Futures Test Network.

For more information regarding API tutorials, please refer to: