SYSTEM ONLINE
v2.4.1
Developer Reference

API Documentation

WebSocket connections, REST endpoints for market data and analytics, and Groq AI integration routes.

WebSocket Connection

Real-Time Market Data Stream

Live order book updates, trades, and ticker data via persistent WebSocket connection.

WebSocket URL
// Bybit WebSocket - Live Order Book & Trades
wss://stream.bybit.com/v5/public/linear

// Subscribe to BTC order book (depth 50)
{
  "op": "subscribe",
  "args": ["orderbook.50.BTCUSDT"]
}

// Subscribe to live trades
{
  "op": "subscribe", 
  "args": ["publicTrade.BTCUSDT"]
}

Supported streams: orderbook.{1|50|200}.{symbol}, publicTrade.{symbol}, tickers.{symbol}, kline.{interval}.{symbol}

REST Endpoints — Market Data

Market Data & Analytics

Fetch tickers, klines, order books, and historical data via REST API.

GET/v5/market/tickers

Real-time ticker data for all symbols or specific category

?category=linear&symbol=BTCUSDT
GET/v5/market/kline

Historical kline/candlestick data with configurable intervals

?category=linear&symbol=BTCUSDT&interval=15&limit=200
GET/v5/market/orderbook

Order book depth snapshot (1, 50, 200 levels)

?category=linear&symbol=BTCUSDT&limit=50
GET/v5/market/recent-trade

Recent public trades for a symbol

?category=linear&symbol=BTCUSDT&limit=50
GET/v5/market/funding/history

Historical funding rate data

?category=linear&symbol=BTCUSDT&limit=100
Base URL
// Bybit REST API Base
https://api.bybit.com

// Example: Fetch BTC ticker
fetch('https://api.bybit.com/v5/market/tickers?category=linear&symbol=BTCUSDT')
  .then(res => res.json())
  .then(data => console.log(data.result.list[0]))

Groq AI Integration

AI-Powered Market Analysis

Natural language queries for market insights, powered by Groq LLM inference.

/api/ai/chat — Groq Integration
// POST /api/ai/chat
// Headers: Content-Type: application/json

// Request body
{
  "messages": [
    { "role": "user", "content": "Analyze BTC funding rates and suggest entry points" }
  ],
  "context": "trading" // Options: trading, technical, sentiment, general
}

// Response (streaming)
{
  "id": "chatcmpl-xxx",
  "choices": [{
    "delta": { "content": "Based on current funding rates..." },
    "finish_reason": null
  }]
}
context: "trading"

Position sizing, risk management, entry/exit analysis

context: "technical"

Chart patterns, indicators, support/resistance levels

context: "sentiment"

Market sentiment, social signals, news analysis

context: "general"

Crypto education, terminology, market mechanics

Integration Summary

8 API Integrations

Bybit, CoinGecko, TradingView, Groq, CoinCap, CryptoCompare, Fear & Greed, News API

Real-Time Data

WebSocket streams for order book, trades, tickers with <100ms latency

6 AI Contexts

Trading, technical, sentiment, general, portfolio, risk analysis modes