
Short answer: To set up a trading bot on WEEX, create an API key under Account > API Management > Create API Key, give it read and trade permission only (never withdraw), bind it to your server IP, and paste the key, secret and a passphrase into your bot. With Python you can connect in a few lines using ccxt (exchange id “weex”).
Checked on 26 October 2026 against each exchange’s official API documentation (linked in Sources). Exchanges rename menus often; if a label differs, look for “API” in your profile menu.
This guide is part of our hub How to Set Up a Crypto Trading Bot. Before you start, read our WEEX review and compare it on our exchange comparison.
Before you start: prerequisites
- A verified WEEX account with 2FA on.
- A server or computer that will run the bot, ideally with a fixed outbound IP (a small VPS works).
- A separate budget you can afford to lose. Keep long-term holdings elsewhere.
- Python 3.10+ if you use the code below.
How to create a WEEX API key for a trading bot (step by step)
- Create and secure your account. Sign up, finish identity verification (KYC) and turn on 2FA. API trading on most exchanges, and futures API permissions on several, require KYC.
- Open the API page. Account > API Management > Create API Key.
- Name the key. Use a clear label such as “bot-spot-1” so you can revoke it later without guessing.
- Set permissions. New keys are Read Only by default. Add Spot or Futures/Contract trading only if the bot needs it. No withdrawal permission is needed.
- Bind your IP address. WEEX strongly recommends binding an IP address or range. Its broker docs show up to 10 IPs and require an allowlist when any non-read-only permission is on.
- Confirm and save the credentials. You set a passphrase (letters and numbers only, no special characters). It cannot be recovered. Copy the API key and secret into a password manager. The secret is usually shown only once.
- Connect your bot. Store the values as environment variables and load them in your bot (code below). Run a read call first, then one tiny order.
- Test, then scale slowly. Use demo or testnet if available, then a small live budget. Watch logs for a few days before adding funds.
WEEX API settings at a glance
| Passphrase needed | Yes |
|---|---|
| IP whitelist | WEEX strongly recommends binding an IP address or range. Its broker docs show up to 10 IPs and require an allowlist when any non-read-only permission is on. |
| Demo or testnet | WEEX does not document a public API testnet. Start with a small balance. |
| Key limits and rate limits | Up to 10 API key groups per user. New or changed keys can take about 15 minutes to become active everywhere. |
| Spot vs futures | Spot and futures use different hosts (api-spot.weex.com and api-contract.weex.com) and separate permissions. |
| Python ccxt id | weex |
Which permissions to choose
New keys are Read Only by default. Add Spot or Futures/Contract trading only if the bot needs it. No withdrawal permission is needed.
Rule one: a trading bot never needs withdrawal rights. If a bot service asks for withdrawal permission, do not use it.
Use a sub-account for the bot
Use a separate key per bot or strategy so you can revoke one without stopping the others.
Spot or futures
Spot and futures use different hosts (api-spot.weex.com and api-contract.weex.com) and separate permissions.
Start with spot. Futures bots can be liquidated in minutes if a stop fails.
Connect WEEX to a Python bot (ccxt example)
ccxt is an open source library that wraps WEEX and over 100 other exchanges. This minimal script loads keys from environment variables, checks the balance and reads a price.
# 1) store keys as environment variables, never in code or git
export EXCHANGE_API_KEY="..."
export EXCHANGE_API_SECRET="..."
export EXCHANGE_PASSPHRASE="..."
# 2) pip install ccxt
import os, ccxt
ex = ccxt.weex({
"apiKey": os.environ["EXCHANGE_API_KEY"],
"secret": os.environ["EXCHANGE_API_SECRET"],
"password": os.environ["EXCHANGE_PASSPHRASE"], # API passphrase
"enableRateLimit": True,
"options": {"defaultType": "spot"}, # or "swap" for perpetual futures
})
print(ex.fetch_balance()["total"]) # read test
print(ex.fetch_ticker("BTC/USDT")["last"]) # market data
# ex.create_order("BTC/USDT", "limit", "buy", 0.0001, 50000) # tiny test order
Build your own AI trading bot
You do not need a paid bot service. AI assistants such as Grok Bot can write and run the code above, add your strategy rules and log every trade. TradeReviewed hosts independent traders who run AI-built bots on real accounts and publish every trade, wins and losses. Treat any bot, AI or not, as experimental until it has months of logged results.
Security checklist
- Read and trade only. Withdraw off.
- IP whitelist on.
- One key per bot, clear labels.
- Keys in environment variables or a secrets manager, never in git, screenshots or chats.
- Sub-account with only the bot budget.
- Stop-loss logic in the bot and a daily loss limit.
- Review and rotate keys every few months; delete unused keys.
- If a key leaks, delete it on the exchange first, then investigate.
Troubleshooting common API errors
| Error | Fix |
|---|---|
| API restricted | Risk controls can disable API access. WEEX says to contact support to reactivate. |
| New key not working yet | Wait about 15 minutes after creating or editing a key. |
| Passphrase rejected | Use letters and numbers only. |
| Permission error | Enable Spot or Futures/Contract trading on the key. |
| Timestamp or recvWindow errors | Sync your server clock with NTP. |
Fees and EU availability
Bot strategies trade often, so fees matter. See WEEX fees. WEEX is not MiCA licensed. Check our review for availability in your country.
Frequently asked questions
Can I use a trading bot on WEEX?
Yes. WEEX offers an API for automated trading. Create a key with read and trade permission, bind your IP and connect your bot.
Does the WEEX API need a passphrase?
Yes. You set it when creating the key and it cannot be recovered.
Should I enable withdrawal permission on my WEEX API key?
No. A trading bot never needs it. Leave withdraw off.
Does WEEX have a demo or testnet API?
WEEX does not document a public API testnet. Start with a small balance.
Why did my WEEX API key stop working?
WEEX strongly recommends binding an IP address or range. Its broker docs show up to 10 IPs and require an allowlist when any non-read-only permission is on.
Is WEEX supported by ccxt?
Yes, as “weex”.
API bot guides for other exchanges
- BingX API trading bot setup
- OKX API trading bot setup
- Bitget API trading bot setup
- MEXC API trading bot setup
- OrangeX API trading bot setup
- All exchanges: crypto trading bot setup hub
Sources
Not financial advice. Automated trading can lose money fast, especially with leverage. Past results do not guarantee future returns. Never give any bot or third party withdrawal rights, and check the rules in your country before you trade.