Developer API

Integration & Automation Hub

Synchronize conviction scores, telemetry streams, and custom setups directly into your private spreadsheets or analytical dashboards.

1. Secure Local Port Allocations

All Strat Ai modules execute locally on your machine, communicating via native IPC and secure local ports to ensure your strategy setups remain completely private.

8080

Swarm Consensus Feed (WebSocket)

Live BUY/SELL/HOLD conviction scores and momentum states

8081

Session Telemetry Feed (WebSocket)

High-fidelity tick streams and interactive chart coordinates

8082

Secure Journal Export (HTTP JSON)

Local analytics export for automated trading journals

2. Local Feed Specifications

1. Subscribing to Swarm Consensus Signals

WS /ws/consensus

Subscribe to the local Consensus stream (Port 8080) to receive unified market conviction scores calculated by Strat Ai's specialized analytics swarm in real-time.

Code Interface
# Python Script
import websocket
import json

def on_consensus(ws, message):
    data = json.loads(message)
    # Access unified conviction scores and analytical decisions
    print(f"Decision: {data['decision']} | Conviction Score: {data['conviction_score']}/100")
    print(f"Active Regime: {data['regime']} | Supporting Indicators: {data['confluences']}")

ws = websocket.WebSocketApp(
    "ws://127.0.0.1:8080/ws/consensus",
    on_message=on_consensus
)
ws.run_forever()
// Rust Integration
use tokio_tungstenite::connect_async;
use futures_util::StreamExt;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let url = "ws://127.0.0.1:8080/ws/consensus";
    let (mut ws_stream, _) = connect_async(url).await?;
    println!("Swarm consensus stream connected successfully.");

    while let Some(msg) = ws_stream.next().await {
        let msg = msg?;
        if msg.is_text() {
            let report: SwarmReport = serde_json::from_str(msg.to_text()?)?;
            println!("Swarm Conviction Score: {}", report.conviction_score);
        }
    }
    Ok(())
}

2. Automating Your Trading Journal

GET /api/journal

Query your local secure endpoint to fetch setups, trade targets, and statistical performance metrics to automatically log into your private sheets.

Code Interface
# Python Script
import requests

# Fetch compiled daily setups from secure local memory
response = requests.get("http://127.0.0.1:8082/api/journal")
if response.status_code == 200:
    setups = response.json()
    for setup in setups:
        print(f"Instrument: {setup['symbol']} | Limit Entry: {setup['entry']}")
        print(f"Target: {setup['target']} | Stop-Loss: {setup['stop_loss']}")
// Rust Integration
use reqwest;

#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
    // Fetch local secure setups for sheet synchronization
    let response = reqwest::get("http://127.0.0.1:8082/api/journal")
        .await?
        .json::<Vec<TradingSetup>>()
        .await?;

    for setup in response {
        println!("Exporting {} setup - Entry: {}", setup.symbol, setup.entry);
    }
    Ok(())
}