# Match Stats API

This REST API endpoint returns the final aggregated match stats packet in a single URL call (which are typically delivered in the 'Live match Statistics' websocket). These stats are delivered in the API call at the **END** of the fixture.

The data contained will include all team and player aggregated stats happening within the soccer match - this will include; goals, cards, corners, shots and more. For a list of all match stats that are supported, as well as definitions of these actions, please see the following documentation page: [Live Match Statistics](https://docs.sportradar.com/soccer-media/stream-endpoints-websocket/live-match-statistics).&#x20;

## Endpoint URL

**<https://dde-api.data.imgarena.com/soccer/fixtures/{fixtureId}/statistics>**

N.B. – Please insert the relevant fixtureId returned from the fixtures API endpoint to return the data. The authentication token provided will be required to make a connection to this WebSocket endpoint.

## Polling Frequency

We recommend the following frequency for your REST requests to ensure that you have the most up-to-date information at all times:

| REST Endpoint                             | Frequency       | Description                                                                        |
| ----------------------------------------- | --------------- | ---------------------------------------------------------------------------------- |
| `/soccer/fixtures/{fixtureId}/statistics` | Once post match | Updated at the end of each match with the full list of team and player match stats |

## Required Headers

| Key           | Value                                            |
| ------------- | ------------------------------------------------ |
| Accept        | application/vnd.imggaming.dde.api+json;version=1 |
| Content-Type  | application/json                                 |
| Authorization | Bearer eyvhaoudfgpdfgo\*                         |

## Response Model

Please see the live actions websocket 'Response Model' section to understand the stats, definitions. Below is also a small snippet of the JSON schema

```
{
    "seqNum": 610,
    "version": 1,
    "finished": true,
    "fixtureId": "b5a73497-acc3-499d-8241-ba278ebd5985",
    "timestamp": "2022-11-06T13:48:41.518764100Z",
    "teamActionAggregates": [
        {
            "team": {
                "id": "d2da63e1-6604-4dfd-85e3-b0ae4293acef",
                "name": "FC Fredericia"
            },
            "gameActionAggregates": [
                {
                    "action": "Kick Off",
                    "actionId": 121,
                    "actionAggregate": 6,
                    "subActionAggregates": []
                },
                {
                    "action": "Safe",
                    "actionId": 101,
                    "actionAggregate": 62,
                    "subActionAggregates": []
                },
                {
                    "action": "Goal Kick",
                    "actionId": 109,
                    "actionAggregate": 8,
                    "subActionAggregates": []
                },
                {
                    "action": "Attack",
                    "actionId": 102,
                    "actionAggregate": 62,
                    "subActionAggregates": []
                },
                {
                    "action": "Dangerous Attack",
                    "actionId": 103,
                    "actionAggregate": 40,
                    "subActionAggregates": []
                },
                {
                    "action": "Corner Awarded",
                    "actionId": 127,
                    "actionAggregate": 5,
                    "subActionAggregates": []
                },
                {
                    "action": "Corner Taken",
                    "actionId": 108,
                    "actionAggregate": 5,
                    "subActionAggregates": []
                },
                {
                    "action": "Shot",
                    "actionId": 111,
                    "actionAggregate": 8,
                    "subActionAggregates": [
                        {
                            "subAction": "Wide/Over (Off Target)",
                            "subActionId": 11105,
                            "subActionAggregate": 4
                        },
                        {
                            "subAction": "On Target",
                            "subActionId": 11102,
                            "subActionAggregate": 2
                        },
                        {
                            "subAction": "Blocked",
                            "subActionId": 11103,
                            "subActionAggregate": 2
                        }
                    ]
                },
                {
                    "action": "Free Kick",
                    "actionId": 118,
                    "actionAggregate": 7,
                    "subActionAggregates": []
                },
                {
                    "action": "Offside",
                    "actionId": 110,
                    "actionAggregate": 5,
                    "subActionAggregates": []
                },
                {
                    "action": "Throw In Awarded",
                    "actionId": 126,
                    "actionAggregate": 20,
                    "subActionAggregates": []
                },
                {
                    "action": "Throw In Taken",
                    "actionId": 113,
                    "actionAggregate": 19,
                    "subActionAggregates": []
                },
                {
                    "action": "Yellow Card",
                    "actionId": 107,
                    "actionAggregate": 3,
                    "subActionAggregates": []
                },
                {
                    "action": "Dangerous Free Kick",
                    "actionId": 115,
                    "actionAggregate": 3,
                    "subActionAggregates": []
                }
            ],
            "periodActionAggregates": [
                {
                    "period": 1,
                    "aggregates": [
                        {
                            "action": "Kick Off",
                            "actionId": 121,
                            "actionAggregate": 4,
                            "subActionAggregates": []
                        },
                        {
                            "action": "Safe",
                            "actionId": 101,
                            "actionAggregate": 33,
                            "subActionAggregates": []
                        },
                        {
                            "action": "Goal Kick",
                            "actionId": 109,
                            "actionAggregate": 6,
                            "subActionAggregates": []
                        },
                        {
                            "action": "Attack",
                            "actionId": 102,
                            "actionAggregate": 33,
                            "subActionAggregates": []
                        },
                        {
                            "action": "Dangerous Attack",
                            "actionId": 103,
                            "actionAggregate": 20,
                            "subActionAggregates": []
                        },
                        {
                            "action": "Corner Awarded",
                            "actionId": 127,
                            "actionAggregate": 4,
                            "subActionAggregates": []
                        },
                        {
                            "action": "Corner Taken",
                            "actionId": 108,
                            "actionAggregate": 4,
                            "subActionAggregates": []
                        },
                        {
                            "action": "Shot",
                            "actionId": 111,
                            "actionAggregate": 5,
                            "subActionAggregates": [
                                {
                                    "subAction": "Wide/Over (Off Target)",
                                    "subActionId": 11105,
                                    "subActionAggregate": 2
                                },
                                {
                                    "subAction": "On Target",
                                    "subActionId": 11102,
                                    "subActionAggregate": 1
                                },
                                {
                                    "subAction": "Blocked",
                                    "subActionId": 11103,
                                    "subActionAggregate": 2
                                }
                            ]
                        },
                        {
                            "action": "Free Kick",
                            "actionId": 118,
                            "actionAggregate": 3,
                            "subActionAggregates": []
                        },
                        {
                            "action": "Offside",
                            "actionId": 110,
                            "actionAggregate": 5,
                            "subActionAggregates": []
                        },
                        {
                            "action": "Throw In Awarded",
                            "actionId": 126,
                            "actionAggregate": 11,
                            "subActionAggregates": []
                        },
                        {
                            "action": "Throw In Taken",
                            "actionId": 113,
                            "actionAggregate": 11,
                            "subActionAggregates": []
                        },
                        {
                            "action": "Yellow Card",
                            "actionId": 107,
                            "actionAggregate": 1,
                            "subActionAggregates": []
                        },
                        {
                            "action": "Dangerous Free Kick",
                            "actionId": 115,
                            "actionAggregate": 1,
                            "subActionAggregates": []
                        }
```
