Skip to main content
Developer Portal • REST + WebSocket • Live Sandbox

TradePro API Market Data, Trading, Portfolio, AI

Build institutional-grade trading experiences with ultra-low latency endpoints, real-time feeds, and fintech-grade observability.

Quick Start
Fetch a quote snapshot in seconds.
Get API Key
cURL
curl -s 'http://localhost:4321/api/v1/market/quote?symbol=AAPL' \
  -H 'Authorization: Bearer <API_KEY>'
API Stats
Built for scale, tuned for traders.
Status
P50 Latency
18ms
Global edge routing
Uptime
99.99%
Multi-region failover
Rate Limit
600 rpm
Per API key
Coverage
Stocks + Crypto
Forex + AI

API Overview

TradePro API provides market data, portfolio analytics, and trading workflows. This template ships with a local sandbox so you can preview requests and responses instantly.

Auth
Bearer API Key
Header-based
Format
JSON
Consistent envelopes
Versioning
/v1
Explicit path version

Authentication System

Use a Bearer API key in the Authorization header. For production deployments, issue keys server-side and scope them per workspace.

Required Header
Authorization: Bearer <API_KEY>

API Key Management

This UI simulates API keys locally. Keys are stored in your browser storage to power the live sandbox.

Active Key
Production keys should be scoped and rotated. Do not ship secrets in the frontend.
Scopes
Market Data
Portfolio
Trading
AI Signals
Sandbox responses are mocked, but wired through real Astro API routes so you can test the end-to-end experience.

REST API Documentation

REST endpoints are grouped by product surface: market data, asset coverage, portfolio, trading, and AI.

WebSocket API Documentation

For real-time feeds, use WebSocket streaming for trades, quotes, and order updates. This template focuses on documentation and uses REST sandbox for live previews.

Connection
wss://api.tradepro.com/v1/ws

subscribe:
{
  "op": "subscribe",
  "channel": "quotes",
  "symbol": "AAPL"
}

Endpoints

Interactive endpoint cards with live previews.

Market Data

3 endpoints
GET Public /api/v1/status

Platform Status

Health check for edge + core API services.

Request
curl -s /api/v1/status
Response
{
  "ok": true,
  "status": "operational",
  "region": "ap-southeast",
  "version": "2026.05",
  "time": "2026-05-24T00:00:00.000Z"
}
GET API Key /api/v1/market/quote

Quote Snapshot

Latest price snapshot for a symbol across supported venues.

symbol
string • required
Ticker symbol, e.g. AAPL, TSLA, BTC-USD.
Request
curl -s '/api/v1/market/quote?symbol=AAPL' -H 'Authorization: Bearer <API_KEY>'
Response
{
  "symbol": "AAPL",
  "price": 178.23,
  "change": 2.45,
  "changePercent": 1.39,
  "currency": "USD",
  "asOf": "2026-05-24T00:00:00.000Z"
}
GET API Key /api/v1/market/candles

Candles

OHLCV candle series for charting and backtests.

symbol
string • required
Ticker symbol, e.g. AAPL.
interval
string • required
1m | 5m | 15m | 1h | 1d.
limit
number
Number of candles (default 200).
Request
curl -s '/api/v1/market/candles?symbol=AAPL&interval=1d&limit=30' -H 'Authorization: Bearer <API_KEY>'
Response
{
  "symbol": "AAPL",
  "interval": "1d",
  "candles": [
    {
      "t": "2026-05-20",
      "o": 175.1,
      "h": 179.2,
      "l": 174.7,
      "c": 178.23,
      "v": 52300000
    }
  ]
}

Stocks

1 endpoints
GET API Key /api/v1/stocks/profile

Stock Profile

Company profile, listing, and fundamental metadata.

symbol
string • required
Ticker symbol, e.g. AAPL.
Request
curl -s '/api/v1/stocks/profile?symbol=AAPL' -H 'Authorization: Bearer <API_KEY>'
Response
{
  "symbol": "AAPL",
  "name": "Apple Inc.",
  "exchange": "NASDAQ",
  "sector": "Technology",
  "website": "https://www.apple.com"
}

Crypto

1 endpoints
GET API Key /api/v1/crypto/price

Crypto Price

Real-time spot price for crypto pairs.

pair
string • required
Pair like BTC-USD, ETH-USD.
Request
curl -s '/api/v1/crypto/price?pair=BTC-USD' -H 'Authorization: Bearer <API_KEY>'
Response
{
  "pair": "BTC-USD",
  "price": 67234.5,
  "changePercent": 1.87,
  "asOf": "2026-05-24T00:00:00.000Z"
}

