REST API

REST API

Integrate THv2 data into your applications

Authentication

All requests require an X-THV2-Key header. Generate a key below and include it with every request.

curl -H "X-THV2-Key: YOUR_KEY" \
     https://trading-hub.kylifehub.com/api/screener?tickers=AAPL

API Keys

Your API key — generate once, copy immediately. We never store the plaintext.
Key shown once — copy it now. It will not be shown again.
Max 3 keys per day. Keys are tied to your session.
ID Created Last Used Tier Limit/Day
Loading...

Rate Limits

Tier Requests / Day Notes
Free 100 Basic market data
Pro 10,000 Full feature access
Institutional Unlimited Dedicated support included

Screener

GET /api/screener Score and tier for a list of tickers
Query Parameters
tickers  AAPL,MSFT,NVDA   // comma-separated, max 50
Response
{
  "ok": true,
  "data": {
    "results": [
      { "sym": "AAPL", "score": 74, "tier": "Buy", "asOf": "2026-06-05" },
      { "sym": "MSFT", "score": 68, "tier": "Hold", "asOf": "2026-06-05" }
    ]
  }
}
cURL
curl -H "X-THV2-Key: YOUR_KEY" \
     "https://trading-hub.kylifehub.com/api/screener?tickers=AAPL,MSFT"
JavaScript
const res = await fetch('/api/screener?tickers=AAPL,MSFT', {
  headers: { 'X-THV2-Key': YOUR_KEY }
});
const { data } = await res.json();

Daily Edge

GET /api/daily-edge Today's top signals
Response
{
  "ok": true,
  "data": {
    "signals": [
      { "sym": "NVDA", "score": 88, "tier": "Strong Buy", "edge": "momentum+iv" }
    ],
    "asOf": "2026-06-05"
  }
}
cURL
curl -H "X-THV2-Key: YOUR_KEY" \
     https://trading-hub.kylifehub.com/api/daily-edge

Score Batch

GET /api/score-batch Batch composite scores
Query Parameters
tickers  SPY,QQQ   // comma-separated
Response
{
  "ok": true,
  "data": {
    "scores": {
      "SPY": { "score": 61, "tier": "Hold" },
      "QQQ": { "score": 70, "tier": "Buy" }
    }
  }
}
cURL
curl -H "X-THV2-Key: YOUR_KEY" \
     "https://trading-hub.kylifehub.com/api/score-batch?tickers=SPY,QQQ"

Chart Data

GET /api/chart-data OHLCV price history
Query Parameters
sym     AAPL   // ticker symbol
period  1M     // 1D | 1W | 1M | 3M | 6M | 1Y
Response
{
  "ok": true,
  "data": {
    "sym": "AAPL",
    "candles": [
      { "t": "2026-05-01", "o": 171.2, "h": 174.5, "l": 170.0, "c": 173.1, "v": 52000000 }
    ]
  }
}
cURL
curl -H "X-THV2-Key: YOUR_KEY" \
     "https://trading-hub.kylifehub.com/api/chart-data?sym=AAPL&period=1M"

Alerts

GET /api/alerts List active alerts + triggered
Response
{
  "ok": true,
  "alerts": [{ "id": 1, "ticker": "AAPL", "condition_type": "score-above", "threshold": 75 }],
  "triggered": [{ "alertId": 1, "ticker": "AAPL", "message": "Score above 75" }]
}
POST /api/alerts Create alert
Request Body
{
  "ticker": "NVDA",
  "condition": { "type": "score-above", "threshold": 80 }
}
DELETE /api/alerts/:id Deactivate alert
cURL
curl -X DELETE -H "X-THV2-Key: YOUR_KEY" \
     https://trading-hub.kylifehub.com/api/alerts/1

Alert Groups

GET /api/alert-engine/groups List multi-condition alert groups
Response
{
  "ok": true,
  "groups": [
    { "id": 1, "name": "Breakout Watch", "conditions": [...], "logic": "AND" }
  ]
}
POST /api/alert-engine/groups Create alert group
Request Body
{
  "name": "Breakout Watch",
  "logic": "AND",
  "conditions": [
    { "type": "score-above", "threshold": 75 },
    { "type": "iv-rank-above", "threshold": 50 }
  ]
}

Paper Trading

GET /api/paper-trading/positions Open simulated positions
Response
{
  "ok": true,
  "positions": [
    { "id": 1, "sym": "AAPL", "qty": 10, "entry": 172.5, "side": "long" }
  ]
}
POST /api/paper-trading/order Simulate an order
Request Body
{
  "sym": "AAPL",
  "side": "buy",
  "qty": 10,
  "type": "market"
}

Webhooks

GET /api/webhooks List active webhooks
Response
{
  "ok": true,
  "data": {
    "webhooks": [
      { "id": 1, "url": "https://hooks.slack.com/...", "type": "slack", "name": "My Slack" }
    ]
  }
}
POST /api/webhooks Register webhook
Request Body
{
  "url":  "https://hooks.slack.com/services/...",
  "type": "slack",
  "name": "My Slack"
}
DELETE /api/webhooks/:id Remove webhook
cURL
curl -X DELETE -H "X-THV2-Key: YOUR_KEY" \
     https://trading-hub.kylifehub.com/api/webhooks/1

Subscription

GET /api/subscription/status Current tier for session
Response
{
  "ok": true,
  "data": {
    "tier":      "pro",
    "status":    "active",
    "expiresAt": "2026-07-05T00:00:00Z"
  }
}

User Preferences

GET /api/user-preferences Get current preferences
Response
{
  "ok": true,
  "data": {
    "prefs": {
      "default_tickers":  ["SPY", "QQQ", "AAPL"],
      "chart_indicators": ["SMA20", "SMA50"],
      "theme":             "dark",
      "density":           "comfortable",
      "currency":          "USD",
      "timezone":          "America/New_York"
    }
  }
}
POST /api/user-preferences Update preferences (partial merge)
Request Body (partial — only include fields to update)
{
  "theme":   "ultra-dark",
  "density": "compact"
}