Injury Effect API#
The following describes how to retrieve team injury effect predictions through the Quarter4 REST APIs.
Using the REST API to query for Injury Effect Simulations#
Related APIS
Method | Description | Availability |
---|---|---|
POST |
/{sport}/v2/injury_effects |
NFL NBA NHL NCAAM |
The injury effect api allows queries against the Quarter4 team prediction effect models. These output team specific win/loss predictions based on the selected teams and players. By comparing results, specific player impacts can be observed when adding and/or removing players from the active rosters.
When specifying players, changes can include:
- setting the player's injury status.
To retrieve results by API, first, start by building a POST request body using two teams and the associated player modifications. The teams and players are identified by their Quarter4 UUIDs and each player must indicate an injury status of 0
for playing, or 1
for injured:
{
"home": {
"players": [
{
"injured": 0,
"uuid": "e14c0673-6cc2-4be5-ba47-354f990c884f"
},
{
"injured": 0,
"uuid": "37b8d8ff-ab4b-4962-a518-761325e5ebb7"
}
],
"uuid": "c023d5ce-83ec-4263-8662-1f411058d8de"
},
"away": {
"players": [
{
"injured": 0,
"uuid": "a71662d8-7b23-435f-8dc4-74f5d896c55f"
}
],
"uuid": "499a829d-e18d-4b3a-81a8-7aad418fef95"
}
}
The body must have both a home
and away
element that reflect the two teams. The players
attribute is the list of modifications you would like to make to the existing roster.
Current roster and depth charts will be used to fill in the remaining players.
Sending this body as a POST request to https://api.quarter4.io/american-football/v2/injury_effects
will return the team predictions for the matchup. For example tthe response wil contain an InjuryEffect entity such as:
{
"data": {
"id": "\/american-football\/v2\/injury_effects\/dd2afa39-3593-4f8c-bd27-18839e8232ae",
"type": "InjuryEffect",
"attributes": {
"uuid": "dd2afa39-3593-4f8c-bd27-18839e8232ae",
"homeWinProbability": 0.5159029960632324,
"awayWinProbability": 0.4840970039367676,
"probability": 0.5159029960632324,
"winnerUuid": "c023d5ce-83ec-4263-8662-1f411058d8de",
"loserUuid": "499a829d-e18d-4b3a-81a8-7aad418fef95"
}
}
}
By running multiple requests with varying inputs you can build a comparison of the home and away win probabilities and impact across changes.
The response may take a bit of time depending on the number of players selected as the machine learning engine must process the simulated events to determine the proper predictions for the event.
Tip
To get a list of current injured players in the league and/or team, you can use the /{sport}/v2/injuries
endpoint. For example, to get the current list of injured players for the Baltimore Ravens along with each player's information use:
GET https://api.quarter4.io/american-football/v2/injuries?count=50&team.uuid=35ef4f9f-b3d4-4e62-bc0a-1541e2370972&include=team,player
and, to get the current active roster for the Baltimore Ravens you can use the /{sport}/v2/teams/{team_uuid}
endpoint:
GET https://api.quarter4.io/american-football/v2/teams/35ef4f9f-b3d4-4e62-bc0a-1541e2370972?include=currentPlayers
Using the O.D.D.S. Dashboard UI to query for Injury Effect Simulations#
The API results above can also be viewed using your O.D.D.S. Dashboard. For example, to preview the results, check your O.D.D.S Dashboard > NFL > Predictions > Player Effect and look at the team win%.
Warning
The dashboard baseline user interface automatically activates all players on the roster including injured players.
As a result, the baseline report is as if all players were playing in the game. Comparing that to the API response above, this would be the equivalent to passing all the currently injured players as "active".
For example, an API query that passes no changes such as this:
{
"home": {
"players": [
],
"uuid": "c023d5ce-83ec-4263-8662-1f411058d8de"
},
"away": {
"players": [
],
"uuid": "499a829d-e18d-4b3a-81a8-7aad418fef95"
}
}
is not the same as the "baseline" on the dashboard tool. The baseline on the dashboard tool would include all the injuries as active (injured:0
):
{
"home": {
"players": [
{
"injured": 0,
"uuid": "e14c0673-6cc2-4be5-ba47-354f990c884f"
},
{
"injured": 0,
"uuid": "37b8d8ff-ab4b-4962-a518-761325e5ebb7"
}
],
"uuid": "c023d5ce-83ec-4263-8662-1f411058d8de"
},
"away": {
"players": [
{
"injured": 0,
"uuid": "a71662d8-7b23-435f-8dc4-74f5d896c55f"
}
],
"uuid": "499a829d-e18d-4b3a-81a8-7aad418fef95"
}
}
Note
For a specific player's effect on other players in the game, see the Player Effect API.