Forex

1 endpoints
GET API Key /api/v1/forex/rates

FX Rates

Mid-market FX rates with institutional rounding.

base
string • required
Base currency, e.g. USD.
quote
string • required
Quote currency, e.g. IDR.
Request
curl -s '/api/v1/forex/rates?base=USD&quote=IDR' -H 'Authorization: Bearer <API_KEY>'
Response
{
  "pair": "USD-IDR",
  "rate": 16325.25,
  "asOf": "2026-05-24T00:00:00.000Z"
}

Portfolio

1 endpoints
GET API Key /api/v1/portfolio/summary

Portfolio Summary

Aggregated portfolio metrics and risk summary.

Request
curl -s '/api/v1/portfolio/summary' -H 'Authorization: Bearer <API_KEY>'
Response
{
  "equity": 25432.12,
  "pnlToday": 123.56,
  "pnlTodayPercent": 0.49,
  "beta": 1.08,
  "var95": 812.4,
  "currency": "USD"
}

Trading

1 endpoints
POST API Key /api/v1/trading/order

Place Order

Create a market/limit order with idempotency support.

Request
curl -s '/api/v1/trading/order' -X POST -H 'Content-Type: application/json' -H 'Authorization: Bearer <API_KEY>' -d '{"symbol":"AAPL","side":"buy","type":"market","qty":1}'
Response
{
  "orderId": "ord_01J2R3T4V5W6X7Y8Z9",
  "status": "accepted",
  "symbol": "AAPL",
  "side": "buy",
  "qty": 1,
  "receivedAt": "2026-05-24T00:00:00.000Z"
}

AI Analysis

1 endpoints
GET API Key /api/v1/ai/sentiment

AI Sentiment

Low-latency market sentiment score + explanation.

symbol
string • required
Ticker symbol, e.g. AAPL.
Request
curl -s '/api/v1/ai/sentiment?symbol=AAPL' -H 'Authorization: Bearer <API_KEY>'
Response
{
  "symbol": "AAPL",
  "score": 0.73,
  "label": "bullish",
  "model": "tradepro-sentiment-2026",
  "asOf": "2026-05-24T00:00:00.000Z"
}

Error Handling Examples

Errors use predictable shapes for easy logging and retries.

401 Unauthorized
{
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Missing or invalid API key"
  }
}
429 Rate Limited
{
  "error": {
    "code": "RATE_LIMITED",
    "message": "Too many requests",
    "retryAfterMs": 1200
  }
}

Rate Limit Information

Limits are per key, per region, with burst tolerance. Use caching for market snapshots.

Standard
600 rpm
Burst
1200 rpm
WebSocket
200 subs

SDK & Integration Examples

Use fetch-based clients or wrap the API in an SDK. These snippets match the live sandbox endpoints.

TypeScript Client
export class TradeProClient {
  constructor(private apiKey: string, private baseUrl = 'http://localhost:4321') {}

  async quote(symbol: string) {
    const url = new URL('/api/v1/market/quote', this.baseUrl);
    url.searchParams.set('symbol', symbol);
    const res = await fetch(url, { headers: { Authorization: 'Bearer ' + this.apiKey } });
    if (!res.ok) throw await res.json();
    return res.json();
  }
}
Python Requests
import requests

def quote(api_key: str, symbol: str):
  r = requests.get(
    'http://localhost:4321/api/v1/market/quote',
    params={'symbol': symbol},
    headers={'Authorization': 'Bearer ' + api_key}
  )
  r.raise_for_status()
  return r.json()

API Status

Live status uses the sandbox endpoint /api/v1/status.

Health
{
  "loading": true
}

Changelog

2026.05
Initial sandbox API
Added REST endpoints, live preview, and key management UI.

FAQ

Is this a real trading API?
This template includes a local sandbox API to demonstrate docs and developer experience. Replace with your backend for production.
Can I deploy this on Vercel?
Yes. With Astro hybrid output + Vercel adapter, both pages and API routes deploy cleanly.

API Pricing

Example packaging that feels like a real fintech platform.

Starter
$0
Sandbox + docs
Market snapshots
Community support
Basic rate limits
Pro
$99
Per month
Real-time feeds
Portfolio + trading
Priority support
Enterprise
Custom
SLA + compliance
Dedicated regions
Audit logs
Custom contracts