Metrics API
Read-only endpoints for custom OBS overlays, stream widgets, or websites. Generate a metrics key in the project dashboard.
Base URL
https://latrine-bot-api.official-716.workers.dev
Authentication
Send your project metrics key on every request:
X-Metrics-Key: lb_live_xxxxxxxx
GET /api/v1/projects/:id/metrics
Returns running state, mode, mint, market data, stats counters, and last event.
curl -H "X-Metrics-Key: YOUR_KEY" \
"https://latrine-bot-api.official-716.workers.dev/api/v1/projects/PROJECT_ID/metrics"
GET /api/v1/projects/:id/events
Query param limit (default 50). Public-safe event lines for display.
curl -H "X-Metrics-Key: YOUR_KEY" \
"https://latrine-bot-api.official-716.workers.dev/api/v1/projects/PROJECT_ID/events?limit=20"
Example (browser)
async function poll() {
const res = await fetch(`${API}/api/v1/projects/${PROJECT_ID}/metrics`, {
headers: { "X-Metrics-Key": METRICS_KEY },
});
const data = await res.json();
document.getElementById("status").textContent =
data.lastEvent?.body ?? "Waiting…";
}
setInterval(poll, 5000);
poll();