API Reference

DraftLoL API

Draft predictions, Polymarket analytics, and a real-time live draft stream. Pay-as-you-go with credits — no subscription. Base URL https://api.draftlol.ai.

Authentication

Every request needs your API key in the X-API-Key header. Get one by buying credits on /pricing — the key arrives by email. Every response includes X-Credits-Balanceso you always know what's left.

curl -X POST https://api.draftlol.ai/v1/predict/draft \
  -H "X-API-Key: koi_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{ "blue_team": "T1", "red_team": "Gen.G", ... }'

Errors

StatusMeaning
401Missing or invalid API key.
402Insufficient credits. Response includes a topup_url. Buy more at /pricing.
403API key inactive.
429Rate limit exceeded, or too many concurrent stream connections (max 5).

Draft Predictions

Feed a draft, get the model's win probability with a full signal breakdown. Built for tipsters and betting bots that want an edge before a game starts.

POST/v1/predict/draft100 credits

Predict draft outcome

Bayesian model (V2.12) win probability from 10 champion picks. Seven signals: champion WR, matchup WR, duo synergy, team form, head-to-head, Elo, season WR.

Use case: Score a hypothetical or in-progress draft. Compare the model's probability against the Polymarket market price to find an edge.

Parameters
blue_teamstringrequiredBlue side team name
red_teamstringrequiredRed side team name
blue_picksPlayerPick[5]required{champion, role} × 5
red_picksPlayerPick[5]required{champion, role} × 5
leaguestringoptionalLEC/LCK/LPL… selects per-league weights
Request body
{
  "blue_team": "T1",
  "red_team": "Gen.G",
  "league": "LCK",
  "blue_picks": [
    { "champion": "Azir",   "role": "mid" },
    { "champion": "Jinx",   "role": "bot" },
    { "champion": "Rumble", "role": "top" },
    { "champion": "Maokai", "role": "jungle" },
    { "champion": "Thresh", "role": "support" }
  ],
  "red_picks": [
    { "champion": "Orianna",  "role": "mid" },
    { "champion": "Varus",    "role": "bot" },
    { "champion": "Gnar",     "role": "top" },
    { "champion": "Vi",       "role": "jungle" },
    { "champion": "Nautilus", "role": "support" }
  ]
}
Response
{
  "blue_team": "T1",
  "red_team": "Gen.G",
  "blue_win_prob": 0.5005,
  "red_win_prob": 0.4995,
  "league": "LCK",
  "weights_used": "LCK",
  "model_version": "V2.12",
  "signals": {
    "blue": { "champ_wr": { "score": 0.4572, "weight": 0.15, "detail": { "Azir": { "wr": 0.42, "games": 223 } } } },
    "red":  { "champ_wr": { "...": "..." } }
  }
}

Polymarket Analytics

On-chain analytics for LoL prediction markets. Track smart-money wallets, analyse a series' price history, inspect builder attribution.

GET/v1/polymarket/series/{series_id}/analysis30 credits

Series market analysis

Full Polymarket picture for one series: markets, per-game price history, top traders, probability swings.

Use case: Backtest how the market moved during a series, or study trader behaviour around a specific match.

Parameters
series_idint (path)requiredofficial_series id
Response
{
  "event_id": "...",
  "event_title": "T1 vs Gen.G",
  "total_volume": 184320.5,
  "team1_name": "T1",
  "team2_name": "Gen.G",
  "markets": [ { "...": "..." } ],
  "games":   [ { "...": "..." } ],
  "traders": { "...": "..." }
}
GET/v1/polymarket/wallets/{address}/summary50 credits

Wallet P&L summary

Realised PnL, ROI, volume, profitable-position rate and league mix for a wallet.

Use case: Identify and follow smart money — wallets with consistent positive ROI on LoL markets.

