# Fixture statistics

> **Included in all plans**
>
> Match statistics (shots, possession, passes, etc.) are included in all base plans (Starter, Growth, Pro, Enterprise) at no additional cost.
>
> Plans differ only in:
>
> * Number of leagues (5 leagues → all leagues)
> * API call limits (2,000 → 5,000+ calls/hour)
>
> **Note:** Advanced metrics like xG, Pressure Index require separate add-ons.
>
> [Compare plans →](https://www.sportmonks.com/football-api/plans-pricing)

### Team fixture statistics

Fixture statistics are available for the teams participating in the fixture and the players. You can access a fixture via one of our fixtures endpoints. For this example, we will be using the [GET](https://docs.sportmonks.com/v3/endpoints-and-entities/endpoints/fixtures/get-fixture-by-id) [Fixtures by ID](https://docs.sportmonks.com/v3/endpoints-and-entities/endpoints/fixtures/get-fixture-by-id) endpoint. &#x20;

Let's take a look at the match statistics for Celtic vs Rangers (id: 18535517) by using the `statistics` include:

```javascript
https://api.sportmonks.com/v3/football/fixtures/18535517?api_token=YOUR_TOKEN&include=statistics
```

{% hint style="info" %}
Is this the first time you've heard about includes? Check our [includes tutorial](https://docs.sportmonks.com/v3/tutorials-and-guides/tutorials/includes).
{% endhint %}

<details>

<summary>Response</summary>

```javascript
{
  "data": {
    "id": 18535517,
    "sport_id": 1,
    "league_id": 501,
    "season_id": 19735,
    "stage_id": 77457866,
    "group_id": null,
    "aggregate_id": null,
    "round_id": 274719,
    "state_id": 5,
    "venue_id": 8909,
    "name": "Celtic vs Rangers",
    "starting_at": "2022-09-03 11:30:00",
    "result_info": "Celtic won after full-time.",
    "leg": "1/1",
    "details": null,
    "length": 90,
    "placeholder": false,
    "last_processed_at": "2023-03-02 17:47:38",
    "has_odds": true,
    "starting_at_timestamp": 1662204600,
    "statistics": [
      {
        "id": 5914502,
        "fixture_id": 18535517,
        "type_id": 86,
        "participant_id": 53,
        "data": {
          "value": 6
        },
        "location": "home"
      },
      {
        "id": 5914520,
        "fixture_id": 18535517,
        "type_id": 78,
        "participant_id": 62,
        "data": {
          "value": 17
        },
        "location": "away"
      },
      //And more
```

</details>

The statistics include returns the match statistics for both teams. Our API returns many values, but what do they mean exactly? And how can you display the type of statistic? You can use the nested include `statistics.type` for this:

```javascript
https://api.sportmonks.com/v3/football/fixtures/18535517?api_token=YOUR_TOKEN&include=statistics.type
```

<details>

<summary>Response</summary>

```javascript
{
  "data": {
    "id": 18535517,
    "sport_id": 1,
    "league_id": 501,
    "season_id": 19735,
    "stage_id": 77457866,
    "group_id": null,
    "aggregate_id": null,
    "round_id": 274719,
    "state_id": 5,
    "venue_id": 8909,
    "name": "Celtic vs Rangers",
    "starting_at": "2022-09-03 11:30:00",
    "result_info": "Celtic won after full-time.",
    "leg": "1/1",
    "details": null,
    "length": 90,
    "placeholder": false,
    "last_processed_at": "2023-03-02 17:47:38",
    "has_odds": true,
    "starting_at_timestamp": 1662204600,
    "statistics": [
      {
        "id": 5914502,
        "fixture_id": 18535517,
        "type_id": 86,
        "participant_id": 53,
        "data": {
          "value": 6
        },
        "location": "home",
        "type": {
          "id": 86,
          "name": "Shots On Target",
          "code": "shots-on-target",
          "developer_name": "SHOTS_ON_TARGET",
          "model_type": "statistic",
          "stat_group": "offensive"
        }
      },
      {
        "id": 5914520,
        "fixture_id": 18535517,
        "type_id": 78,
        "participant_id": 62,
        "data": {
          "value": 17
        },
        "location": "away",
        "type": {
          "id": 78,
          "name": "Tackles",
          "code": "tackles",
          "developer_name": "TACKLES",
          "model_type": "statistic",
          "stat_group": "defensive"
        }
      },
      //And more
```

</details>

Each statistic has a `type_id` field that categorizes the data (e.g., shots, tackles, possession).

📖 **Learn more:** Statistics Types explains how type IDs work, or view [the complete Statistics Types Reference](https://docs.sportmonks.com/v3/tutorials-and-guides/tutorials/statistics/statistics-types) for all available types.

Please check the response carefully to see the correct values with the types.&#x20;

{% hint style="danger" %}
Including `.type` is not recommended as an include on any endpoint. Types are used throughout the entire API. We recommend retrieving all types from the types endpoint and storing them in your database or other data structure. Only include the type if no other option is available or when testing the API.
{% endhint %}

### Filtering team fixture statistics

The API returns a lot of statistics, but we can imagine you're interested in only some of them.&#x20;

Check our [filtering tutorial ](https://docs.sportmonks.com/v3/tutorials-and-guides/tutorials/filter-and-select-fields/filtering)for valuable tips and tricks.&#x20;

What if you're only interested in specific statistics like shots on target? To filter your request, you need to:

1. Add the parameter `&filters=`&#x20;
2. Select the entity you want to filter on&#x20;
3. Select the field you want to filter on&#x20;
4. Fill in the IDs you're interested in

Let's say you're only interested in the shots on goal. In our case, this will result in the following steps:

1. Add the parameter `&filters=`&#x20;
2. Select the entity you want to filter on: `fixtureStatistic`
3. Select the field you want to filter on: `Types` (the statistics types)&#x20;
4. Fill in the IDs you're interested in: `86` (You can retrieve them via the Types endpoint or by looking at the previous request)&#x20;

It's important to note that you can retrieve statistics from multiple entities. Therefore, you also need to specify for which entity you want to filter the statistics. You can do this by prefixing the filter with the entity's name. So in our case: `fixtureStatistic`

```javascript
https://api.sportmonks.com/v3/football/fixtures/18535517?api_token=YOUR_TOKEN&include=statistics.type&filters=fixtureStatisticTypes:86
```

<details>

<summary>Response</summary>

```javascript
{
  "data": {
    "id": 18535517,
    "sport_id": 1,
    "league_id": 501,
    "season_id": 19735,
    "stage_id": 77457866,
    "group_id": null,
    "aggregate_id": null,
    "round_id": 274719,
    "state_id": 5,
    "venue_id": 8909,
    "name": "Celtic vs Rangers",
    "starting_at": "2022-09-03 11:30:00",
    "result_info": "Celtic won after full-time.",
    "leg": "1/1",
    "details": null,
    "length": 90,
    "placeholder": false,
    "last_processed_at": "2023-03-02 17:47:38",
    "has_odds": true,
    "starting_at_timestamp": 1662204600,
    "statistics": [
      {
        "id": 5914502,
        "fixture_id": 18535517,
        "type_id": 86,
        "participant_id": 53,
        "data": {
          "value": 6
        },
        "location": "home",
        "type": {
          "id": 86,
          "name": "Shots On Target",
          "code": "shots-on-target",
          "developer_name": "SHOTS_ON_TARGET",
          "model_type": "statistic",
          "stat_group": "offensive"
        }
      },
      {
        "id": 5914503,
        "fixture_id": 18535517,
        "type_id": 86,
        "participant_id": 62,
        "data": {
          "value": 2
        },
        "location": "away",
        "type": {
          "id": 86,
          "name": "Shots On Target",
          "code": "shots-on-target",
          "developer_name": "SHOTS_ON_TARGET",
          "model_type": "statistic",
          "stat_group": "offensive"
        }
      }
    ]
  },
```

</details>

Are you interested in more statistics? Add more statistics IDs to your request by separating them with a comma (`,`). Check our [syntax section ](https://docs.sportmonks.com/v3/api/syntax)for more helpful information.

### Player fixture statistics

You might wonder, how can I retrieve the statistics of the players per fixture? While the statistics include only returns the team statistics, the `lineups` include produces the player statistics.&#x20;

Let's look at how to retrieve these statistics for Celtic vs Rangers (id: 18535517).

As mentioned, player statistics for a specific fixture are available in the lineups include:

```javascript
https://api.sportmonks.com/v3/football/fixtures/18535517?api_token=YOUR_TOKEN&include=lineups
```

{% hint style="info" %}
Is this the first time you've heard about includes? Check our [includes tutorial](https://docs.sportmonks.com/v3/tutorials-and-guides/tutorials/includes).
{% endhint %}

<details>

<summary>Response</summary>

```javascript
{
  "data": {
    "id": 18535517,
    "sport_id": 1,
    "league_id": 501,
    "season_id": 19735,
    "stage_id": 77457866,
    "group_id": null,
    "aggregate_id": null,
    "round_id": 274719,
    "state_id": 5,
    "venue_id": 8909,
    "name": "Celtic vs Rangers",
    "starting_at": "2022-09-03 11:30:00",
    "result_info": "Celtic won after full-time.",
    "leg": "1/1",
    "details": null,
    "length": 90,
    "placeholder": false,
    "last_processed_at": "2023-03-02 17:47:38",
    "has_odds": true,
    "starting_at_timestamp": 1662204600,
    "lineups": [
      {
        "id": 296138906,
        "sport_id": 1,
        "fixture_id": 18535517,
        "player_id": 275,
        "team_id": 53,
        "position_id": 24,
        "formation_field": "1:1",
        "type_id": 11,
        "formation_position": 1,
        "player_name": "Joe Hart",
        "jersey_number": 1
      },
      {
        "id": 296138902,
        "sport_id": 1,
        "fixture_id": 18535517,
        "player_id": 173080,
        "team_id": 53,
        "position_id": 25,
        "formation_field": "2:4",
        "type_id": 11,
        "formation_position": 5,
        "player_name": "Greg Taylor",
        "jersey_number": 3
      },
      //And more
```

</details>

However, as you can see, the lineups only return player info by default: not the statistics. To retrieve the statistics, you need to add the nested include `.details` to your request. This results in the below request:

```javascript
https://api.sportmonks.com/v3/football/fixtures/18535517?api_token=YOUR_TOKEN&include=lineups.details
```

<details>

<summary>Response</summary>

```javascript
{
  "data": {
    "id": 18535517,
    "sport_id": 1,
    "league_id": 501,
    "season_id": 19735,
    "stage_id": 77457866,
    "group_id": null,
    "aggregate_id": null,
    "round_id": 274719,
    "state_id": 5,
    "venue_id": 8909,
    "name": "Celtic vs Rangers",
    "starting_at": "2022-09-03 11:30:00",
    "result_info": "Celtic won after full-time.",
    "leg": "1/1",
    "details": null,
    "length": 90,
    "placeholder": false,
    "last_processed_at": "2023-03-02 17:47:38",
    "has_odds": true,
    "starting_at_timestamp": 1662204600,
    "lineups": [
      {
        "id": 296138906,
        "sport_id": 1,
        "fixture_id": 18535517,
        "player_id": 275,
        "team_id": 53,
        "position_id": 24,
        "formation_field": "1:1",
        "type_id": 11,
        "formation_position": 1,
        "player_name": "Joe Hart",
        "jersey_number": 1,
        "details": [
          {
            "id": 285241740,
            "fixture_id": 18535517,
            "player_id": 275,
            "team_id": 53,
            "lineup_id": 296138906,
            "type_id": 118,
            "data": {
              "value": 7.75
            }
          },
          {
            "id": 285241742,
            "fixture_id": 18535517,
            "player_id": 275,
            "team_id": 53,
            "lineup_id": 296138906,
            "type_id": 116,
            "data": {
              "value": 31
            }
          },
 //And more
```

</details>

Just like with the other statistics include, you can add `.type` to your include to obtain the statistics' names:

```javascript
https://api.sportmonks.com/v3/football/fixtures/18535517?api_token=YOUR_TOKEN&include=lineups.details.type
```

<details>

<summary>Response</summary>

```javascript
{
  "data": {
    "id": 18535517,
    "sport_id": 1,
    "league_id": 501,
    "season_id": 19735,
    "stage_id": 77457866,
    "group_id": null,
    "aggregate_id": null,
    "round_id": 274719,
    "state_id": 5,
    "venue_id": 8909,
    "name": "Celtic vs Rangers",
    "starting_at": "2022-09-03 11:30:00",
    "result_info": "Celtic won after full-time.",
    "leg": "1/1",
    "details": null,
    "length": 90,
    "placeholder": false,
    "last_processed_at": "2023-03-02 17:47:38",
    "has_odds": true,
    "starting_at_timestamp": 1662204600,
    "lineups": [
      {
        "id": 296138906,
        "sport_id": 1,
        "fixture_id": 18535517,
        "player_id": 275,
        "team_id": 53,
        "position_id": 24,
        "formation_field": "1:1",
        "type_id": 11,
        "formation_position": 1,
        "player_name": "Joe Hart",
        "jersey_number": 1,
        "details": [
          {
            "id": 285241740,
            "fixture_id": 18535517,
            "player_id": 275,
            "team_id": 53,
            "lineup_id": 296138906,
            "type_id": 118,
            "data": {
              "value": 7.75
            },
            "type": {
              "id": 118,
              "name": "Rating",
              "code": "rating",
              "developer_name": "RATING",
              "model_type": "statistic",
              "stat_group": "overall"
            }
          },
  //And more
```

</details>

Please check the response carefully to see the correct values with the types.&#x20;

{% hint style="danger" %}
Including `.type` is not recommended as an include on any endpoint. Types are used throughout the entire API. We recommend retrieving all types from the types endpoint and storing them in your database or other data structure. Only include the type if no other option is available or when testing the API.
{% endhint %}

### Filtering player fixture statistics

What if you're only interested in specific statistics like passes? To filter your request, you need to:

1. Add the parameter `&filters=`&#x20;
2. Select the entity you want to filter on&#x20;
3. Select the field you want to filter on&#x20;
4. Fill in the IDs you're interested in

Let's say you're only interested in the passes. In our case, this will result in the following steps:

1. Add the parameter `&filters=`&#x20;
2. Select the entity you want to filter on: `lineupDetail`
3. Select the field you want to filter on: `Types` (the statistics types)&#x20;
4. Fill in the IDs you're interested in: `80` (You can retrieve them via the Types endpoint or by looking at the previous request)&#x20;

It's important to note that you can retrieve statistics from multiple entities. Therefore, you also need to specify for which entity you want to filter the statistics. You can do this by prefixing the filter with the entity's name. So in our case: `lineupDetail`

```javascript
https://api.sportmonks.com/v3/football/fixtures/18535517?api_token={your_token}&include=lineups.details.type&filters=lineupDetailTypes:80
```

<details>

<summary>Response</summary>

```javascript
{
  "data": {
    "id": 18535517,
    "sport_id": 1,
    "league_id": 501,
    "season_id": 19735,
    "stage_id": 77457866,
    "group_id": null,
    "aggregate_id": null,
    "round_id": 274719,
    "state_id": 5,
    "venue_id": 8909,
    "name": "Celtic vs Rangers",
    "starting_at": "2022-09-03 11:30:00",
    "result_info": "Celtic won after full-time.",
    "leg": "1/1",
    "details": null,
    "length": 90,
    "placeholder": false,
    "last_processed_at": "2023-03-02 17:47:38",
    "has_odds": true,
    "starting_at_timestamp": 1662204600,
    "lineups": [
      {
        "id": 296138906,
        "sport_id": 1,
        "fixture_id": 18535517,
        "player_id": 275,
        "team_id": 53,
        "position_id": 24,
        "formation_field": "1:1",
        "type_id": 11,
        "formation_position": 1,
        "player_name": "Joe Hart",
        "jersey_number": 1,
        "details": [
          {
            "id": 285241743,
            "fixture_id": 18535517,
            "player_id": 275,
            "team_id": 53,
            "lineup_id": 296138906,
            "type_id": 80,
            "data": {
              "value": 34
            },
            "type": {
              "id": 80,
              "name": "Passes",
              "code": "passes",
              "developer_name": "PASSES",
              "model_type": "statistic",
              "stat_group": "overall"
            }
          }
        ]
      },
      {
        "id": 296138902,
        "sport_id": 1,
        "fixture_id": 18535517,
        "player_id": 173080,
        "team_id": 53,
        "position_id": 25,
        "formation_field": "2:4",
        "type_id": 11,
        "formation_position": 5,
        "player_name": "Greg Taylor",
        "jersey_number": 3,
        "details": [
          {
            "id": 285241760,
            "fixture_id": 18535517,
            "player_id": 173080,
            "team_id": 53,
            "lineup_id": 296138902,
            "type_id": 80,
            "data": {
              "value": 46
            },
            "type": {
              "id": 80,
              "name": "Passes",
              "code": "passes",
              "developer_name": "PASSES",
              "model_type": "statistic",
              "stat_group": "overall"
            }
          }
        ]
      },
  //And more
```

</details>

Want to combine the match and player stats? Easy, add the extra includes:

```javascript
https://api.sportmonks.com/v3/football/fixtures/18535517?api_token=YOUR_TOKEN&include=statistics.type;lineups.details.type
```

Want to filter it?&#x20;

```javascript
https://api.sportmonks.com/v3/football/fixtures/18535517?api_token=YOUR_TOKEN&include=statistics.type;lineups.details.type&filters=lineupDetailTypes:80,119,116;fixtureStatisticTypes:86,78
```

{% hint style="info" %}
Are you only interested in the name of the type? Use our [select](https://docs.sportmonks.com/v3/api/request-options/selecting-fields) functionality: `https://api.sportmonks.com/v3/football/fixtures/18535517?api_token=`YOUR\_TOKEN`&include=statistics.type:name;lineups.details.type:name&filters=lineupDetailTypes:80,119,116;fixtureStatisticTypes:86,78`
{% endhint %}

### See also

#### Prerequisites

* [Statistics Types](https://docs.sportmonks.com/v3/tutorials-and-guides/tutorials/statistics/statistics-types) - Understand what `type_id` represents
* [Includes Tutorial](https://docs.sportmonks.com/v3/tutorials-and-guides/tutorials/includes) - Learn how includes work

#### Reference

* [Statistics Types List](https://docs.sportmonks.com/v3/definitions/types/statistics) - Complete list of all statistic type IDs (shots, tackles, possession, etc.)
* [Fixture Statistics Endpoint](https://docs.sportmonks.com/v3/endpoints-and-entities/endpoints/fixtures) - API endpoint reference

#### Related Tutorials

* [Season Statistics](https://docs.sportmonks.com/v3/tutorials-and-guides/tutorials/statistics/season-statistics) - League-wide statistics
* [Player Statistics](https://docs.sportmonks.com/v3/tutorials-and-guides) - Individual player stats from fixtures
* [Filter and Select Fields](https://docs.sportmonks.com/v3/tutorials-and-guides/tutorials/filter-and-select-fields) - Filter by specific statistic types
