Skip to content

Retrieving Pre-Game Event Predictions#

In the following example you will retrieve the upcoming event predictions for the next NFL game.

Related APIS

Method Description Availability
GET /{sport}/v2/events All Leagues
GET /{sport}/v2/win_losses All Leagues

Start By querying the /{sport}/v2/events endpoint for the next available game in the NFL. Filter by league.uuid, startDate and order:

GET https://api.quarter4.io/american-football/v2/events?startDate[after]=now&order[startDate]=asc&league.uuid=38344248-9889-11eb-a8ab-0647cdb505d0&page=1&count=1

This result contains a list of upcoming events (here limited to 1 due to the count query parameter). For example:

{
  "links": {
    "self": "\/american-football\/v2\/events?count=1\u0026include=winloss\u0026league.uuid=38344248-9889-11eb-a8ab-0647cdb505d0\u0026order%5BstartDate%5D=asc\u0026startDate%5Bafter%5D=now\u0026page=1",
    "first": "\/american-football\/v2\/events?count=1\u0026include=winloss\u0026league.uuid=38344248-9889-11eb-a8ab-0647cdb505d0\u0026order%5BstartDate%5D=asc\u0026startDate%5Bafter%5D=now\u0026page=1",
    "last": "\/american-football\/v2\/events?count=1\u0026include=winloss\u0026league.uuid=38344248-9889-11eb-a8ab-0647cdb505d0\u0026order%5BstartDate%5D=asc\u0026startDate%5Bafter%5D=now\u0026page=256",
    "next": "\/american-football\/v2\/events?count=1\u0026include=winloss\u0026league.uuid=38344248-9889-11eb-a8ab-0647cdb505d0\u0026order%5BstartDate%5D=asc\u0026startDate%5Bafter%5D=now\u0026page=2"
  },
  "meta": {
    "totalItems": 256,
    "itemsPerPage": 1,
    "currentPage": 1
  },
  "data": [
    {
      "id": "\/american-football\/v2\/events\/d2554158-f1fe-4fa2-97b5-bf7f076979d4",
      "type": "Event",
      "attributes": {
        "startDate": "2022-09-16T00:15:00+00:00",
        "eventStatus": {
          "name": "pre-game",
          "uuid": "9e840b68-5855-4f46-a7b9-7e97694258fc"
        },
        "homeTeamScore": null,
        "awayTeamScore": null,
        "title": "Los Angeles Chargers at Kansas City Chiefs",
        "homeSeed": null,
        "awaySeed": null,
        "coverage": "full",
        "otherBooksData": {
          "spread_home": {
            "MGM": "-3.5",
            "DraftKings": "-3.5",
            "FanDuel": "-3.5",
            "Westgate": "-3.5",
            "SugarHouseNJ": "-3.5",
            "PointsBet": "-3.5",
            "Bet365NewJersey": "-3.5"
          },
          "spread_away": {
            "MGM": "3.5",
            "DraftKings": "3.5",
            "FanDuel": "3.5",
            "Westgate": "3.5",
            "SugarHouseNJ": "3.5",
            "PointsBet": "3.5",
            "Bet365NewJersey": "3.5"
          },
          "over_under": {
            "MGM": "54.5",
            "DraftKings": "54.5",
            "FanDuel": "54.5",
            "Westgate": "54",
            "SugarHouseNJ": "54.5",
            "PointsBet": "54.5",
            "Bet365NewJersey": "54.5"
          }
        },
        "uuid": "d2554158-f1fe-4fa2-97b5-bf7f076979d4",
        "awayRemainingTimeouts": null,
        "clock": null,
        "displayStatus": "scheduled"
      },
      "relationships": {
        "league": {
          "data": {
            "type": "League",
            "id": "\/american-football\/v2\/leagues\/38344248-9889-11eb-a8ab-0647cdb505d0"
          }
        },
        "homeTeam": {
          "data": {
            "type": "Team",
            "id": "\/american-football\/v2\/teams\/da067403-25e8-4f40-a02e-55cda46f0b6b"
          }
        },
        "awayTeam": {
          "data": {
            "type": "Team",
            "id": "\/american-football\/v2\/teams\/499a829d-e18d-4b3a-81a8-7aad418fef95"
          }
        },
        "winloss": {
          "data": {
            "type": "WinLoss",
            "id": "\/american-football\/v2\/win_losses\/d2554158-f1fe-4fa2-97b5-bf7f076979d4"
          }
        }
      }
    }
  ]
}

