API Reference

Base URL: https://tradezone.forex/api  ·  Version: v1.0  ·  Try in Console →

Introduction

All endpoints return JSON. Successful responses have HTTP 200 and include a status: "ok" field. Errors include status: "error" and an error code string.

// Success { "status": "ok", "data": { ... }, "ts": 1712345678 } // Error { "status": "error", "error": "INVALID_MARKET", "message": "Market not found", "ts": 1712345678 }

Authentication

Private endpoints require three headers on every request:

HeaderDescription
X-API-KEYYour API key
X-TIMESTAMPUnix timestamp (seconds). Must be within ±30s of server time.
X-SIGNATUREHMAC-SHA256 signature (see below)

Signature

Concatenate: timestamp + METHOD + /path + body (body empty string for GET). Sign with your API secret using HMAC-SHA256.

# Python import hmac, hashlib, time, requests ts = str(int(time.time())) msg = ts + "GET" + "/api/V1Account/balances" # + "" for GET sig = hmac.new(API_SECRET.encode(), msg.encode(), hashlib.sha256).hexdigest() resp = requests.get(BASE_URL + "/V1Account/balances", headers={ "X-API-KEY": API_KEY, "X-TIMESTAMP": ts, "X-SIGNATURE": sig })
// JavaScript (Node.js) const crypto = require('crypto'); const ts = String(Math.floor(Date.now()/1000)); const msg = ts + 'GET' + '/api/V1Account/balances'; const sig = crypto.createHmac('sha256', API_SECRET).update(msg).digest('hex'); fetch(BASE_URL + '/V1Account/balances', { headers: { 'X-API-KEY': API_KEY, 'X-TIMESTAMP': ts, 'X-SIGNATURE': sig } });

Rate Limits

Rate limit info is returned in response headers:

HeaderMeaning
X-RateLimit-LimitMax requests per minute for your tier
X-RateLimit-RemainingRequests remaining in current window
X-RateLimit-ResetUnix timestamp when window resets
TierLimit
Public (no key)30 req/min per IP
Basic120 req/min
Pro600 req/min
CustomPer-key setting

HTTP 429 is returned when exceeded. Retry after X-RateLimit-Reset.

Error Codes

CodeHTTPMeaning
UNAUTHORIZED401Missing or invalid API key
FORBIDDEN403Permission not granted for this action
INVALID_SIGNATURE401HMAC signature mismatch or timestamp too old
RATE_LIMITED429Rate limit exceeded
INVALID_MARKET400Market not found or disabled
INVALID_PARAMS400Missing or invalid request parameters
INSUFFICIENT_BALANCE400Not enough funds
ORDER_NOT_FOUND404Order does not exist or belongs to another user
WITHDRAWAL_LIMIT400Withdrawal exceeds daily limit or coin min/max
KYC_REQUIRED403KYC verification required for this action

Public Endpoints

No authentication required. Rate limited by IP (30 req/min).

GET /V1Public/time Server time

Returns the current server Unix timestamp. Use to sync your clock before signing requests.

{ "status": "ok", "data": { "ts": 1712345678, "iso": "2025-04-01T12:34:38Z" } }
GET /V1Public/assets List all tradeable assets

Returns all active coins with their withdrawal fees, min/max, and decimal precision.

{ "data": { "btc": { "name": "Bitcoin", "min_withdraw": 0.0005, "fee": 0.0001, "decimals": 8 }, ... } }
GET /V1Public/markets List all markets

Returns all active trading pairs with fees, precision, and min order size.

{ "data": { "btc_usdt": { "base": "btc", "quote": "usdt", "fee": 0.001, "min_amount": 0.0001 }, ... } }
GET /V1Public/ticker/market/{market} Single market ticker
ParamInTypeDescription
market *pathstringe.g. btc_usdt
{ "data": { "market": "btc_usdt", "last": 65432.10, "bid": 65430.00, "ask": 65435.00, "high": 66000.00, "low": 64800.00, "volume": 123.45, "change_pct": 1.24 } }
GET /V1Public/tickers All market tickers

Returns ticker data for all active markets in a single call. Ideal for dashboard overviews.

GET /V1Public/orderbook/market/{market} Order book
ParamInTypeDescription
market *pathstringMarket pair
depthqueryintegerLevels per side. Default 50, max 200.
{ "data": { "bids": [[65430,0.5],[65420,1.2],...], "asks": [[65435,0.3],[65440,0.8],...] } }
GET /V1Public/trades/market/{market} Recent trades
ParamInTypeDescription
market *pathstringMarket pair
limitqueryintegerMax 200. Default 50.
{ "data": [{ "price": 65432, "amount": 0.1, "side": "buy", "ts": 1712345678 },...] }
GET /V1Public/ohlcv/market/{market} OHLCV candles
ParamInTypeDescription
market *pathstringMarket pair
intervalquerystring1m 5m 15m 30m 1h 4h 1d 1w. Default 1h.
limitqueryintegerMax 1000. Default 200.
startqueryintegerStart Unix timestamp (optional)
endqueryintegerEnd Unix timestamp (optional)
{ "data": [[1712340000,65200,66100,65100,65900,45.3],...] } // Each candle: [timestamp, open, high, low, close, volume]

