Pro Data

Get the model's numbers into your code in minutes

Every probability on the site — the homepage forecast, /fixtures/, the per-player pages — as JSON or CSV, or as an MCP tool your assistant can call. Built for researchers, fantasy players, journalists, and analytics teams who want the model output in a pipeline rather than a page. Try a live endpoint below with one command — no signup.

Live now in early access· Bulk zip + historical slicing live · Reproducible notebooks and backfilled WC2018/WC2022 outputs coming ahead of kickoff

Quickstart

Try it now — no signup

Run this. It returns the five most-likely tournament winners straight from the live model — no account, no API key. Add ?format=csv for the tabular variant.

curl "https://onthepitch.now/api/v1/sample/"

Want the full picture — all 48 teams, every fixture, players, squads? Sign in, generate an API key (10 free calls to start), and pass it as a Bearer token on any endpoint:

curl -H "Authorization: Bearer otp_live_…" \
  "https://onthepitch.now/api/v1/forecast/"

Try it free — 10 calls

Sign in and generate an API key to get 10 free programmatic calls, shared across these REST endpoints and the hosted MCP server — enough to wire the data into a notebook or an assistant and see it working. The MCP handshake doesn't count; only the data calls do. The Pro Pass is unmetered.

What's included

  • 9 JSON endpoints under /api/v1/

    Live

    Forecast, fixtures, teams, players, predicted squads, head-to-head, schedule, major-tournament history, anytime scorer — every page on the site reachable as machine-readable JSON. Authenticate with a Bearer API key or your Pro session cookie.

  • CSV variant on every endpoint

    Live

    Pass ?format=csv on any endpoint for a tabular response, RFC-4180 quoted, suitable for spreadsheet or notebook import. All row types are flat — no nested JSON in CSV cells.

  • Daily refresh + provenance metadata

    Live

    Every response carries the upstream snapshot's built_at timestamp in the envelope (JSON) or X-OnThePitch-Generated-At header (CSV). Pipeline refits daily; cache is private 1h.

  • Bulk snapshot download (zip)

    Live

    GET /api/v1/bulk/snapshot/ returns one DEFLATE-compressed archive with the 11 source JSONs + a manifest (per-file size + sha256 + built_at). Includes the deep fixture enrichment blobs the per-endpoint variants flatten away. ~3–5 MB on the wire.

  • Historical tournament slicing

    Live

    Pass ?tournament=&year= on /api/v1/majors/ to extract a single tournament-year — e.g. every WC2026 team's WC2022 row in one call. The dataset stores each team's most-recent appearance per tournament, so WC2022 covers most qualifiers; WC2018 only covers teams that haven't been at a WC since.

  • Long-lived API keys

    Live

    Generate a Bearer key at /account/api-key/ and pass it as Authorization: Bearer otp_live_… on any endpoint — no cookie juggling for headless / CI / scheduled jobs. One key per account; reset it any time if it leaks.

  • MCP server — connect Claude / Cursor

    Live

    A hosted Model Context Protocol server at /api/mcp exposes every endpoint as an MCP tool. Add it to Claude Code, Claude Desktop, or Cursor with one command and ask questions against the live model — no install, no glue code.

  • Backfilled model outputs — WC2018, WC2022

    Coming soon

    Pre-tournament model probabilities for the last two World Cups, replayed against frozen inputs so you can backtest the model end-to-end against known outcomes. Requires re-pulling historical FBref / Wikipedia snapshots; tracked as a separate research initiative.

  • Reproducible notebooks

    Coming soon

    Jupyter notebooks that fit the model end-to-end from the public data files and reproduce the website's outputs. Run locally with the published datasets.

/api/v1/sample/ is public; every other endpoint under /api/v1/ is gated. Authenticate with an API key (Authorization: Bearer otp_live_…) or a Pro session cookie; the same URL with ?format=csv returns the tabular variant. Full request / response schemas live in the interactive reference (OpenAPI 3.0 spec at /api/v1/openapi.json).

  • /api/v1/sample/

    Public, no auth — the top-5 tournament-win probabilities. The zero-setup taste; every other endpoint needs a free-trial key or a Pass.

  • /api/v1/forecast/

    Per-team forecast across 48 nations — tournament-win, stage-by-stage, group-finish probabilities.

  • /api/v1/fixtures/

    Per-fixture forecast for all 104 matches — H/D/A probabilities, expected goals, derived markets.

  • /api/v1/teams/

    WC2026 team list — confederation, FIFA rank, host flag, group letter.

  • /api/v1/players/

    Per-player index — name, position, current club, career goals + assists.

  • /api/v1/predicted-squads/

    Projected 26-man squads — one row per team-player with slot flag (xi / bench) and composite rating.

  • /api/v1/majors/

    Per-team most-recent appearance in each major tournament — finish, W-D-L, coach + squad continuity. Optional ?tournament=&year= for historical slicing.

  • /api/v1/h2h/

    All-time head-to-head records vs WC2026 group opponents.

  • /api/v1/schedule/

    WC2026 group-stage schedule — one row per team-matchday with date, opponent, host city.

  • /api/v1/anytime-scorer/

    Top-50 anytime-scorer rankings — P(scores ≥1) plus per-stage scoring probabilities.

  • /api/v1/bulk/snapshot/

    Single-call zip of every source JSON the site renders from, plus a manifest with sha256s and built_at per file. ~3–5 MB.