To retrieve the predictions related to the event you can query the /{sport}/v2/wins_losses endpoint using the event's uuid:

GET https://api.quarter4.io/american-football/v2/win_losses/d2554158-f1fe-4fa2-97b5-bf7f076979d4?
{
  "data": {
    "id": "\/american-football\/v2\/win_losses\/d2554158-f1fe-4fa2-97b5-bf7f076979d4",
    "type": "WinLoss",
    "attributes": {
      "uuid": "d2554158-f1fe-4fa2-97b5-bf7f076979d4",
      "detail": "The Kansas City Chiefs have a 53.9% chance of beating the Los Angeles Chargers",
      "homeWinProbability": 54,
      "awayWinProbability": 46,
      "homeSpread": -1,
      "awaySpread": 1,
      "overUnder": 55.9742,
      "winLossSpreadConsistency": 1,
      "otherBooksData": {
        "spread_home": {
          "MGM": "-3.5",
          "DraftKings": "-3.5",
          "FanDuel": "-3.5",
          "Westgate": "-3.5",
          "SugarHouseNJ": "-3.5",
          "PointsBet": "-3.5",
          "Bet365NewJersey": "-3.5"
        },
        "spread_away": {
          "MGM": "3.5",
          "DraftKings": "3.5",
          "FanDuel": "3.5",
          "Westgate": "3.5",
          "SugarHouseNJ": "3.5",
          "PointsBet": "3.5",
          "Bet365NewJersey": "3.5"
        },
        "over_under": {
          "MGM": "54.5",
          "DraftKings": "54.5",
          "FanDuel": "54.5",
          "Westgate": "54",
          "SugarHouseNJ": "54.5",
          "PointsBet": "54.5",
          "Bet365NewJersey": "54.5"
        }
      },
      "overtimeProbability": 0.13286,
      "predictAsOvertime": 0,
      "homeFirstFieldGoal": 0.695565,
      "awayFirstFieldGoal": 0.304435,
      "homeFirstInterception": 0.813783,
      "awayFirstInterception": 0.186217,
      "homeFirstPenalty": 0.500814,
      "awayFirstPenalty": 0.499186,
      "homeFirstSack": 0.728931,
      "awayFirstSack": 0.271069,
      "homeFirstTouchdown": 0.687686,
      "awayFirstTouchdown": 0.312314,
      "probability": 54,
      "winnerUuid": "da067403-25e8-4f40-a02e-55cda46f0b6b",
      "loserUuid": "499a829d-e18d-4b3a-81a8-7aad418fef95",
      "firstTo": [
        {
          "teamId": "da067403-25e8-4f40-a02e-55cda46f0b6b",
          "teamName": "Kansas City Chiefs",
          "value": 0.695565,
          "title": "firstFieldGoal"
        },
        {
          "teamId": "da067403-25e8-4f40-a02e-55cda46f0b6b",
          "teamName": "Kansas City Chiefs",
          "value": 0.813783,
          "title": "firstInterception"
        },
        {
          "teamId": "da067403-25e8-4f40-a02e-55cda46f0b6b",
          "teamName": "Kansas City Chiefs",
          "value": 0.500814,
          "title": "firstPenalty"
        },
        {
          "teamId": "da067403-25e8-4f40-a02e-55cda46f0b6b",
          "teamName": "Kansas City Chiefs",
          "value": 0.728931,
          "title": "firstSack"
        },
        {
          "teamId": "da067403-25e8-4f40-a02e-55cda46f0b6b",
          "teamName": "Kansas City Chiefs",
          "value": 0.687686,
          "title": "firstTouchdown"
        }
      ]
    },
    "relationships": {
      "event": {
        "data": {
          "type": "Event",
          "id": "\/american-football\/v2\/events\/d2554158-f1fe-4fa2-97b5-bf7f076979d4"
        }
      }
    }
  }
}

