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=stateOr for a specific fixture:
https://api.sportmonks.com/v3/football/fixtures/{fixture_id}
?api_token=YOUR_TOKEN&include=stateResponse structure
When you include state in your request, you'll receive a state object:
Field descriptions
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
1
NS
Not Started
Fixture is scheduled but hasn't begun
2
LIVE
Live
Match is currently in progress (1st half)
3
HT
Half Time
Match is at half time break
4
FT
Full Time
Match has finished (90 minutes completed)
5
FT
Full Time
Match finished after regular time
6
AET
After Extra Time
Match finished after extra time
7
PEN_LIVE
Penalty Shootout Live
Penalty shootout in progress
8
FT_PEN
Full Time (Penalties)
Match decided by penalties
9
BREAK
Break Time
Extra time break
10
ET
Extra Time
Extra time in progress
11
AWARDED
Awarded
Winner decided externally (walkover)
12
CANCL
Cancelled
Match cancelled before starting
13
POSTP
Postponed
Match postponed to another date
14
INT
Interrupted
Match interrupted (weather, crowd issues)
15
ABAN
Abandoned
Match abandoned after starting
16
SUSP
Suspended
Match suspended temporarily
17
DELAYED
Delayed
Match start delayed
18
TBA
To Be Announced
Schedule not confirmed
19
AU
Awaiting Updates
Waiting for data updates
21
Deleted
Deleted
Fixture removed from API
State transitions and flow
Understanding how states transition is crucial for building robust applications:
Normal match flow
Match with extra time
Match with penalties
Problem states
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: LIVE (2), ET (10), PEN_LIVE (7)
Get finished matches:
States: FT (5), AET (6), FT_PEN (8)
Get problem matches:
States: SUSP (11), CANCELLED (12), ABANDONED (15), DELAYED (16), 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
Always include state for fixtures: State is essential for proper match display and handling.
Use state IDs, not names: State IDs are more reliable than text names which may change.
Handle problem states gracefully: Show appropriate messages for postponed, cancelled, or interrupted matches.
Filter efficiently: Use state filters in API requests rather than filtering after fetching.
Monitor state transitions: For live applications, track when states change to trigger updates.
Cache finished matches: Once a match reaches FT/AET/FT_PEN, its state won't change.
Consider ALL live states: Don't just check for state ID 2 (LIVE). Include extra time (10) and penalties (7).
Related includes
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?