WatchCrypto API Docs
REST and WebSocket APIs for market data and alerts. Backend is built on Axum (Rust).
/api/v1/wsAuthorization: Bearer <supabase_jwt>.REST API
/api/v1/exchangesList supported exchanges and their current connection status.
/api/v1/exchange-statusPer-stream connection status for each exchange.
{
"exchange": "binance",
"status": "Connected",
"streams": [
{
"stream": "trades",
"status": "Connected",
"last_connected": 1700000000000,
"last_disconnected": 1699990000000,
"reconnects": 2
}
]
}
/api/v1/klinesFetch historical candlesticks.
Query params:
- exchange (default: binance)
- symbol (default: BTC/USDT)
- interval (default: 1m)
- limit (default: 1000, max: 2000)
- endTime (optional, ms since epoch)
/api/v1/depthOrder book snapshot (top levels).
Query params:
- exchange (default: binance)
- symbol (default: BTC/USDT)
/api/v1/tradesRecent trades for a symbol.
Query params:
- exchange (default: binance)
- symbol (default: BTC/USDT)
- limit (default: 1000, max: 2000)
/api/v1/tickersWatchlist tickers (price, 24h change, high/low, volume).
WebSocket API
Send JSON messages with op and channel to subscribe or unsubscribe.
{
"op": "subscribe",
"channel": "klines",
"exchange": "binance",
"symbol": "BTC/USDT",
"interval": "1m"
}
{
"op": "subscribe",
"channel": "ticker",
"exchange": "*",
"symbol": "*"
}
Supported channels: klines, depth, trades, ticker. Ticker supports wildcard subscription with *.
If the server drops messages, it can send {"type":"resync","missed":N}.
Alerts API
/api/alertsList alerts for the authenticated user.
/api/alertsCreate a new alert.
{
"symbol": "BTC/USDT",
"exchange": "binance",
"condition": "above",
"target_price": 50000
}
/api/alerts/:idUpdate an alert (partial).
{
"enabled": true,
"condition": "below",
"target_price": 42000
}
/api/alerts/:idDelete an alert. Returns 204 No Content on success.
Notifications API
/api/notifications/preferencesGet notification preferences for the authenticated user.
/api/notifications/preferencesUpsert notification preferences.
{
"telegram_chat_id": "123456789",
"telegram_enabled": true,
"email_enabled": false
}
/api/notifications/testSend a test notification (Telegram must be configured).
/api/notifications/telegram/linkGenerate a Telegram linking code.