If you want to do algorithmic trading or manage your Binance account with third-party tools, the first step is creating an API key. An API key is essentially a "pass" that lets external programs execute trading operations on your behalf.
Using the API requires a verified Binance account. Sign up for Binance to get started. API management is easier on the web, but you can also create keys within the Binance app.
What Is an API Key
API (Application Programming Interface) is the interface between programs. A Binance API key consists of two parts: the API Key (public key) and Secret Key (private key). External programs use this key pair to access your Binance account and execute operations.
You can create multiple API keys, each for different purposes — for example, one for a trading bot and another for a monitoring tool.
Application Steps
Log in to the Binance website, click your avatar in the top right, and select "API Management." Enter a label (to help you remember what this API is for, like "Algo Trading"), then click "Create API."
The system will require security verification — email code, SMS code, and Google Authenticator code. After passing all verifications, your API key is created.
Upon creation, the page will display both your API Key and Secret Key. Important reminder: the Secret Key is only shown once at creation. Copy and save it somewhere secure immediately.
Permission Settings
After creating the API key, you need to set permissions. Binance offers several options:
Read Info: Allows viewing account balances, order history, etc. Spot Trading: Allows executing spot buy/sell operations. Futures Trading: Allows futures trading operations. Withdrawals: Allows withdrawing from the account to external addresses.
Only enable the permissions you actually need. If your API is only for trading, don't enable withdrawal permissions. Fewer permissions mean lower security risk.
IP Restrictions
This is a crucial security setting. You can set an IP whitelist for each API key — only requests from specified IP addresses will be accepted.
If you're running your algo on your own server, enter the server's IP address. If you're unsure of the IP, you can skip this initially, but be aware of the risk. For long-term API keys, IP restrictions are strongly recommended.
Security Precautions
Never share your API keys with anyone or post them publicly. If you use third-party trading tools, make sure they're trustworthy.
Regularly check API key activity. On the API management page, you can see recent activity for each key. If you notice anything unusual, delete the key immediately.
If you're no longer using an API key, delete it promptly. Don't leave unused keys lying around — they're unnecessary security risks.
Common Uses
Personal algo trading: Write trading programs in Python or other languages to automatically execute strategies via API.
Third-party terminals: Such as TradingView auto-execution, 3Commas, and similar tools.
Portfolio tracking: Connect CoinGecko, CoinTracker, and similar tools to automatically sync your holdings.
Data analysis: Retrieve historical candlestick data for backtesting and analysis.