basketballapi.net

Documentation / Guides

Box scores, play by play and shots

Inside a game: every player line, every event with the clock and the running score, and every shot with where it was taken.

What it covers

  • The box score: both teams, each with its coach, its totals and every player's line (starter or not, minutes, points, two and three point shots, free throws, rebounds, assists, steals, turnovers and blocks).
  • The play by play: every event in order, with its period, the clock, the side, the player, what happened and the running score.
  • The shots: every shot with its value, whether it went in, where it was taken from in feet from the centre of the basket, its distance, and whether it came on a fast break, a second chance or off a turnover.

All three are on Live and up.

How the records link

  • All three are asked by the game's id (gm_), from Games or Yesterday's results.
  • Not every league publishes every part. Check the game's has first: has.boxscore, has.playbyplay and has.shots.
  • Every player carries a pl_ id, which opens the player, their game log and their seasons (Players).

Common jobs

Who scored what

GET https://api.basketballapi.net/v1/games/{id}/boxscore

The game as it unfolded

GET https://api.basketballapi.net/v1/games/{id}/playbyplay

Each event carries home_score and away_score, so the running score and the biggest lead come from one call.

A shot chart

GET https://api.basketballapi.net/v1/games/{id}/shots

x_ft runs across the court and y_ft out towards half court, both from the centre of the basket.

Endpoints in this guide