If you want to write your own apps or scripts to access your 3Commas account via our API interface, you've found the right guide!
The process is incredibly simple; head to the API Settings page, and let's learn how to create an access token.
Also, there is an IP whitelisting feature that lets you fortify your account security even more!
Add an additional layer of security with IP whitelisting
IP whitelisting for a 3Commas API token and IP restriction for an exchange API key are related ideas, but they are not the same thing.
3Commas API token IP whitelisting (this article): used when your app/script sends requests to the 3Commas API. 3Commas will reject requests that do not come from a trusted IP you add here.
Exchange API key IP restriction (on the exchange): used when you connect an exchange API key and trade through 3Commas. In that case, you whitelist 3Commas IP addresses on the exchange side.
Quick rule:
If your code calls 3Commas API, whitelist your server’s public IP in this token.
If you restrict an exchange API key, whitelist 3Commas IPs on the exchange.
IMPORTANT!
System-generated API tokens require IP whitelisting. We do not recommend this type. Prefer Self-generated or RSA tokens (you can still use IP whitelisting if you want extra security).
When restricting an exchange API key by IP (on the exchange): you must whitelist 3Commas IP addresses on the exchange side. You can retrieve the current list via the “Supported exchanges IP whitelist” endpoint.
If you started connecting an exchange and did not finish, the IP list you pulled can become outdated. In that case, generate a fresh list and try again (currently only supported for Binance).
How to create API token with IP whitelisting?
1. Open the page to create new 3Commas API keys and choose the type of the token
In this article, we will use System generated type (which we do not recommend).
To learn more about the recommended and more secure "Self generated" type of token, please head to this article:
2. Name this API access token
3. Add Trusted IPs
Most common confusion: Trusted IPs here are for your app/script IPs that call the 3Commas API. They are not the same as restricting your exchange API key by IP.
It is mandatory to whitelist all the IP addresses which you use your API keys with.
IP address/addresses should be entered only from those machines/servers that will send the requests to 3Commas. If you are not running your own script/app, and you only use bots in the 3Commas interface, you usually do not need to whitelist IPs here.
PLEASE PAY ATTENTION!
You need to enter your "Public" IP address and not your home/private address. You can find the public IP address of your internet connection (if you are running or developing your app with your Home PC/Server) using the free website: https://www.whatsmyip.org
If you are running your app or program from a cloud-based service provider, you will need to refer to their help guides for the Public IP Addresses to whitelist, or contact the service provider's support team to find the addresses to use.
Add as many addresses as you need dividing with a comma. To avoid any possible errors, please enter all IP addresses you might send the requests from.
Also, you can enter the mask if you operate from several servers, clusters, subnets, etc. The maximum is 16 for IPV4 and 128 for IPV6.
4. Enable any permissions needed for your purpose
5. Click Create
It's active if all fields are filled.
6. Enter 2FA code
That's it! Now you have added extra security to your API token and nobody else but you will have access to your trading on 3Commas!







