Developer Resources

API Documentation

Complete reference for integrating with Shadowstar's trading infrastructure. Direct access to institutional execution rails.

Architecture

Edge Layer

Caddy + Cloudflare enforcing TLS 1.3 and WAF rules.

Execution Core

Async Python engine dispatching orders with <1ms latency.

Observability

Prometheus streams powering mission control dashboards.

Quick Start Protocol

1. Get Your API Key

Sign up and retrieve your API key from the dashboard to authenticate your requests.

curl -X POST https://app.shadowstar.xyz/api/auth/register \
-H "Content-Type: application/json" \
-d '{"email": "you@example.com", "password": "***"}'

2. Connect Broker

Authenticate with your broker using OAuth2 (Tradovate supported).

Navigate to:

Dashboard → Settings → Connect Tradovate

3. Webhook Setup

Add this webhook URL to your TradingView alerts:

https://app.shadowstar.xyz/api/webhook/tradingview

Authentication

All API requests require authentication using your API key in the request body. This ensures secure, authorized access to your execution infrastructure.

Request Structure

POST /api/webhook/tradingviewContent-Type: application/json{
  "api_key": "your_api_key_here",
  "symbol": "NQ",
  "action": "buy",
  "quantity": "1",
  "order_type": "market"
}

TradingView Payload

Use this JSON structure in your TradingView alert message box. Variables in {{...}} are automatically populated by TradingView.

{
  "api_key": "{{YOUR_API_KEY}}",
  "symbol": "{{ticker}}",
  "action": "{{strategy.order.action}}",
  "quantity": "{{strategy.order.contracts}}",
  "order_type": "market"
}

Parameter Reference

api_key
string
required
Your API key from dashboard
symbol
string
required
Trading symbol (e.g., NQ, ES)
action
string
required
"buy" or "sell"
quantity
string
required
Number of contracts
order_type
string
optional
"market" (default) or "limit"

Live P&L Integration Guide

01

Issue API Credentials

Create an account, then open Mission Control → API Key. Copy both key + webhook URL; they authenticate every alert.

02

Connect Tradovate

Dashboard → Settings → Connect Tradovate. OAuth tokens allow the execution engine to post fills in real time.

03

Author Pine Strategy

Emit alerts from TradingView with entry/exit context. Use {{strategy.order.action}} and {{strategy.order.contracts}} placeholders.

04

Post Webhooks

Set TradingView webhook URL to https://api.shadowstar.xyz/api/webhook/tradingview and drop the JSON payload below into the alert message.

05

Verify Before Going Live

POST /api/webhook/tradingview/test with the exact payload. You will get subscription + schema validation without touching the broker.

06

Observe Live P&L

Every routed fill updates Trades, Analytics → Performance, and the public marketing metrics. Monitor Sharpe, win rate, and drawdowns in the dashboard.

TradingView Alert Payload

{ "api_key": "{{YOUR_API_KEY}}", "symbol": "{{ticker}}", "action": "{{strategy.order.action}}", "quantity": "{{strategy.order.contracts}}", "order_type": "market", "alert_id": "{{strategy.order.id}}", "webhook": "live-pnl" }

Every alert becomes a trade record. As soon as the broker confirms a fill, Shadowstar writes the realized P&L back to your account and surfaces it in Analytics, the dashboard StatCards, and the public marketing meter. No spreadsheets, no manual syncing—just keep the alert firing and the system handles attribution.

Response Codes

Code
Status
Description
200
OK
Request successful
400
Bad Request
Invalid parameters
401
Unauthorized
Invalid API key
403
Forbidden
Broker not connected
500
Server Error
Internal server error

Rate Limits

To ensure system stability, the following rate limits apply:

Webhook Endpoint
POST /api/webhook/tradingview
100 req / min
API Endpoints
All other API calls
1000 req / hour

REST Endpoint Reference

MethodRouteDescription
POST/api/auth/tokenObtain JWT access token
GET/api/auth/meRetrieve authenticated user
POST/api/webhook/tradingviewPrimary execution webhook
GET/api/trades/Recent trade history
GET/api/risk/statusCurrent risk posture

Websocket Streams

Subscribe for execution acknowledgements, latency telemetry, and broker heartbeat data.

const socket = new WebSocket('wss://api.shadowstar.xyz/ws/execution')

socket.onopen = () => console.log('connected')

socket.onmessage = (event) => {
  const payload = JSON.parse(event.data)
  // { type: 'fill', trade_id: 1042, latency_ms: 0.83 }
}

Support Protocol

Require Assistance?

Our engineering team is available 24/7 for technical support and integration assistance.

Access Support