On this page
Statistical concepts
This guide explains how CrunchClash models football statistics: grains, metric ids, derived rates, and common pitfalls. Examples are illustrative — not live EPL scrape dumps.
Grains
A grain is the unit of aggregation for a metric row.
| Grain | Meaning |
|---|---|
player-season | One player across a season |
club-season | One club across a season |
player-match | One player in one match |
team-match | One team in one match |
Performance list endpoints and POST /v1/query validate that requested metrics are compatible with the active grain. Incompatible combinations return INCOMPATIBLE_GRAIN.
Discover metrics and grains via /v1/catalog/metrics and /v1/catalog/coverage.
Metric ids
Use catalogue ids (e.g. goals, expectedGoals, expectedAssists), not display labels. Pass them as:
- Query string:
metrics=goals,expectedGoals - Query DSL:
"metrics": ["goals", "expectedGoals"]
xG and xA
expectedGoals (xG) and expectedAssists (xA) are model-based attacking quality metrics. They are available only where the catalogue marks coverage for that grain and season. Absence of a value means missing data — not zero chance created.
Per-90 and derived metrics
Derived metrics (often marked in the catalogue) are computed from base measures — for example per-90 rates from totals and minutes. They inherit grain rules from their inputs. Prefer catalogue ids over inventing your own rate formulas client-side when a derived metric already exists.
Missing ≠ 0
{
"playerId": "p1",
"minutes": 900,
"expectedGoals": null
}
Here xG was not observed for this row. Summing nulls as zero will inflate “zero xG” player counts incorrectly. Filter with explicit null handling.
Scope: season vs matches
On /v1/performance/* routes, scope=season (default) aggregates to season grains. scope=matches switches to match-level rows where supported. Pair with matchweek / date filters when drilling into form.
Home / away
home_away=home or away restricts rows to that venue split when the underlying facts support it. Omit the param for combined totals.
Multi-metric requests
You may request multiple metrics in one call. All must share a compatible grain. For complex sorts (secondary keys, averages), use the Advanced Query Engine.
Illustrative query
{
"entity": "player",
"season": "2026",
"filters": [{ "field": "minutes", "operator": "gte", "value": 900 }],
"metrics": ["appearances", "minutes", "goals", "expectedGoals"],
"sort": { "field": "expectedGoals", "direction": "desc" },
"limit": 10
}
Try it: Playground → query · perf-players.
Related: API Reference · Playground