# \<sport\_event\_status>

#### About \<sport\_event\_status> <a href="#uofapi-less-than-sport_event_status-greater-than-about-less-than-sport_event_status-greater-than" id="uofapi-less-than-sport_event_status-greater-than-about-less-than-sport_event_status-greater-than"></a>

The \<sport\_event\_status> element provides information related to the status of the match and can be retrieved mainly in the summary and timeline endpoints.

The following table describes the sport event's 'status' attributes in detail:

<table data-header-hidden><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><strong>State</strong></td><td><strong>Description</strong></td></tr><tr><td><pre><code>not_started
</code></pre></td><td>The match has not started yet. (Alternatively, Betradar has no live coverage of the event, the match has started but we do not know this. The match will then move to closed when Betradar enters the match results)</td></tr><tr><td><pre><code>live
</code></pre></td><td>The match is live</td></tr><tr><td><pre><code>ended
</code></pre></td><td>The match has finished, but results have not been confirmed yet.</td></tr><tr><td><pre><code>closed
</code></pre></td><td>The match is finished, results confirmed, and no more changes are expected to the results (only for events covered by pre-match producer).</td></tr><tr><td><pre><code>cancelled
</code></pre></td><td>The sport event (either the actual match, or this Betradar representation of the match) has been cancelled</td></tr><tr><td><pre><code>delayed
</code></pre></td><td>The sport event start has been delayed from scheduled start (most often seen for tennis).</td></tr><tr><td><pre><code>interrupted
</code></pre></td><td>The sport event has been temporarily interrupted. Interruption is expected to be just a few minutes.</td></tr><tr><td><pre><code>suspended
</code></pre></td><td>The sport event looks to be interrupted for a longer period than a few minutes</td></tr><tr><td><pre><code>postponed
</code></pre></td><td>The sport event has been postponed and will be played at a later date. Typically, if the later date is more than 3 days away. This sport event id will be cancelled and replaced by a new id. If the match is postponed to just one or two days from now, the same sport-id will change its state just before match start.</td></tr><tr><td><pre><code>abandoned 
</code></pre></td><td>Used to indicate that Betradar has no live coverage or has lost live coverage but match is still likely ongoing.</td></tr></tbody></table>

**sport\_event\_status in AMQP Feed Vs API Endpoint**

Before providing a description of its attributes, it is important to make a distinction between the sport event status provided in the AMQP feed and the one provided in the endpoints.

**Note:** The top 4 states (not\_started, live, ended, closed) are the only event statuses that are being sent out in the odds\_change message. The rest of the states are only available in the API.

**Relationship to odds\_change sport\_event\_status**

Since API can be slightly delayed compared to the AMQP odds\_change message, it is recommended that you give priority to the status provided in the AMQP odds\_change message. (Here, AMQP>API)

When providing live odds for a live match, the odds\_change message normally contains the sport\_event\_status element to provide an accurate representation of what the status was of the match when the odds were generated.

Due to caching and timing differences, the API and the odds\_change message may temporarily report different values. For live matches the status as reported in the odds\_change should always be used if available. The API is more likely to lag behind the odds\_change message, but it could occasionally be ahead (The difference should always be less than a handful of seconds).

**The difference**

The odds\_change message represents statuses using integer codes due to performance reasons, whereas in the API string representations of the statuses are provided for clarity. However, the meaning of the states is the same. In particular, for the status attribute the odds\_change message uses only a few of the possible states available in the API, so the states in the API is a superset of those used in the odds\_change message. The states not used in odds\_change are typically stopped states where no live odds are provided, and hence no odds\_change messages sent (states such as delayed, interrupted, postponed, cancelled, etc.).

Another important difference between the odds\_change message and the API is that the odds\_change message represents statuses using an integer code as shown below:

<figure><img src="https://1868790214-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1KlIQPveu0EGYCTI8DL1%2Fuploads%2FH4hckSBciNlMxNVrJ2WT%2FAPI%20sport-event-status.png?alt=media&#x26;token=00652e69-6248-47b1-8394-5c726c6058f7" alt=""><figcaption></figcaption></figure>

AggregateHomeScore/Away event

The *aggregate\_home\_score* and *aggregate\_away\_score* is present for two-legged ties (i.e. soccer). *aggregate\_\*\_score* represents the total score for each team, summing up the results of the first and second match. Please note that *aggregate\_\*\_score* is only present in the **second** match of the two-legged-tie-series

#### Sport event status in the API <a href="#uofapi-less-than-sport_event_status-greater-than-sporteventstatusintheapi" id="uofapi-less-than-sport_event_status-greater-than-sporteventstatusintheapi"></a>

Sport Event Status is an element provided in the summary and timeline endpoints in the API. *Status* is the only required attribute, this attribute describes the current status of the sport-event itself. This element contains the high-level status of the match including status, score etc.