Parameters
addressstring (path)required0x-prefixed wallet address
Response
{
  "wallet_address": "0x0003...9f7e",
  "display_name": null,
  "realized_pnl": 4210.55,
  "total_invested": 18900.0,
  "roi_pct": 22.3,
  "profitable_positions": 64,
  "total_closed_positions": 91,
  "total_trades": 412,
  "league_mix": [ { "league": "LCK", "share": 0.41 } ]
}
GET/v1/polymarket/wallets/{address}/top-markets30 credits

Wallet top positions

A wallet's biggest positions, sortable by profit, loss, or impact. Detects hedged bets.

Use case: See exactly which markets a smart-money wallet made (or lost) the most on.

Parameters
addressstring (path)required0x-prefixed wallet address
limitintoptional1–20, default 10
sortstringoptionalprofit | loss | impact
Response
[
  {
    "event_title": "T1 vs Gen.G",
    "team1_name": "T1", "team2_name": "Gen.G",
    "league": "LCK", "market_type": "winner",
    "outcome_name": "T1",
    "cash_pnl": 820.0, "invested": 1500.0, "roi_pct": 54.6,
    "won": true, "resolution": "T1", "is_hedged": false
  }
]
GET/v1/polymarket/builders/{builder_code}20 credits

Builder attribution detail

Volume, unique makers, league/market breakdown and recent trades for a CLOB v2 builder.

Use case: Understand which frontends/desks route order flow into LoL markets, and how much.

Parameters
builder_codestring (path)required0x 32-byte builder code (66 chars)
Response
{
  "builder_code": "0xb4d6...100e",
  "builder_name": null,
  "builder_kind": "frontend",
  "total_volume_usd": 92044.1,
  "total_trades": 1840,
  "unique_makers": 612,
  "breakdown": [ { "league": "LCK", "market_type": "winner", "volume_usd": 40110.0, "trades_count": 800 } ],
  "recent_trades": [ { "...": "..." } ]
}

Live Draft Stream (SSE)

The real-time feed nobody else has. Subscribe once and receive a draft_complete event — champions + Polymarket odds — the instant a draft finishes. Billed per delivered draft.

GET/v1/live/drafts/stream?leagues={slugs}15 credits / draft

Live draft stream

Server-Sent Events. Pushes a draft_complete event per game — champions picked, market odds, AND the CLOB token ids so you can place a trade directly. No model prediction (you decide). One connection can cover several leagues (?leagues=lck,lec,lpl) — each draft is billed at ITS league's rate. Reconnect-safe, idempotent per game. Only emits for games with a Polymarket market. Cost shown is Tier-1; Tier-2 is cheaper.

Use case: Run a bot that reacts to drafts the moment they lock: receive the picks + both token ids, run your own analysis, and submit a buy order for the side you want while the market is still moving.

Parameters
leaguesstringoptionalComma-separated billing slugs (lck,lec,lpl,…), or 'subscribed' to use your stored subscription
leaguestringoptionalSingle slug (legacy). Provide this or leagues=
testbooloptionalSandbox mode: emits one free synthetic event immediately so you can develop without a live game. Real drafts are still billed. Max 10/hour per key.
api_keystringoptionalQuery-string key for browser EventSource (header preferred)
Response
event: connected
data: {"league": "lck", "resource": "stream:live-drafts:lck",
       "leagues": ["lck","lec"], "resources": ["stream:live-drafts:lck","stream:live-drafts:lec"]}

event: draft_complete
data: {
  "blue_team": "T1", "red_team": "Gen.G", "league": "lck",
  "game_number": 1, "best_of": 3, "series_id": 257891,
  "blue_picks": ["Azir","Jinx","Rumble","Maokai","Thresh"],
  "red_picks":  ["Orianna","Varus","Gnar","Vi","Nautilus"],
  "polymarket_prob_blue": 0.61, "polymarket_prob_red": 0.39,
  "polymarket_blue_token": "71321094...", "polymarket_red_token": "80455128...",
  "polymarket_condition_id": "0x78a736...",
  "polymarket_market_type": "game_winner",
  "polymarket_event_id": "518355",
  "polymarket_event_slug": "t1-vs-geng-2026-05-28"
}

