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

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.

Inputs of Sports What-If Simulator
FieldTypeDefaultDescription
modeselect (match, league)"match"Simulate
modelselect (goals, elo)"goals"Team strength from
teams (required)table—Teams
homeTeamtext—Home team (one match). Empty = first team in the list.
awayTeamtext—Away team (one match). Empty = second team in the list.
neutralbooleanfalseNeutral venue (no home advantage) for the single match
homeAdvantagenumber10Home advantage
avgGoalsnumber2.6Average goals per match (Elo model)
fixturestable—League fixtures and results. Leave the goals empty for games not played yet. No fixtures = a double round robin with nothing played.
whatIftable—What if… (changed results). Override the result of a fixture (played or not) to compare the table and the odds.
simulationsinteger5000Simulations
seedtext—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)

{
  "mcpServers": {
    "sports-what-if-simulator": { "type": "http", "url": "https://sportswhatifsimulator.usefulweb.site/mcp" }
  }
}