States

What does the include do?

The state include allows you to retrieve comprehensive information about the current state of a fixture. The state indicates the exact phase of the match - whether it's scheduled, live, finished, postponed, cancelled, or in any other specific state. This is essential for properly displaying match status and handling different scenarios in your application.

Why use states?

The state include is crucial for:

  • Match status display: Show accurate status (Live, Finished, Postponed, etc.)

  • Real-time filtering: Filter fixtures by state (e.g., show only live matches)

  • Notification systems: Trigger alerts when matches change state

  • Data synchronisation: Know when to refresh match data

  • Error handling: Handle postponed, cancelled, or interrupted matches

  • User experience: Provide contextual information based on match state

Requesting states

To retrieve state information for a fixture, use the following include:

https://api.sportmonks.com/v3/football/fixtures
?api_token=YOUR_TOKEN&include=state

Or for a specific fixture:

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

Response structure

When you include state in your request, you'll receive a state object:

Field descriptions

Field
Type
Description

id

integer

Unique identifier for this state

state

string

Short code for the state (e.g., "FT", "LIVE", "NS")

name

string

Full descriptive name of the state

short_name

string

Short display name for the state

developer_name

string

Programming-friendly name (uppercase, underscores)

Complete list of fixture states

ID
State Code
Name
Description

1

NS

Not Started

The initial status of a fixture.

2

INPLAY_1ST_HALF

1st Half

The game is in play (first half).

3

HT

Half Time

Match is at half time break

4

BREAK

Regular Time Finished

Waiting for extra time to start.

5

FT

Full Time

The game ended after 90 minutes. When going to extra time, this appears briefly before BREAK.

6

INPLAY_ET

Extra Time

Extra time (first half) is in progress.

7

AET

Finished After Extra Time

The match has ended after 120 minutes.

8

FT_PEN

Full-Time After Penalties

The match finished following a penalty shootout.

9

INPLAY_PENALTIES

Penalty Shootout

Penalties are being taken to decide the winner.

10

POSTPONED

Postponed

The match has been postponed to another date.

11

SUSPENDED

Suspended

The match is suspended and will continue later.

12

CANCELLED

Cancelled

The match has been permanently cancelled.

13

TBA

To Be Announced

Fixture has no confirmed date/time yet.

14

WO

Walk Over

A victory was awarded because no opponent was available.

15

ABANDONED

Abandoned

The match was abandoned and will resume later.

16

DELAYED

Delayed

Kick-off has been delayed.

17

AWARDED

Awarded

Winner decided externally (administrative decision).

18

INTERRUPTED

Interrupted

Temporarily stopped (e.g., bad weather).

19

AU

Awaiting Updates

Temporary state due to data or connectivity delay.

20

DELETED

Deleted

The fixture is no longer active in standard calls but can still be fetched with deleted=1.

21

EXTRA_TIME_BREAK

Extra Time Break

Short break between extra time halves.

22

INPLAY_2ND_HALF

2nd Half

The game is in play (second half).

25

PEN_BREAK

Penalties Break

Waiting for penalties to start.

26

PENDING

Pending

The fixture awaits new data or verification.

State transitions and flow

Understanding how states transition is crucial for building robust applications:

Normal match flow

From
To
Trigger
Description

NS

LIVE

Match starts

Game begins (1st half)

LIVE

HT

Half-time whistle

Match reaches half-time break

HT

LIVE

2nd half starts

Second half commences

LIVE

FT

Full-time whistle

Match concludes after 90 minutes

Match with extra time

From
To
Trigger
Description

FT

ET

Extra time starts

Game continues after full-time

ET

BREAK

1st half of extra time ends

Extra time break/half-time

BREAK

ET

Extra time 2nd half starts

Second half of extra time

ET

AET

Extra time concludes

Match finished after extra time

Match with penalties

From
To
Trigger
Description

AET

PEN_LIVE

Penalties start

Penalty shootout begins

PEN_LIVE

FT_PEN

Shootout complete

Match decided by penalties

Problem states

From
To
Trigger
Description

NS

DELAYED

Issues arise

Match start delayed

DELAYED

LIVE

Delay resolved

Match eventually starts

DELAYED

POSTP

Cannot resume

Match postponed to another date

POSTP

NS

Rescheduled

Match rescheduled for later date

NS

CANCL

Match cancelled

Final state - no further transitions

LIVE

INT

Issues during match

Match interrupted (weather, crowd, etc.)

INT

LIVE

Issues resolved

Match resumes

LIVE

SUSP

Match suspended

Match temporarily suspended

SUSP

LIVE

Suspension lifted

Match resumes after suspension

LIVE

ABAN

Match abandoned

Final state - match abandoned

Filtering by state

To filter fixtures based on specific states, use the filters parameter:

Filter for multiple states:

Common Filter Scenarios

Get only live matches:

States: INPLAY_1ST_HALF (2), INPLAY_2ND_HALF (22), INPLAY_ET (6), PEN_LIVE (7)

Get finished matches:

States: FT (5), AET (7), FT_PEN (8)

Get problem matches:

States: CANCELLED (12), ABANDONED (15), DELAYED (16), AWARDED (17), INTERRUPTED (18)

Nested includes

state.type

Get detailed type information for the state:

This returns additional type metadata (though state itself is typically sufficient).

Code examples

Python example

JavaScript Example

Common use cases

1. Live match filtering

Show only matches that are currently live:

2. State-based notifications

Send notifications when states change:

3. Data refresh strategy

Determine when to refresh data based on state:

Best practices

  1. Always include state for fixtures: State is essential for proper match display and handling.

  2. Use state IDs, not names: State IDs are more reliable than text names which may change.

  3. Handle problem states gracefully: Show appropriate messages for postponed, cancelled, or interrupted matches.

  4. Filter efficiently: Use state filters in API requests rather than filtering after fetching.

  5. Monitor state transitions: For live applications, track when states change to trigger updates.

  6. Cache finished matches: Once a match reaches FT/AET/FT_PEN, its state won't change.

  7. Consider ALL live states: Don't just check for state ID 2 (INPLAY_1ST_HALF). Include extra time (6) and penalties (9).

  • Periods - Period information complements state data

  • Events - Event data should be interpreted with state context

  • Scores - Scores are most meaningful with state information

Summary

The state include provides essential match status information with 21 different states covering all possible fixture scenarios from scheduled to finished, including problem states like postponed and cancelled. Understanding state transitions and using state-based filtering enables robust match tracking, proper data refresh strategies, and excellent user experiences. Always check state before displaying match data or determining refresh intervals.

Last updated

Was this helpful?