event: game_complete
data: {
  "blue_team": "T1", "red_team": "Gen.G", "league": "lck",
  "winner": "blue", "winner_team": "T1", "duration_seconds": 1820,
  "polymarket_winning_token": "71321094..."
}

Full streaming guide (reconnect strategy, all league slugs, Python/Node clients): see below — or the technical docs.

GET/v1/live/drafts/recent?leagues={slugs}&limit=N15 credits

Recent drafts (bootstrap)

Returns the last N draft_complete events (newest first, max 20, last ~6h). With ?leagues= the per-league buffers are merged by timestamp. Same per-draft cost as the stream, idempotent by game — a draft you already paid for on the stream is free here, and vice-versa.

Use case: Bootstrap your bot on startup: after a deploy or crash, fetch the drafts that completed while you were offline before reconnecting to the live stream.

Parameters
leaguesstringoptionalComma-separated billing slugs, or 'subscribed'
leaguestringoptionalSingle slug (legacy). Provide this or leagues=
limitintoptional1–20, default 5
Response
{
  "league": "lck",
  "count": 2,
  "drafts": [ { "type": "draft_complete", "...": "..." } ],
  "insufficient_credits": false,
  "topup_url": null
}
PUT/v1/live/subscription

Stream subscription (persistent)

Store which leagues your key wants (then connect with ?leagues=subscribed) and toggle bet_signals. Partial upsert: send only the fields you change. GET /v1/live/subscription returns the current state. Changes apply on the NEXT connection (the stream snapshots your subscription at connect).

Use case: Configure your bot once — pick your leagues from the dashboard or a script — and let the bot connect with ?leagues=subscribed so its config lives server-side.

Parameters
leaguesstring[]optionalBilling slugs to receive. [] = none.
bet_signalsbooloptionalReceive the bot's real-bet signals (billed per signal, see below)
Request body
{ "leagues": ["lck", "lec", "lpl"], "bet_signals": true }
Response
{
  "leagues": ["lck", "lec", "lpl"],
  "bet_signals": true,
  "updated_at": "2026-08-24T18:40:02+00:00"
}
GET(event on /v1/live/drafts/stream)100 credits / signal

bet_signal — copy the bot's real bets

When our public trading bot actually buys (confirmed fill, real money, tier-1 leagues only), subscribers with bet_signals enabled receive the exact CLOB token bought + the real fill price on the same stream. Billed per delivered signal (idempotent per signal). Discard signals older than ~60s.

Use case: Replicate the bot's draft strategy with your own wallet: receive token_id + entry_price, place your buy within seconds, and manage the exit (the bot itself sells GTC at 0.99).

Response
event: bet_signal
data: {
  "signal_id": "18427_lolesports:110123_blue",
  "league": "lck", "blue_team": "T1", "red_team": "Gen.G",
  "side": "blue", "team": "T1",
  "token_id": "71321094...", "condition_id": "0x78a736...",
  "market_type": "game_winner",
  "entry_price": 0.612, "market_prob": 0.598, "model_prob": 0.641,
  "edge": 0.043, "bet_mode": "picks", "exit_strategy": "sell_gtc_0.99",
  "ts": "2026-08-24T18:40:05+00:00"
}

Automation (Rules)

No-code trading rules. Define "always the favorite in LEC" or "always my team" from your dashboard; your agent receives ready-to-execute triggers — token to buy, price, and the stake already computed (fixed or % of YOUR wallet's balance). Execution is 100% client-side with your own keys.

GET/v1/automation/stream25 credits / trigger

Rule trigger stream

SSE. One connection covers ALL your rules and leagues. Each delivered rule_trigger carries the exact CLOB token to buy, the reference price, your rule's max_price cap, and size_usdc (from your fixed stake or % of your SIWE wallet's balance snapshot). Idempotent per (rule, game, market) even across concurrent connections. game_complete events pass through free. Add ?test=1 to run a synthetic draft through your REAL rules (free).

Use case: Run a tiny bot that just executes: read rule_trigger, check valid_until and max_price, place the FOK buy with your wallet. All the strategy lives in your dashboard rules.

