API reference

Public read-only endpoints, no auth, no rate limit. CORS open.

BotLab vystavuje veřejné JSON + Prometheus endpointy pro každého kdo chce sledovat live state, postavit alerting, nebo si tahat data do vlastního dashboardu.

📢 Telegram channel = highlights, ne firehose. @botlab_cz channel posti všechny winning trades + ~25% loss eventů (80/20 selection bias). Pro kompletní raw feed bez filtru použij /public/feed nebo /public/feed.csv. Engine kód viditelný na GitHubu.
No auth. Všechny endpointy jsou veřejné. Ale rate-limity neexistujou — buďto se chovej slušně (poll ≤ 1×/30s), nebo přidám rate limit a nezalíbí se ti to.

Endpoints

GEThttps://pnl.botlab.cz/public/api

Aggregated farm summary. Refreshuje se realtime když dashboard service čte underlying SQLite DBs.

Response: JSON

{
  "farm": {
    "realized_total_usd": 3899.73,
    "unrealized_total_usd": 11.28,
    "net_total_usd": 3911.01,
    "open_positions": 66,
    "bots_active": 11,
    "bots_total": 11
  },
  "polymarket_bots": {
    "A": {
      "label": "efficient-7d",
      "realized": 571.0,
      "unrealized": 0.05,
      "wins": 636,
      "losses": 313,
      "win_rate": 67.02,
      "open_positions": 1,
      "status": "active"
    },
    "B": { ... },
    ...
  },
  "memebot_paper": {
    "net_pnl_sol": 6.53,
    "total_trades": 167,
    "win_rate": 71.26,
    "started_at": "2026-04-16T17:52:29+00:00"
  },
  "forexbot_paper": {
    "cum_pnl_pips": 1575.8,
    "closed_count": 91,
    "win_rate": 53.8,
    "active_count": 12
  },
  "meta": {
    "server_ts": "2026-05-02T...",
    "mode": "paper",
    "disclaimer": "Paper-trading data..."
  }
}

GEThttps://pnl.botlab.cz/public/feed?limit=N

Recent close events (last N, default 50, max 500). Každá close trade napříč všemi boty (Polymarket BUY/SELL/TP/SL/SETTLE, Memebot OPEN/CLOSE, Forex SL/flip).

Query params:

paramdefaultdescription
limit50Number of last events (1-500)

Response: JSON

{
  "events": [
    {
      "ts": "2026-05-02T11:00:40.773+00:00",
      "bot": "P",
      "side": "SELL",
      "title": "LoL: Gen.G vs Dplus KIA - Game 1 Winner",
      "outcome": "Gen.G",
      "shares": 2.752,
      "price": 0.944,
      "usdc": 2.598,
      "realized_pnl": 0.638,
      "whale": "0x31864feb"
    },
    ...
  ],
  "count": 50
}

GEThttps://pnl.botlab.cz/public/feed.csv

Stejný feed jako /public/feed ale jako CSV download. Sloupce: ts, bot, side, title, outcome, price, shares, usdc, realized_pnl, whale.

GEThttps://pnl.botlab.cz/public/bot/{letter}

Per-bot trade history (last 100). letter je velké písmeno A, B, E, F, H, I, J, M, O, P, Q, S.

{
  "bot": "P",
  "count": 100,
  "trades": [
    {"timestamp": "...", "side": "BUY", "title": "...", "price": 0.74, "shares": 2.7, "usdc": 2.0, "realized_pnl": 0, "whale": "0x31..."},
    ...
  ]
}

GEThttps://pnl.botlab.cz/public/metrics

Prometheus exposition format. Pro Grafana / VictoriaMetrics / vlastní scrape.

Response: text/plain; version=0.0.4

# HELP botlab_farm_net_usd Total net PnL (USD)
# TYPE botlab_farm_net_usd gauge
botlab_farm_net_usd 3913.86

# HELP botlab_farm_realized_usd Realized PnL (USD)
# TYPE botlab_farm_realized_usd gauge
botlab_farm_realized_usd 3899.73

botlab_open_positions 66
botlab_bots_active 11

# Per-bot labels
botlab_bot_realized_usd{bot="A",label="efficient-7d"} 571.0
botlab_bot_winrate_pct{bot="A",label="efficient-7d"} 67.02
botlab_bot_open_positions{bot="A",label="efficient-7d"} 1
...

botlab_memebot_pnl_sol 6.53
botlab_memebot_winrate_pct 71.26

botlab_forex_pnl_pips 1575.8
botlab_forex_winrate_pct 53.8

Code examples

Python

import urllib.request, json
data = json.loads(urllib.request.urlopen(
    "https://pnl.botlab.cz/public/api"
).read())
print(f"Net: ${data['farm']['net_total_usd']:.2f}")

Bash + curl + jq

curl -s https://pnl.botlab.cz/public/api | jq '.farm.net_total_usd'

Prometheus scrape config

scrape_configs:
  - job_name: 'botlab'
    scrape_interval: 60s
    metrics_path: '/public/metrics'
    scheme: 'https'
    static_configs:
      - targets: ['pnl.botlab.cz']

Other resources

Stability

API je v0 — schema se může změnit. Když přidám/odeberu pole, dozvíš se to v @botlab_cz nebo blog. Stabilní v1 přijde když projekt sám stabilně běží 6+ měsíců.

Pokud něco klepne nebo máš feature request, otevři issue na GitHubu.