**Note**: Sometimes live-only matches will never get the *status* element set to status=”closed” in the API, they will stay in status=”ended”. This is because matches are put in “closed” when production has prematch-resulted these matches. So therefor, if they are only live covered ([see scope of the producers](https://docs.sportradar.com/uof/introduction/key-concepts/producers)), they will never be “closed”, only “ended”.

**Live and resulting information**

Live Informatio&#x6E;**:** Live match information reports the current information about a particular ongoing match (only matches with status live, suspended, or ended should be here – status in closed could be temporarily present here).

Results information: Results information provides the same information as for live information, but only when the status of the match is closed (ID 4): sport\_event\_status status=**"4”**.

#### XML Example <a href="#uofapi-less-than-sport_event_status-greater-than-xmlexample" id="uofapi-less-than-sport_event_status-greater-than-xmlexample"></a>

```xml
<sport_event_status home_score="130" away_score="122" status_code="4" match_status_code="110" status="closed" match_status="aet" winner_id="sr:competitor:3433">
      <period_scores>
        <period_score home_score="27" away_score="30" match_status_code="13" type="regular_period" number="1"/>
        <period_score home_score="29" away_score="31" match_status_code="14" type="regular_period" number="2"/>
        <period_score home_score="32" away_score="25" match_status_code="15" type="regular_period" number="3"/>
        <period_score home_score="29" away_score="31" match_status_code="16" type="regular_period" number="4"/>
        <period_score home_score="13" away_score="5" match_status_code="40" type="overtime" number="5"/>
      </period_scores>
      <results>
        <result home_score="117" away_score="117" match_status_code="100"/>
        <result home_score="130" away_score="122" match_status_code="110"/>
      </results>
</sport_event_status>
```

#### Attributes Explained <a href="#uofapi-less-than-sport_event_status-greater-than-attributesexplained" id="uofapi-less-than-sport_event_status-greater-than-attributesexplained"></a>

The following table shows all the possible attributes of the sport\_event\_status element in the API

| Attribute             | Meaning                                                                                                                                                              | Possible values                                                                                                                                       |
| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| *status*              | provides information related to the status of the match                                                                                                              | not\_started, match\_about\_to\_start, postponed, delayed, cancelled, interrupted, suspended, abandoned, retired, ended, aet, match\_after\_penalties |
| *home\_score*         | provides score of the home team                                                                                                                                      | numeric value                                                                                                                                         |
| *away\_score*         | provides score of the away team                                                                                                                                      | numeric value                                                                                                                                         |
| *winner\_id*          | provides info about who the winner is                                                                                                                                | <p>string</p><p>example: "sr:competitor: 6237"</p>                                                                                                    |
| *status\_code*        | 0, 22, 60, 61, 70, 80, 81, 90, 92, 100, 110, 120  (correspondence between status and status\_code is reported in table below in the section dedicated to the status) | numeric value                                                                                                                                         |
| *match\_status\_code* | see dedicated paragraph below                                                                                                                                        | <p><br></p>                                                                                                                                           |

<br>

**status Attribute**

The status attribute is an enumeration in the API and has a finite set of states as outlined in the state diagram below:

Going more into the detail of the status possible values:

| Value of 'status' attribute | Description                                                                                                                                                                                                                                                                                                                |
| --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Value of 'status' attribute | Description                                                                                                                                                                                                                                                                                                                |
| *not\_started*              | match not started yet                                                                                                                                                                                                                                                                                                      |
| *match\_about\_to\_start*   | match about to start                                                                                                                                                                                                                                                                                                       |
| *postponed*                 | The sport event has been postponed and will be played at a later date. Tipically, if the later date is more than 3 days away, this sport event will be cancelled and replaced by a new id. If the match is postponed to just one or 2 days from now, the same sport id will change its state just before the match starts. |
| *delayed*                   | The sport event has been delayed from scheduled start (most often seen for tennis)                                                                                                                                                                                                                                         |
| *cancelled*                 | The sport event (either the actual match, or sportradar representation ) has been cancelled.                                                                                                                                                                                                                               |
| *interrupted*               | The sport event has been temporarily interrupted. Interruption is expected to be just a few minutes. Longer interruptions may lead to a match being suspended or possibly postponed.                                                                                                                                       |
| *suspended*                 | The sport event looks to be interrupted for a longer period than just a few minutes.                                                                                                                                                                                                                                       |
| *abandoned*                 | Used to indicate that Betradar has no live coverage ut match is still likely ongoing.                                                                                                                                                                                                                                      |
| *retired*                   | <p><br></p>                                                                                                                                                                                                                                                                                                                |
| *ended*                     | Match is over                                                                                                                                                                                                                                                                                                              |
| *aet*                       | Match has ended after extra time                                                                                                                                                                                                                                                                                           |
| *match\_after\_penalties*   | Match has ended with penalties                                                                                                                                                                                                                                                                                             |
| *closed*                    | The match is over, results are confirmed, no more changes are expected to the results.                                                                                                                                                                                                                                     |

Sometimes live-only matches will never get the status attribute set to status "closed", they will just stay in "ended" in the API. This is because matches are put in "Closed" when production has prematch-resulted these matches therefore, if the matches are only live covered, then they will never be "closed", only "ended".

**Correspondence between 'status' and 'status\_code' Attributes**

| *status*                  | *status\_code* |
| ------------------------- | -------------- |
| *not\_started*            | *0*            |
| *match\_about\_to\_start* | *22*           |
| *postponed*               | *60*           |
| *delayed*                 | *61*           |
| *cancelled*               | *70*           |
| *interrupted*             | *80*           |
| *suspended*               | *81*           |
| *abandoned*               | *90*           |
| *retired*                 | *92*           |
| *ended*                   | *100*          |
| *aet*                     | *110*          |
| *match\_after\_penalties* | *120*          |
| *closed*                  | <p><br></p>    |

**match\_status\_code Attribute**

The match\_status\_code is an attribute which describes the phase the match is into and is different  according to the sport taken into consideration.

The attached excel provides all possible values and meaning for the match\_status\_code:

{% file src="<https://1868790214-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1KlIQPveu0EGYCTI8DL1%2Fuploads%2Fn98wl3suT1CnHf5stYjW%2Fmatch_status_codes.ods?alt=media&token=927e5a2c-436c-40de-90f3-05f7a58070e0>" %}
match\_status\_codes.ods
{% endfile %}
