Integrations
API Reference
TradeClaw exposes a REST API with 42 endpoints. All endpoints return JSON. An OpenAPI 3.0 spec is available at /api/openapi.
Base URL
https://your-instance.com/apiAll endpoints are relative to your deployment URL. Set NEXT_PUBLIC_BASE_URL in your environment.
Authentication
Public endpoints (signals, prices, health) require no authentication. Tier-gated endpoints check the Authorization header or a session cookie set by the Stripe checkout flow.
curl https://your-instance.com/api/signals \
-H "Authorization: Bearer YOUR_API_KEY"Signals
/api/signalsList trading signals with optional filtering.
symboltimeframedirectionminConfidencelimit/api/signals/historyHistorical signal archive with export support (CSV/JSON).
symbolfromtoformat/api/signals/multi-tfMulti-timeframe consensus — returns M15/H1/H4/D1 alignment for each symbol.
symbolcurl "https://your-instance.com/api/signals?direction=BUY&timeframe=H1&minConfidence=80"
# Response
{
"signals": [
{
"id": "sig_abc123",
"symbol": "XAUUSD",
"timeframe": "H1",
"direction": "BUY",
"confidence": 87,
"entryPrice": 2345.50,
"tp1": 2360.00,
"tp2": 2374.50,
"tp3": 2389.00,
"sl": 2331.00,
"timestamp": "2026-03-27T12:00:00Z",
"status": "active"
}
],
"total": 1
}Prices
/api/pricesFetch current prices. Crypto from CoinGecko, Forex/Metals from Stooq.
symbols/api/prices/streamServer-Sent Events stream. Emits price updates and new signals in real time.
const es = new EventSource('/api/prices/stream');
es.addEventListener('price', (e) => {
const { symbol, price, change } = JSON.parse(e.data);
console.log(`${symbol}: ${price} (${change > 0 ? '+' : ''}${change}%)`);
});
es.addEventListener('signal', (e) => {
const signal = JSON.parse(e.data);
console.log('New signal:', signal.symbol, signal.direction, signal.confidence);
});Price Alerts
/api/alertsList all price alerts.
statussymbol/api/alertsCreate a price alert. Triggers a browser notification when price crosses the threshold.
symbol (required)price (required)direction (above|below)note/api/alerts/[id]Get a single alert by ID.
/api/alerts/checkPoll for triggered alerts. Call this to update alert status.
/api/alerts/statsAlert statistics — total, triggered, pending.
Paper Trading
/api/paper-tradingGet portfolio — balance, open positions, history, equity curve.
/api/paper-trading/openOpen a simulated position.
symboldirectionquantitysltp1tp2tp3/api/paper-trading/closeClose a specific position by ID.
positionId/api/paper-trading/close-allClose all open positions.
/api/paper-trading/follow-signalAuto-open a position from a signal.
signalIdquantity/api/paper-trading/resetReset portfolio to $10,000 starting balance.
/api/paper-trading/statsP&L stats — win rate, Sharpe ratio, max drawdown, profit factor.
curl -X POST https://your-instance.com/api/paper-trading/open \
-H "Content-Type: application/json" \
-d '{
"symbol": "BTCUSD",
"direction": "BUY",
"quantity": 500,
"sl": 65000,
"tp1": 70000,
"tp2": 75000,
"tp3": 80000
}'Screener
/api/screenerMarket screener with composite TA filters.
minRSImaxRSImacdSignalemaTrendminVolatilityminConfidenceWebhooks
/api/webhooksList all webhooks (secrets redacted).
/api/webhooksCreate a webhook.
url (required)namesecret/api/webhooksUpdate webhook URL, name, or enabled state.
idurlnameenabled/api/webhooksDelete a webhook.
id/api/webhooks/[id]/testSend a test payload to the webhook.
/api/webhooks/[id]/deliveriesView delivery history for a webhook.
/api/webhooks/deliverManually trigger a delivery.
idpayload/api/webhooks/dispatchBroadcast a payload to all enabled webhooks.
Plugins
/api/pluginsList all installed plugins.
/api/pluginsInstall a new plugin. Pass indicator metadata and JS code.
namedescriptionversioncategorycodeparams/api/plugins/[id]Get plugin details and code.
/api/plugins/testTest a plugin with dummy OHLCV data.
idTelegram
/api/telegram/webhookTelegram update receiver. Set this as your bot webhook URL.
/api/telegram/sendSend a message to a chat.
chatIdtextparseMode/api/telegram/statusCheck bot connection status and webhook info.
Utility
/api/healthHealth check. Returns status, version, uptime, and Node version.
/api/openapiOpenAPI 3.0 specification in JSON format.
/api/embedGenerate embeddable widget script.
pairthemewidthheight/api/explainAI explanation of a signal's reasoning.
signalId/api/mtfDetailed multi-timeframe analysis for a symbol.
symbol/api/tpslTP/SL calculator using ATR and Fibonacci extensions.
symboldirectionentryPricerisk/api/leaderboardSignal accuracy leaderboard by symbol and timeframe.
Error Format
All errors return a JSON body with an error field.
// 400 Bad Request
{ "error": "symbol is required" }
// 404 Not Found
{ "error": "signal not found" }
// 429 Too Many Requests
{ "error": "rate limit exceeded", "retryAfter": 60 }
// 500 Internal Server Error
{ "error": "internal server error" }