Account Endpoints

Requires X-API-KEY + X-TIMESTAMP + X-SIGNATURE headers. Permission needed: read (or withdraw for the withdrawal endpoint).
GET /V1Account/profile Account profile read
{ "data": { "uid": 42, "username": "alice", "email": "a***@example.com", "kyc": 2, "plan": "pro" } }
GET /V1Account/balances All coin balances read
{ "data": { "btc": { "available": 0.52, "frozen": 0.05 }, "usdt": { "available": 1200.00, "frozen": 0 } } }
GET /V1Account/depositAddress/coin/{coin} Get deposit address read
ParamInTypeDescription
coin *pathstringe.g. btc, eth, usdt
{ "data": { "coin": "btc", "address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7Divf...", "memo": null } }
GET /V1Account/deposits Deposit history read
ParamInTypeDescription
coinquerystringFilter by coin
pagequeryintegerPage number (default 1)
limitqueryintegerPer page, max 100 (default 20)
GET /V1Account/withdrawals Withdrawal history read
ParamInTypeDescription
coinquerystringFilter by coin
pagequeryintegerPage number
GET /V1Account/transactions All transactions read

Combined ledger — deposits, withdrawals, trades, fees. Sorted by time descending.

ParamInTypeDescription
typequerystringdeposit | withdrawal | trade
pagequeryintegerPage number
POST /V1Account/withdraw Request withdrawal withdraw
Requires withdraw permission. KYC must be verified. Must pass IP whitelist check if configured.
FieldTypeDescription
coin *stringCoin symbol e.g. btc
address *stringDestination address
amount *numberAmount to withdraw
memostringMemo/tag (for XRP, XLM, etc.)
{ "data": { "withdrawal_id": 9182, "coin": "usdt", "amount": 100, "fee": 1, "status": "pending" } }

Trade Endpoints

Requires trade permission.
POST /V1Trade/order Place order trade
FieldTypeDescription
market *stringe.g. btc_usdt
side *stringbuy or sell
type *stringlimit or market
amount *numberQuantity in base coin
pricenumberRequired for limit orders
{ "data": { "order_id": 583921, "market": "btc_usdt", "side": "buy", "type": "limit", "price": 65000, "amount": 0.1, "filled": 0, "status": "open" } }
POST /V1Trade/cancel Cancel order trade
FieldTypeDescription
order_id *integerOrder ID to cancel
market *stringMarket pair
POST /V1Trade/cancelAll Cancel all open orders trade
FieldTypeDescription
marketstringLimit to this market (omit for all)
{ "data": { "cancelled": 4 } }
GET /V1Trade/orders Open orders read
ParamInTypeDescription
marketquerystringFilter by market
pagequeryintegerPage number
GET /V1Trade/history Filled trade history read
ParamInTypeDescription
marketquerystringFilter by market
startqueryintegerUnix start timestamp
endqueryintegerUnix end timestamp
pagequeryintegerPage number

Webhook Endpoints

Requires webhooks permission.
POST /V1Webhook/subscribe Create webhook subscription webhooks
FieldTypeDescription
url *stringHTTPS endpoint to receive events
events *arrayList of event types (see below)
secretstringYour signing secret for HMAC verification

Webhook payloads are signed with HMAC-SHA256 in the X-Webhook-Sig header using your secret.

GET /V1Webhook/subscriptions List subscriptions webhooks

Returns all active webhook subscriptions for the authenticated API key.

POST /V1Webhook/delete Delete subscription webhooks
FieldTypeDescription
id *integerSubscription ID to delete

Event Types

EventTriggered when
order.filledA limit order is fully or partially filled
order.cancelledAn order is cancelled
deposit.confirmedA deposit is confirmed on-chain
withdrawal.sentA withdrawal is broadcast to the network
withdrawal.completedA withdrawal is confirmed
// Webhook payload example (order.filled) POST https://your-server.com/webhook X-Webhook-Sig: sha256=abc123... { "event": "order.filled", "ts": 1712345678, "data": { "order_id": 583921, "market": "btc_usdt", "side": "buy", "price": 65000, "amount": 0.1, "filled": 0.1 } }

Server-Sent Events (SSE)

Real-time streaming via EventSource. No authentication required. Sessions last 60 seconds then send a reconnect event — the client should reconnect automatically (EventSource does this by default).

GET /V1Stream/ticker?market={market} Real-time ticker stream

Emits a ticker event every 2 seconds with current price data.

// Browser const es = new EventSource('https://tradezone.forex/api/V1Stream/ticker?market=btc_usdt'); es.addEventListener('ticker', e => { const t = JSON.parse(e.data); console.log(t.last, t.bid, t.ask, t.change_pct + '%'); }); es.addEventListener('reconnect', () => { es.close(); });
GET /V1Stream/orderbook?market={market} Real-time order book stream
ParamInTypeDescription
market *querystringMarket pair
depthqueryintegerLevels per side (5-50, default 20)
const es = new EventSource('https://tradezone.forex/api/V1Stream/orderbook?market=btc_usdt&depth=10'); es.addEventListener('orderbook', e => { const ob = JSON.parse(e.data); console.log('bids:', ob.bids, 'asks:', ob.asks); });
Try in Console → OpenAPI JSON