The Nexwest API lets you trade from your own code: automate your own strategy, run a trading bot, build tools on your account's data or quote as a market maker. You trade the same central limit order book as the terminal, at the same fees, with keys you create and control on the API keys page.
Who it is for
| You are | What the API lets you do |
|---|---|
| A trader automating a strategy | Buy a fixed amount on a schedule, trade a grid inside a range, act on your own signals, or move stops and take-profits around the clock. |
| A bot or tool builder | Build alerts, dashboards and trade journals on your own account, read-only or with trading. |
| A quant team | Research on candles and trades, then run strategies with batch orders and live account streams. |
| A market maker | Quote both sides with post-only orders, batch updates and cancel-all. |
New to trading from code? The trading bot guide builds a complete, small bot in Python, step by step.
What you get
- Every market. 140+ perpetuals: crypto, US stocks and indices, gold, oil and FX, open 24/7 and settled in USDC.
- One shared order book. Orders match by price, then time, against other traders and professional market makers. Nexwest never takes the other side. See A-book vs B-book.
- Full order control. Limit, market, IOC, FOK and post-only orders, reduce-only, hidden size, edits, batches of up to 10 orders, and cancel-all for one market or the whole account.
- Streams. Order books, trades, tickers, mark prices and candles over WebSocket, plus your own fills, positions and balances on an authenticated stream.
- Margin per market. Cross or isolated margin and leverage up to each market's maximum, set over the API.
- The terminal's fees. 0.02% maker and 0.05% taker on perpetuals, with no extra charge for the API. See fees.
How access works
- Your key is an ed25519 key pair. It belongs to your Nexwest trading account, the same account the terminal uses.
- You create it on the API keys page. The pair is made in your browser and registered with one free wallet signature. Nexwest never sees the secret.
- Each request is signed. It carries your account ID, the public key, a timestamp and a signature over the request. The API reference shows every step with Python and TypeScript code.
- Keys cannot move funds. Deposits and withdrawals always need your wallet.
One account, many keys
The terminal and your API keys trade the same account and balance. Open orders and positions created over the API appear in the terminal, and the other way round.
Permissions and limits
| Setting | Options |
|---|---|
| Permissions | Read only: balances, positions, orders and fills. Read & trade: also place, edit and cancel orders and change leverage. |
| Expiry | 30, 90, 180 or 365 days. Create a new key before the old one expires. |
| IP allow list | Optional. Only the listed addresses or ranges can use the key. Recommended for servers. |
| Removal | Remove a key at any time on the API keys page. It stops working at once. |
Rate limits apply per key. A request over a limit gets HTTP 429; wait for the next window before you retry.
| Action | Limit |
|---|---|
| New orders | 10 a second |
| Batch of up to 10 orders | 1 a second; each order also counts as a new order |
| Batch cancel of up to 10 orders | 10 a second |
| Leverage changes | 5 a minute |
| Listing your keys | 10 a minute |
Quick start
- Activate and fund your account. Open the terminal, connect your wallet, activate trading and deposit USDC on Arbitrum One. See the quickstart.
- Create a key. On the API keys page, pick Read only to test or Read & trade to place orders, an expiry and, for a server, its IP addresses. Copy the account ID, API key and secret, or copy them as a
.envfile. - Store the secret safely. Keep it in a secrets manager or environment variables, never in code or chat.
- Make your first calls. Follow the trading bot guide for a complete example, or the API reference for every endpoint.
Automating your own trading
- Start read-only. Create a read-only key first and check that your code reads prices, balances and positions correctly before it can trade.
- Test with small sizes. Each market has a minimum order value, 10 USDC on BTC. Start there and grow only once the bot behaves.
- Cap your risk in code. Set a maximum position size and a maximum loss per day, and stop the bot when it reaches either.
- Prefer limit orders. A resting limit order pays the 0.02% maker fee instead of the 0.05% taker fee, and never fills at a price you did not choose.
- Exit with reduce-only orders, so a closing order can never open a position the other way.
- Run it on a server, not on a laptop that goes to sleep, and add the server's IP address to the key's allow list.
- Keep an eye on it. Your bot's orders and positions show in the Nexwest terminal, where you can cancel or close them by hand at any time.
Good practice for market makers
- Tag every order with your own
client_order_id, unique among your open orders, so you can match fills to quotes. - Use post-only orders for quotes that must add liquidity. They are rejected instead of filling as a taker.
- Batch your updates. Send quote changes as batches of up to 10 orders and cancel in batches too.
- Cancel when you lose your feed. If your market-data or account stream drops, cancel your open orders with the cancel-all call before you quote again.
- Track fills on the account stream. It reports each execution as it happens, so you do not need to poll for order status.
- Contain risk. Isolated margin limits a market's losses to the margin you assign it. Separate strategies with separate keys, and remove keys you no longer use.
- Restrict keys to your servers with an IP allow list, and give each key the shortest expiry that works.
Quoting size every day? Email info@nexwest.co.th about your volume.
Rewards, terms and regions
API trades earn Season 1 points like any other trade. Wash trading, trading between your own accounts and sybil accounts are excluded from rewards.
API access follows the terms of service and risk disclosure. The API is not available in sanctioned regions, and you may not use it to open positions from restricted regions, including the United States and Canada. Perpetual futures are high-risk products, and you can lose your entire deposit.
Related
Frequently asked questions
Does Nexwest have an API?
Yes. Anyone with a Nexwest trading account can trade every perpetual over REST and stream market and account data over WebSocket: traders automating their own strategy, bot builders, quant teams and market makers. It uses the same order book and fees as the terminal.
Do I need to be a professional to use the API?
No. If you can run a short Python script, you can automate a simple strategy, such as buying a fixed amount every hour. Start with a read-only key, trade small sizes, and follow the step-by-step trading bot guide.
How do I get an API key?
Activate your trading account, then open the API keys page. The key pair is made in your browser and registered with one free wallet signature. The secret is shown once.
Can an API key withdraw funds?
No. A key can read your account and, with the read and trade permission, place and cancel orders. Withdrawals always need a signature from your wallet.
What does API trading cost?
The same as the terminal: 0.02% maker and 0.05% taker on perpetuals, plus funding on open positions. There is no extra charge for using the API.
What are the API rate limits?
Limits apply per key. For example, you can send 10 new orders a second and one batch of up to 10 orders a second. A request over the limit gets HTTP 429.