Examples

Three things you can do today

Set OTP_KEY to the API key you generate here (export OTP_KEY=otp_live_…) — one token, no cookie juggling, works the same from a shell, a notebook, or a scheduled job. (Signed in already? A Pro session cookie works too, but the key is the friendlier path.)

Full forecast as CSV

curl -H "Authorization: Bearer $OTP_KEY" \
  "https://onthepitch.now/api/v1/forecast/?format=csv" \
  -o forecast.csv

WC2022 historical slice

curl -H "Authorization: Bearer $OTP_KEY" \
  "https://onthepitch.now/api/v1/majors/?tournament=FIFA%20World%20Cup&year=2022" \
  -o wc2022.json

Bulk snapshot as a single zip

curl -H "Authorization: Bearer $OTP_KEY" \
  "https://onthepitch.now/api/v1/bulk/snapshot/" \
  -o onthepitch-snapshot-v1.zip

Build on the data

Pull the snapshot, fit your own model

The bulk zip ships everything the public site renders from — forecast, fixtures, predicted squads, head-to-heads, intl majors history. Three starter recipes for getting it into a notebook and running your own analysis against it.

1 · Load the snapshot into pandas

Pull the zip, extract it once, then read each file as a DataFrame. The forecast envelope nests one row per team — flatten with pd.json_normalize.

import io, json, os, zipfile, requests, pandas as pd

z = zipfile.ZipFile(io.BytesIO(requests.get(
    "https://onthepitch.now/api/v1/bulk/snapshot/",
    headers={"Authorization": f"Bearer {os.environ['OTP_KEY']}"},
).content))

forecast = pd.json_normalize(
    json.loads(z.read("data.json"))["teams"],
)
fixtures = pd.json_normalize(
    json.loads(z.read("fixtures.json"))["fixtures"],
)
squads = pd.json_normalize(
    json.loads(z.read("predicted_squads.json"))["squads"],
    record_path="players",
    meta=["team_id"],
)

2 · Fit a baseline win-probability model

Roll your own H/D/A model from the predicted squads + the team forecast. Composite ratings + a squad-strength sum is a reasonable starting feature set; compare against the published probabilities to see where your model agrees and disagrees.

from sklearn.linear_model import LogisticRegression

# Aggregate predicted-XI composite to a team strength score.
xi = squads.query("slot == 'xi'")
strength = xi.groupby("team_id")["composite"].sum().rename("strength")

# Join strength onto fixtures and fit a logistic on prior tournament
# results (intl_majors.json has W/D/L from previous WCs + qualifiers).
intl = pd.json_normalize(
    json.loads(z.read("intl_majors.json"))["rows"],
)
features = intl.merge(strength, left_on="team_id", right_index=True)
X = features[["strength", "fifa_rank"]]
y = (features["finish"] >= 9).astype(int)  # 1 = quarter-final or better

clf = LogisticRegression().fit(X, y)
print(clf.coef_)

3 · Calibrate your model against the published forecast

Once your model produces team-level tournament-win probabilities, compare against ours via Brier score and a reliability plot — the same metric we use in the methodology docs.

from sklearn.metrics import brier_score_loss

merged = forecast.merge(
    pd.Series(my_probs, name="my_p_win"),
    left_on="team_id", right_index=True,
)
print("OnThePitch Brier:", brier_score_loss(merged["won"], merged["p_win"]))
print("Yours        Brier:", brier_score_loss(merged["won"], merged["my_p_win"]))

The Pass licence is research-use — fit, backtest, publish your findings. Attribution back to the methodology doc is appreciated but not required.

Agents

Connect Claude, Cursor, or any MCP client

A hosted Model Context Protocol server at /api/mcp exposes all nine endpoints as MCP tools, so you can ask questions against the live model right inside your assistant — no install, no glue code. Authenticate with an API key — any signed-in account can generate one, and your first 10 tool calls are free.

Add it to Claude Code

claude mcp add --transport http onthepitch \
  https://onthepitch.now/api/mcp \
  --header "Authorization: Bearer otp_live_…"

Then prompt naturally — “which team is most likely to win the group?”, “compare the projected XIs for France and England”, “how did Brazil do at WC2022?” — and the assistant calls the matching tool (get_forecast, get_predicted_squads, get_majors) and answers from the live data.

Pro Pass

Get the Pro Pass for unmetered access

Every account gets 10 free calls to try the API + MCP. The Pro Pass is a one-time $35 purchase for unmetered access — everything in the Standard Pass plus the data endpoints, bulk zip download, and historical tournament slicing. Reproducible notebooks land ahead of kickoff. Already hold the Standard Pass? Upgrade for $20.

24h self-service refund·No subscription, no auto-renewal·Access through 31 Dec 2026. See refund policy.