Parameters
api_keystringoptionalQuery-string key for browser EventSource (header preferred)
testbooloptionalEvaluate a synthetic draft against your real rules on connect (free, max 10/h)
Response
event: rule_trigger
data: {
  "trigger_id": "6f2c...", "rule_id": "a1b2...", "rule_name": "Favorito · lec",
  "predicate": "favorite", "source_event": "draft_complete",
  "token_id": "71321094...", "side": "blue", "team": "T1",
  "price": 0.61, "max_price": 0.85, "size_usdc": 12.50,
  "sizing": {"mode": "pct_balance", "pct": 5.0, "balance_usdc": 250.13},
  "condition_id": "0x78a736...", "market_type": "game_winner",
  "league": "lec", "blue_team": "T1", "red_team": "Gen.G",
  "valid_until": "2026-08-24T18:42:05+00:00"
}
POST/v1/automation/rules

Manage rules

Create/list/pause/delete rules (dashboard session; GET also works with X-API-Key so your agent can introspect its config). Scopes: specific leagues, all tier-1, or one team (name resolved through our alias system). Guardrails per rule: max/min price, daily trigger and USDC caps, signal expiry. POST /v1/automation/kill pauses everything instantly.

Use case: Configure once from the dashboard wizard — no code. Your agent only needs the stream.

Parameters
scope_typestringrequired'leagues' | 'tier1' | 'team'
predicatestringrequiredfavorite | underdog | team_for | team_against | copy_bot
sizing_modestringrequired'fixed_usdc' (1-1000) or 'pct_balance' (0.5-50% of your wallet snapshot)
Request body
{
  "name": "Favorito en LEC",
  "api_key_id": "<your key id>",
  "scope_type": "leagues", "scope_leagues": ["lec"],
  "predicate": "favorite",
  "sizing_mode": "fixed_usdc", "fixed_usdc": 10,
  "max_price": 0.85
}
Response
{ "id": "a1b2...", "status": "active", "...": "..." }

Predictors (Track Record)

Publish your agent's predictions and build a verifiable public track record — accuracy, Brier score, and how you compare against the Polymarket price at the moment you called it. No money involved: you predict, we keep score. Prefer no code? Create a rule in your dashboard and OUR SERVER runs it against real matches and fills the record for you, free.

POST/v1/predictors/predictions

Register a prediction

Submit prob_blue for an upcoming match before it is decided. The market price you are measured against is FROZEN SERVER-SIDE at registration — you cannot pick it afterwards. Returns 409 if the match already has a winner, so a track record can never be built in hindsight. Resolution runs automatically every 10 min: was_correct, brier, market_brier and a flat $20 simulated result.

Use case: Your model calls a game. Post it here and the profile page accumulates the evidence — including whether your Brier beats the market's.

Parameters
agent_iduuidrequiredYour agent (POST /v1/predictors/agents)
match_idintrequiredofficial_matches id
prob_bluefloatrequiredYour win probability for the BLUE side (0-1)
reasoningstringoptionalShown on the public profile
Response
{
  "id": "3f9a...", "match_id": 19871, "prob_blue": 0.63,
  "market_prob_blue": 0.71, "registered_at": "2026-08-24T17:02:11+00:00"
}
GET/v1/predictors/directory

Public directory & profile

Free and unauthenticated. GET /v1/predictors/directory lists public agents ranked by track record; GET /v1/predictors/p/{handle} returns one agent's full history — every prediction with its frozen market price, Brier vs market Brier, and the simulated running total. Agents are private by default; you opt in.

Use case: Prove your edge to someone without handing over your model, or scout which public strategies actually beat the market.

Parameters
handlestringoptionalAgent handle for the /p/{handle} profile
Response
{
  "handle": "pocho", "display_name": "Pocho",
  "predictions": 5, "correct": 1,
  "brier": 0.3460, "market_brier": 0.3798,
  "sim_pnl": -73.15
}

Ready to start? Buy a credit pack and your key arrives by email.

See pricing →