The Nexwest API exposes the same state the chain uses. Public reads require no authentication; writes are signed actions sent to the exchange endpoint.
Base URLs
| Environment | REST | WebSocket |
|---|---|---|
| Mainnet | https://api.nexwest.app | wss://api.nexwest.app/ws |
| Testnet | https://api.testnet.nexwest.app | wss://api.testnet.nexwest.app/ws |
All requests use JSON. The Content-Type header must be application/json. Responses are UTF-8 JSON with string-encoded decimal values for prices and sizes.
Two surfaces
| Surface | Method | Auth | Purpose |
|---|---|---|---|
| Info | POST /info | None | Market data, account state, history |
| Exchange | POST /exchange | Signed | Orders, cancels, transfers, leverage |
| WebSocket | wss:// | None for public; signed for user | Real-time streams and posted actions |
Public data needs no key
You can read books, candles, funding, and public account state without an API wallet. A wallet is only required to sign state-changing actions.
First request
curl -s https://api.nexwest.app/info \
-H "Content-Type: application/json" \
-d '{"type":"meta"}'import requests
meta = requests.post(
"https://api.nexwest.app/info",
json={"type": "meta"},
timeout=5,
).json()
print(meta["universe"][0])const meta = await fetch("https://api.nexwest.app/info", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ type: "meta" }),
}).then((response) => response.json());
console.log(meta.universe[0]);Response conventions
- Prices and sizes are strings to preserve precision.
- Timestamps are milliseconds since the Unix epoch.
- Addresses are lowercase hex with a
0xprefix. - Enums are lowercase strings, except HTTP methods and order sides.
- An empty result is
null,[], or{}depending on the endpoint; it is never an error.
Errors
Errors return a non-2xx status and a JSON body:
{
"status": "err",
"response": "Insufficient margin to place order"
}See error codes for the full list and retry guidance.
Versioning
The API is versioned by behavior, not by URL. Breaking changes are announced in the changelog at least 30 days before deployment. Additive fields are not considered breaking.
Rate limits
Limits are applied per address and per IP. The default is 1,200 weight per minute, with heavier endpoints consuming more weight. See rate limits.