Or you can request the winLoss relationship to be included in the original events request:

GET https://api.quarter4.io/american-football/v2/events?startDate[after]=now&order[startDate]=asc&league.uuid=38344248-9889-11eb-a8ab-0647cdb505d0&page=1&count=30&include=winLoss

For example:

{
  "links": {
    "self": "\/american-football\/v2\/events?count=1\u0026include=winloss\u0026league.uuid=38344248-9889-11eb-a8ab-0647cdb505d0\u0026order%5BstartDate%5D=asc\u0026startDate%5Bafter%5D=now\u0026page=1",
    "first": "\/american-football\/v2\/events?count=1\u0026include=winloss\u0026league.uuid=38344248-9889-11eb-a8ab-0647cdb505d0\u0026order%5BstartDate%5D=asc\u0026startDate%5Bafter%5D=now\u0026page=1",
    "last": "\/american-football\/v2\/events?count=1\u0026include=winloss\u0026league.uuid=38344248-9889-11eb-a8ab-0647cdb505d0\u0026order%5BstartDate%5D=asc\u0026startDate%5Bafter%5D=now\u0026page=256",
    "next": "\/american-football\/v2\/events?count=1\u0026include=winloss\u0026league.uuid=38344248-9889-11eb-a8ab-0647cdb505d0\u0026order%5BstartDate%5D=asc\u0026startDate%5Bafter%5D=now\u0026page=2"
  },
  "meta": {
    "totalItems": 256,
    "itemsPerPage": 1,
    "currentPage": 1
  },
  "data": [
    {
      "id": "\/american-football\/v2\/events\/d2554158-f1fe-4fa2-97b5-bf7f076979d4",
      "type": "Event",
      "attributes": {
        "startDate": "2022-09-16T00:15:00+00:00",
        "eventStatus": {
          "name": "pre-game",
          "uuid": "9e840b68-5855-4f46-a7b9-7e97694258fc"
        },
        "homeTeamScore": null,
        "awayTeamScore": null,
        "title": "Los Angeles Chargers at Kansas City Chiefs",
        "homeSeed": null,
        "awaySeed": null,
        "coverage": "full",
        "otherBooksData": {
          "spread_home": {
            "MGM": "-3.5",
            "DraftKings": "-3.5",
            "FanDuel": "-3.5",
            "Westgate": "-3.5",
            "SugarHouseNJ": "-3.5",
            "PointsBet": "-3.5",
            "Bet365NewJersey": "-3.5"
          },
          "spread_away": {
            "MGM": "3.5",
            "DraftKings": "3.5",
            "FanDuel": "3.5",
            "Westgate": "3.5",
            "SugarHouseNJ": "3.5",
            "PointsBet": "3.5",
            "Bet365NewJersey": "3.5"
          },
          "over_under": {
            "MGM": "54.5",
            "DraftKings": "54.5",
            "FanDuel": "54.5",
            "Westgate": "54",
            "SugarHouseNJ": "54.5",
            "PointsBet": "54.5",
            "Bet365NewJersey": "54.5"
          }
        },
        "uuid": "d2554158-f1fe-4fa2-97b5-bf7f076979d4",
        "awayRemainingTimeouts": null,
        "clock": null,
        "displayStatus": "scheduled"
      },
      "relationships": {
        "league": {
          "data": {
            "type": "League",
            "id": "\/american-football\/v2\/leagues\/38344248-9889-11eb-a8ab-0647cdb505d0"
          }
        },
        "homeTeam": {
          "data": {
            "type": "Team",
            "id": "\/american-football\/v2\/teams\/da067403-25e8-4f40-a02e-55cda46f0b6b"
          }
        },
        "awayTeam": {
          "data": {
            "type": "Team",
            "id": "\/american-football\/v2\/teams\/499a829d-e18d-4b3a-81a8-7aad418fef95"
          }
        },
        "winloss": {
          "data": {
            "type": "WinLoss",
            "id": "\/american-football\/v2\/win_losses\/d2554158-f1fe-4fa2-97b5-bf7f076979d4"
          }
        }
      }
    }
  ],
  "included": [
    {
      "id": "\/american-football\/v2\/win_losses\/d2554158-f1fe-4fa2-97b5-bf7f076979d4",
      "type": "WinLoss",
      "attributes": {
        "uuid": "d2554158-f1fe-4fa2-97b5-bf7f076979d4",
        "detail": "The Kansas City Chiefs have a 53.9% chance of beating the Los Angeles Chargers",
        "homeWinProbability": 54,
        "awayWinProbability": 46,
        "homeSpread": -1,
        "awaySpread": 1,
        "overUnder": 55.9742,
        "winLossSpreadConsistency": 1,
        "otherBooksData": {
          "spread_home": {
            "MGM": "-3.5",
            "DraftKings": "-3.5",
            "FanDuel": "-3.5",
            "Westgate": "-3.5",
            "SugarHouseNJ": "-3.5",
            "PointsBet": "-3.5",
            "Bet365NewJersey": "-3.5"
          },
          "spread_away": {
            "MGM": "3.5",
            "DraftKings": "3.5",
            "FanDuel": "3.5",
            "Westgate": "3.5",
            "SugarHouseNJ": "3.5",
            "PointsBet": "3.5",
            "Bet365NewJersey": "3.5"
          },
          "over_under": {
            "MGM": "54.5",
            "DraftKings": "54.5",
            "FanDuel": "54.5",
            "Westgate": "54",
            "SugarHouseNJ": "54.5",
            "PointsBet": "54.5",
            "Bet365NewJersey": "54.5"
          }
        },
        "overtimeProbability": 0.13286,
        "predictAsOvertime": 0,
        "homeFirstFieldGoal": 0.695565,
        "awayFirstFieldGoal": 0.304435,
        "homeFirstInterception": 0.813783,
        "awayFirstInterception": 0.186217,
        "homeFirstPenalty": 0.500814,
        "awayFirstPenalty": 0.499186,
        "homeFirstSack": 0.728931,
        "awayFirstSack": 0.271069,
        "homeFirstTouchdown": 0.687686,
        "awayFirstTouchdown": 0.312314,
        "probability": 54,
        "winnerUuid": "da067403-25e8-4f40-a02e-55cda46f0b6b",
        "loserUuid": "499a829d-e18d-4b3a-81a8-7aad418fef95",
        "firstTo": [
          {
            "teamId": "da067403-25e8-4f40-a02e-55cda46f0b6b",
            "teamName": "Kansas City Chiefs",
            "value": 0.695565,
            "title": "firstFieldGoal"
          },
          {
            "teamId": "da067403-25e8-4f40-a02e-55cda46f0b6b",
            "teamName": "Kansas City Chiefs",
            "value": 0.813783,
            "title": "firstInterception"
          },
          {
            "teamId": "da067403-25e8-4f40-a02e-55cda46f0b6b",
            "teamName": "Kansas City Chiefs",
            "value": 0.500814,
            "title": "firstPenalty"
          },
          {
            "teamId": "da067403-25e8-4f40-a02e-55cda46f0b6b",
            "teamName": "Kansas City Chiefs",
            "value": 0.728931,
            "title": "firstSack"
          },
          {
            "teamId": "da067403-25e8-4f40-a02e-55cda46f0b6b",
            "teamName": "Kansas City Chiefs",
            "value": 0.687686,
            "title": "firstTouchdown"
          }
        ]
      },
      "relationships": {
        "event": {
          "data": {
            "type": "Event",
            "id": "\/american-football\/v2\/events\/d2554158-f1fe-4fa2-97b5-bf7f076979d4"
          }
        }
      }
    }
  ]
}

The resulting win_loss Entity gives you the win percentages, over under, spread, as well as additional pre-game probabilities depending on the league and sport.