API Documentation

RESTful API and WebSocket endpoints for programmatic trading

API Access Restricted

API documentation and keys are available to approved developers only. Submit a request to gain access to our trading API.

REST API

Traditional HTTP endpoints for account management, trading, and data retrieval

WebSocket API

Real-time market data streams and order updates via WebSocket connections

GraphQL API

Flexible query language for complex data requirements and efficient requests

Getting Started with API

Authentication

All API requests require authentication using API keys. You can generate API keys from your account dashboard after your API access is approved.

# Example authentication header
curl -H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
https://api.tradingplatform.com/v1/account

Rate Limits

  • Standard Tier: 100 requests per minute
  • Professional Tier: 500 requests per minute
  • Enterprise Tier: 2000 requests per minute
  • WebSocket Connections: 5 concurrent connections per account

Base URL

https://api.tradingplatform.com/v1

Core Endpoints

Account Information

GET
/account

Retrieve account balance, buying power, and account status

Place Order

POST
/orders

Submit buy or sell orders with various order types and conditions

// Request Body
{
"symbol": "AAPL",
"qty": 100,
"side": "buy",
"type": "limit",
"limit_price": 150.00
}

Get Positions

GET
/positions

List all open positions with current market value and P&L

Market Data

GET
/market-data/{}symbol}

Get real-time quotes, bars, and trade data for specific symbols

Cancel Order

DELETE
/orders/{}order_id}

Cancel a pending order by order ID

WebSocket Streams

Trade Updates

wss://stream.tradingplatform.com/trade-updates

Real-time updates for order fills, cancellations, and rejections

Market Data Stream

wss://stream.tradingplatform.com/market-data

Subscribe to real-time quotes, trades, and bars for multiple symbols

// Example WebSocket subscription
const ws = new WebSocket('wss://stream.tradingplatform.com');
ws.onopen = () => {
ws.send(JSON.stringify({)
action: 'subscribe',
streams: ['trade-updates', 'quotes.AAPL']
}));
}

Response Format

Success Response

{
"status": "success",
"data": {
"order_id": "abc123",
"status": "filled",
"filled_qty": 100
}
}

Error Response

{
"status": "error",
"error": {
"code": "INSUFFICIENT_FUNDS",
"message": "Insufficient buying power"
}
}

API Access Required

Request API access to view full documentation and obtain API keys