API & MCP
Everything a person can do on Sports What-If Simulator, a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://sportswhatifsimulator.usefulweb.site/api/v1/calculate– run Sports What-If SimulatorGET https://sportswhatifsimulator.usefulweb.site/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
Sports What-If Simulator
Give team strengths as goals scored/conceded per game or as Elo ratings. Get exact win/draw/loss odds and a scoreline heatmap for one match, or simulate the rest of a small league thousands of times (seeded, reproducible) for title and position odds — then change any result to see how the table and the odds would have looked.
| Field | Type | Default | Description |
|---|---|---|---|
mode | select (match, league) | "match" | Simulate |
model | select (goals, elo) | "goals" | Team strength from |
teams (required) | table | — | Teams |
homeTeam | text | — | Home team (one match). Empty = first team in the list. |
awayTeam | text | — | Away team (one match). Empty = second team in the list. |
neutral | boolean | false | Neutral venue (no home advantage) for the single match |
homeAdvantage | number | 10 | Home advantage |
avgGoals | number | 2.6 | Average goals per match (Elo model) |
fixtures | table | — | League fixtures and results. Leave the goals empty for games not played yet. No fixtures = a double round robin with nothing played. |
whatIf | table | — | What if… (changed results). Override the result of a fixture (played or not) to compare the table and the odds. |
simulations | integer | 5000 | Simulations |
seed | text | — | Seed (optional). Same seed = same simulated numbers. Empty = derived from the inputs. |
Example request
One match from goal averages
curl -X POST https://sportswhatifsimulator.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"mode":"match","model":"goals","teams":[{"name":"Rovers","goalsFor":1.9,"goalsAgainst":0.9},{"name":"United","goalsFor":1.3,"goalsAgainst":1.2},{"name":"City","goalsFor":1.1,"goalsAgainst":1.4},{"name":"Athletic","goalsFor":0.9,"goalsAgainst":1.7}],"homeTeam":"United","awayTeam":"Rovers","homeAdvantage":10,"simulations":2000}'
Every result contains
inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.
MCP (Model Context Protocol)
- Streamable HTTP endpoint:
https://sportswhatifsimulator.usefulweb.site/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
sports_what_if_simulator - Local stdio connector:
node src/mcp-stdio.ts --tool=sports-what-if-simulator
{
"mcpServers": {
"sports-what-if-simulator": { "type": "http", "url": "https://sportswhatifsimulator.usefulweb.site/mcp" }
}
}