API Update: Stats

We can't kick off a football league without having stats, so we've gone ahead and pushed some new stats APIs out the door.

We've added more APIs than I'm willing to enumerate one-by-one, but here are a few examples of how you can query the API for stats.

Go ahead and copy/paste any of these into the API explorer!

Team Stats

By Game

{
  node(id: "DKY1420EnDNa1FwBlyC8sAV_1ft6") {
    ... on Team {
      gamesConnection {
        edges {
          node {
            time
          }
          stats {
            passingPlays
            rushingPlays
          }
        }
      }
    }
  }
}

By Season

{
  node(id: "DKY1420EnDNa1FwBlyC8sAV_1ft6") {
    ... on Team {
      seasonsConnection(last: 1) {
        edges {
          stats {
            gamesPlayed
            gamesWon
            gamesLost
          }
        }
      }
    }
  }
}

(Note that this excludes pre-season games.)

Game Stats

By Team

{
  node(id: "Gjm5E9bwm9-ZIwVYJqIG6cvI2Ner") {
    ... on Game {
      homeTeamEdge {
        ...teamEdge
      }
      awayTeamEdge {
        ...teamEdge
      }
    }
  }
}

fragment teamEdge on GameTeamEdge {
  stats {
    passingPlays
    rushingPlays
  }
}

By Player

{
  node(id: "Gjm5E9bwm9-ZIwVYJqIG6cvI2Ner") {
    ... on Game {
      playersConnection(first: 5) {
        edges {
          node {
            jerseyNumber
          }
          team {
            abbreviation
          }
          stats {
            passingYards
            rushingYards
            tackles
          }
        }
      }
    }
  }
}
API Update: Stats
Share this