> For the complete documentation index, see [llms.txt](https://docs.sportmonks.com/v3/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sportmonks.com/v3/tutorials-and-guides/tutorials/odds-and-predictions/predictions/live-predictions.md).

# Live Predictions

#### What does the include do?

The `livepredictions` include returns a live-updating full-time result probability (Home/Away/Draw) for a fixture, recalculated roughly every minute while the match is in play. This is part of the **Predictions Advanced** tier, on top of everything in Predictions Basic.

{% hint style="info" %}
**Advanced tier only.** Live Predictions is not available on the Predictions Basic add-on. See [pricing](https://www.sportmonks.com/football-api/football-predictions-api/) for details.
{% endhint %}

#### Why use Live Predictions?

* **Live match centres**: Show how a team's win probability shifts minute by minute as the match unfolds
* **In-play betting products**: Track how in-game events (goals, cards) move the probability model in near real time
* **Momentum visualisation**: Chart the home/away/draw lines across the match to show swings after key moments

#### Requesting Live Predictions

```http
https://api.sportmonks.com/v3/football/fixtures/{fixture_id}
?api_token=YOUR_TOKEN&include=livepredictions
```

{% hint style="info" %}
**Only populates for fixtures currently in play.** Requesting this include on a fixture that hasn't started or has already finished returns an empty array, not an error.
{% endhint %}

#### Response structure

```json
{
  "data": {
    "id": 19674674,
    "name": "Shanghai Port vs Dalian Yingbo",
    "state_id": 2,
    "livepredictions": [
      {
        "id": 1762829,
        "fixture_id": 19674674,
        "period_id": 7048835,
        "minute": 1,
        "predictions": {
          "home": 50.89,
          "away": 25.63,
          "draw": 23.48
        },
        "type_id": 237
      },
      {
        "id": 1763608,
        "fixture_id": 19674674,
        "period_id": 7048835,
        "minute": 33,
        "predictions": {
          "home": 22.29,
          "away": 52.32,
          "draw": 25.39
        },
        "type_id": 237
      }
    ]
  }
}
```

#### Field descriptions

| Field              | Type    | Description                                                                                   |
| ------------------ | ------- | --------------------------------------------------------------------------------------------- |
| `id`               | integer | Unique identifier for this prediction snapshot                                                |
| `fixture_id`       | integer | The fixture this prediction belongs to                                                        |
| `period_id`        | integer | The period (half) this snapshot was calculated in                                             |
| `minute`           | integer | The match minute this snapshot represents                                                     |
| `predictions.home` | float   | Home win probability, as a percentage                                                         |
| `predictions.away` | float   | Away win probability, as a percentage                                                         |
| `predictions.draw` | float   | Draw probability, as a percentage                                                             |
| `type_id`          | integer | Currently always `237` (full-time result), the only Live Predictions type available at launch |

{% hint style="info" %}
Only one prediction type (`type_id: 237`, full-time result) is available in Live Predictions at launch.&#x20;
{% endhint %}

#### Example: tracking probability swings

{% tabs %}
{% tab title="JavaScript" %}

```javascript
function getBiggestSwing(livepredictions) {
  let biggest = null;

  for (let i = 1; i < livepredictions.length; i++) {
    const prev = livepredictions[i - 1].predictions;
    const curr = livepredictions[i].predictions;
    const swing = Math.abs(curr.home - prev.home);

    if (!biggest || swing > biggest.swing) {
      biggest = { minute: livepredictions[i].minute, swing };
    }
  }

  return biggest;
}
```

{% endtab %}

{% tab title="Python" %}

```python
def get_biggest_swing(livepredictions):
    biggest = None

    for i in range(1, len(livepredictions)):
        prev = livepredictions[i - 1]['predictions']
        curr = livepredictions[i]['predictions']
        swing = abs(curr['home'] - prev['home'])

        if biggest is None or swing > biggest['swing']:
            biggest = {'minute': livepredictions[i]['minute'], 'swing': swing}

    return biggest
```

{% endtab %}

{% tab title="PHP" %}

```php
function getBiggestSwing($livepredictions) {
    $biggest = null;

    for ($i = 1; $i < count($livepredictions); $i++) {
        $prev = $livepredictions[$i - 1]['predictions'];
        $curr = $livepredictions[$i]['predictions'];

        $swing = abs($curr['home'] - $prev['home']);

        if ($biggest === null || $swing > $biggest['swing']) {
            $biggest = [
                'minute' => $livepredictions[$i]['minute'],
                'swing' => $swing
            ];
        }
    }

    return $biggest;
}
```

{% endtab %}
{% endtabs %}

#### Best practices

1. **Poll sparingly.** Predictions update roughly once per minute, polling faster than that won't return new data and wastes requests.
2. **Handle the empty-array case.** Always check `livepredictions.length` before assuming data is present, pre-match and finished fixtures return an empty array, not an error.
3. **Pair with `include=events`** to correlate probability swings with specific match events (goals, red cards) for commentary or analysis features.

#### Related

* [Predictions](https://docs.sportmonks.com/v3/endpoints-and-entities/endpoints/predictions) - the main Predictions Basic tier (pre-match probabilities, value bets)
* [Livescores](https://docs.sportmonks.com/v3/endpoints-and-entities/endpoints/livescores) - find fixtures currently in play to test this include against

#### Summary

The `livepredictions` include is an Advanced-tier-only feature returning minute-by-minute full-time result probability during live matches. Only one prediction type (`type_id: 237`) is available at launch, with more planned. It returns an empty array outside of live match windows, not an error.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sportmonks.com/v3/tutorials-and-guides/tutorials/odds-and-predictions/predictions/live-predictions.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
