Expected Goals (xG) is the foundational currency of modern football analytics. Yet across the industry, most providers treat their mathematical formulation as an opaque black box. When an API endpoint outputs {"xg": 1.84}, what does that number actually represent?
At KickoffAPI, our predictive endpoints (/api/v2/xg and match projections) are open about their modeling assumptions, probability distributions, and known boundary conditions.
The Core Probability Formulation
Expected Goals is not a measure of finishing skill, luck, or subjective momentum. An xG value represents the conditional probability $P(\text{Goal} \mid X)$ that an unexceptional professional player converts a shot from a given state $X$, evaluated against historical shot datasets:
P(Goal | X) = \frac{1}{1 + e^{-(\beta_0 + \sum \beta_i x_i)}}
Key Feature Weights in our Model
Our model trains across hundreds of thousands of evaluated attempts from top European leagues, weighting the following spatial and situational parameters:
- Euclidean Distance to Center of Goal: The strongest single predictor. Probability decays sharply beyond 18 yards; an unpressured central shot from 8 yards registers ~0.42 xG, whereas a shot from 28 yards rarely exceeds 0.03 xG.
- Visible Goal Angle: The trigonometric angle subtended by the two goal posts from the point of contact. Sharp angles down the byline dramatically compress conversion probability.
- Shot Body Part: Shots taken with the dominant foot consistently outperform weak-foot attempts, while headed attempts register approximately 40% lower conversion probabilities from equivalent box distances due to trajectory variance.
- Set-Piece vs Open Play Context: Direct free kicks, corners, and penalty kicks are modeled with dedicated priors. Standard penalty kicks carry an unadjusted benchmark value of 0.76 xG.
- Fast-Break Transition Flag: Counter-attacks where the defending defensive line has not organized yield higher expected conversion rates due to displaced goalkeeping angles.
What xG Does NOT Measure
To use xG effectively in software applications, developers must avoid common analytical traps:
- It is not predictive of single-match outcomes: Football is notoriously high-variance. A team winning the xG battle 2.4 to 0.6 will still lose roughly 14% of the time in real life.
- It does not capture pre-shot passing quality: A dangerous through-ball that misses the striker's outstretched boot produces 0.00 xG because no shot occurred, despite creating immense danger.
- It does not evaluate defensive goalkeeper positioning: Post-shot xG (PSxG) models shot trajectory and velocity towards the net, whereas standard xG measures the chance quality at the split second before the strike.
Querying KickoffAPI /xg
You can query versioned match projections and xG metrics on any completed or live fixture:
curl -s "https://api.kickoffapi.com/api/v1/fixtures/projection?fixtureId=1035284" \
-H "x-api-key: $YOUR_KEY"
Responses include version identifiers (e.g. v2.1-calibrated) so your predictive models can track historical calibration drift over successive league seasons.