Skip to main content

Player Aggregation

Access player data through the event, game, competitor, and player relationship hierarchy.

Data Hierarchy

1

Event

Top-level object representing a game (e.g., “KC Chiefs vs BUF Bills - Week 14”)
2

Game

Contains start time, league, and competitors
3

Competitors

Home and away teams with their rosters
4

Players

Individual players with stats and positions

Example Query

query EventPlayers($eventId: ID!) {
  event(id: $eventId) {
    id
    description
    game {
      id
      startTime
      homeCompetitor {
        id
        name
        players {
          id
          name
          number
          position
          stats {
            rushingYards
            passingYards
            receptions
          }
        }
      }
      awayCompetitor {
        id
        name
        players {
          id
          name
          number
          position
          stats {
            rushingYards
            passingYards
            receptions
          }
        }
      }
    }
  }
}

Variables

{
  "eventId": "123e4567-e89b-12d3-a456-426614174001"
}

Example Response

{
  "data": {
    "event": {
      "id": "123e4567-e89b-12d3-a456-426614174001",
      "description": "KC Chiefs vs BUF Bills - Week 14",
      "game": {
        "id": "game-001",
        "startTime": "2023-12-10T20:00:00Z",
        "homeCompetitor": {
          "id": "team-buf",
          "name": "Buffalo Bills",
          "players": [
            {
              "id": "player-001",
              "name": "Josh Allen",
              "number": "17",
              "position": "QB",
              "stats": {
                "rushingYards": 45,
                "passingYards": 275,
                "receptions": 0
              }
            }
          ]
        },
        "awayCompetitor": {
          "id": "team-kc",
          "name": "Kansas City Chiefs",
          "players": [
            {
              "id": "player-002",
              "name": "Patrick Mahomes",
              "number": "15",
              "position": "QB",
              "stats": {
                "rushingYards": 30,
                "passingYards": 298,
                "receptions": 0
              }
            }
          ]
        }
      }
    }
  }
}

Field Reference

Event Fields

FieldTypeDescription
idIDUnique event identifier
descriptionStringHuman-readable event description
gameGameAssociated game details

Game Fields

FieldTypeDescription
idIDUnique game identifier
startTimeDateTimeScheduled start time (UTC)
homeCompetitorCompetitorHome team details
awayCompetitorCompetitorAway team details

Competitor Fields

FieldTypeDescription
idIDUnique team identifier
nameStringTeam name
players[Player]Array of players on the roster

Player Fields

FieldTypeDescription
idIDUnique player identifier
nameStringPlayer name
numberStringJersey number
positionStringPlaying position (QB, RB, WR, etc.)
statsPlayerStatsPlayer statistics

PlayerStats Fields

FieldTypeDescription
rushingYardsIntTotal rushing yards
passingYardsIntTotal passing yards
receptionsIntTotal receptions