Skip to content

PlayByPlay

Patrick McFarlane edited this page Nov 16, 2018 · 3 revisions

This section details all endpoints accessible via the PlayByPlay class in playbyplay.py. Endpoints available include:

Endpoint Description Tables
playbyplay Game play-by-play with basic fields, such as play desscription, score, margin, period, and game time PlayByPlay, AvailableVideo
playbyplayv2 Game play-by-play with the basic fields above, as well as player information of those involved in the play PlayByPlay, AvailableVideo

Parameters

The BoxScore endpoints all share the same parameters:

API Param Class Param Definition Valid Values Required
GameID game_id 10-digit string that represents a unique game. The format is two leading zeroes, followed by a season indicator number ('1' for preseason, '2' for regular season, '4' for the post-season), then the trailing digits of the season in which the game took place (e.g. '17' for the 2017-18 season). The following 5 digits increment from '00001' in order as the season progresses. For example, '0021600001' is the game_id of the first game of the 2016-17 NBA regular season. Yes
EndPeriod end_period String of an integer that corresponds to the period for which the boxscore ends (Overtime increments logically, e.g. '5' is the first overtime period). String of positive integer Yes
StartPeriod start_period String of an integer that corresponds to the period for which the boxscore begins. String of positive integer Yes

Features

The following table contains features returned in each table from all endpoints:

Column Definition Endpoint/Table
EVENTMSGACTIONTYPE Code for message action playbyplay/PlayByPlay, playbyplayv2/PlayByPlay
EVENTMSGTYPE Code for message playbyplay/PlayByPlay, playbyplayv2/PlayByPlay
EVENTNUM Number indicating the sequence of events playbyplay/PlayByPlay, playbyplayv2/PlayByPlay
GAME_ID 10-digit string that represents a unique game playbyplay/PlayByPlay, playbyplayv2/PlayByPlay
HOMEDESCRIPTION Textual description of the home team actions playbyplay/PlayByPlay, playbyplayv2/PlayByPlay
NEUTRALDESCRIPTION Textual description of any neutral actions playbyplay/PlayByPlay, playbyplayv2/PlayByPlay
PCTIMESTRING Play clock time playbyplay/PlayByPlay, playbyplayv2/PlayByPlay
PERIOD Period playbyplay/PlayByPlay, playbyplayv2/PlayByPlay
PERSON1TYPE Number indicating person 1 position playbyplayv2/PlayByPlay
PERSON2TYPE Number indicating person 2 position playbyplayv2/PlayByPlay
PERSON3TYPE Number indicating person 3 position playbyplayv2/PlayByPlay
PLAYER1_ID Unique identifier for player 1 playbyplayv2/PlayByPlay
PLAYER1_NAME Player 1 first and last name playbyplayv2/PlayByPlay
PLAYER1_TEAM_ABBREVIATION Player 1 abbreviated team name playbyplayv2/PlayByPlay
PLAYER1_TEAM_CITY Player 1 city playbyplayv2/PlayByPlay
PLAYER1_TEAM_ID Unique team identifier of player 1 playbyplayv2/PlayByPlay
PLAYER1_TEAM_NICKNAME Nickname for team of player 1 playbyplayv2/PlayByPlay
PLAYER2_ID Unique identifier for player 2 playbyplayv2/PlayByPlay
PLAYER2_NAME Player 2 first and last name playbyplayv2/PlayByPlay
PLAYER2_TEAM_ABBREVIATION Player 2 abbreviated team name playbyplayv2/PlayByPlay
PLAYER2_TEAM_CITY Player 2 city playbyplayv2/PlayByPlay
PLAYER2_TEAM_ID Unique team identifier for player 2 playbyplayv2/PlayByPlay
PLAYER2_TEAM_NICKNAME Nickname for team of player 2 playbyplayv2/PlayByPlay
PLAYER3_ID Unique identifier for player 3 playbyplayv2/PlayByPlay
PLAYER3_NAME Player 3 first and last name playbyplayv2/PlayByPlay
PLAYER3_TEAM_ABBREVIATION Player 3 abbreviated team name playbyplayv2/PlayByPlay
PLAYER3_TEAM_CITY Player 3 city playbyplayv2/PlayByPlay
PLAYER3_TEAM_ID Unique team identifier for player 3 playbyplayv2/PlayByPlay
PLAYER3_TEAM_NICKNAME Nickname for team of player 3 playbyplayv2/PlayByPlay
SCORE Score in AWAY SCORE - HOME SCORE format playbyplay/PlayByPlay, playbyplayv2/PlayByPlay
SCOREMARGIN Score differential relative to the home team playbyplay/PlayByPlay, playbyplayv2/PlayByPlay
VIDEO_AVAILABLE_FLAG Boolean indicating whether video is available playbyplay/AvailableVideo, playbyplayv2/AvailableVideo
VISITORDESCRIPTION Textual description of the away team actions playbyplay/PlayByPlay, playbyplayv2/PlayByPlay
WCTIMESTRING Local time playbyplay/PlayByPlay, playbyplayv2/PlayByPlay
Clone this wiki locally