NBA Game Flow API Documentation

Access advanced basketball metrics and datasets to simplify your research. Below are the available API endpoints with descriptions and examples.

/api/rapm_1

Description: Retrieve 1-year RAPM data for a specific NBA season.

Query Parameters:

Example Request:

GET http://www.nbagameflow.com/api/rapm_1?season=2025

Example Record:

{
    "player_id":1641722,
    "player_name":"Jordan Hawkins",
    "season":2025,
    "off_rapm":-0.6837455998,
    "def_rapm":-0.772955597,
    "total_rapm":-1.4567011968,
    "intercept":88.9940530655
}   

/api/rapm_multi

Description: Retrieve multi-year RAPM data (3-year) for a specific end season.

Query Parameters:

Example Request:

GET http://www.nbagameflow.com/api/rapm_multi?season=2025&length=3

Example Record:

{
    "player_id":202681,
    "player_name":"Kyrie Irving",
    "end_season":2025,
    "off_rapm":4.4111362693,
    "def_rapm":1.0321005264,
    "total_rapm":5.4432367957,
    "intercept":87.4290104033
}       

/api/combined_pbp

Description: Retrieve combined play-by-play data for a specific game.

Query Parameters:

Example Request:

GET http://www.nbagameflow.com/api/combined_pbp?game_id=22400001

Example Record:

{
    "game_id":22400001,
    "event_num":14,
    "action_id":10,
    "season":2025,
    "season_type":"Regular",
    "away_team_id":1610612737,
    "away_team_tricode":"ATL",
    "home_team_id":1610612738,
    "home_team_tricode":"BOS",
    "end_of_possession":1,
    "possession_id":3.0,
    "period":1,
    "game_clock":"11:17",
    "away_score":0,
    "home_score":0,
    "team_id":1610612737.0,
    "team_tricode":"ATL",
    "event_msg_type":5,
    "action_type":"Turnover",
    "action_sub_type":"Traveling",
    "description":"Johnson Traveling Turnover (P1.T1)",
    "secondary_description":null,
    "person_1_type":5,
    "player_1_id":1630552,
    "player_1_name":"Jalen Johnson",
    "player_1_team_id":1610612737.0,
    "player_1_team_tricode":"ATL",
    "player_2_type":0,"player_2_id":0,
    "player_2_name":null,
    "player_2_team_id":null,
    "player_2_team_tricode":null,
    "person_3_type":"1",
    "player_3_id":0,
    "player_3_name":null,
    "player_3_team_id":null,
    "player_3_team_tricode":null,
    "shot_type":null,
    "shot_zone_basic":null,
    "shot_zone_area":null,
    "shot_zone_range":null,
    "shot_distance":null,
    "shotchart_location_x":null,
    "shotchart_location_y":null,
    "assist":0,
    "steal":0,
    "block":0,
    "foul_type":null,
    "free_throw_made":0,
    "free_throw_attempt":null,
    "free_throw_out_of":null,
    "technical_free_throw":0,
    "clear_path_free_throw":0,
    "flagrant_free_throw":0,
    "transition_take_foul_free_throw":0,
    "free_throw_foul_type":null,
    "prev_event_num":13.0,
    "prev_action_type":"Rebound",
    "prev_team_id":1610612737.0,
    "prev_description":"Johnson REBOUND (Off:0 Def:1)",
    "opening_tip_winner_id":1610612737,
    "rebound_type":null,
    "seconds_remaining_in_period":677,
    "seconds_remaining_in_game":2837,
    "possession_team_id":1610612737,
    "possession_team_tricode":"ATL",
    "clock":"PT11M17.00S"
}       

/api/possessions

Description: Retrieve possession-level data for a specific game.

Query Parameters:

Example Request:

GET http://www.nbagameflow.com/api/possessions?game_id=22400001

Example Response:

{
    "game_id":22400001,
    "possession_id":19,
    "season":2025,
    "season_type":
    "Regular",
    "period":1,
    "possession_team_tricode":"ATL",
    "possession_team_score":8,
    "defensive_team_tricode":"BOS",
    "defensive_team_score":9,
    "possesion_end_play_clock":"7:36",
    "possession_start_seconds_remaining_in_period":462,
    "possession_start_seconds_remaining_in_game":2622,
    "possession_end_seconds_remaining_in_period":456,
    "possession_length":6,
    "possession_end_seconds_remaining_in_game":2616,
    "possession_ending_event_num":71,
    "possession_ending_event_msg_type":4,
    "possession_ending_action_type":"Rebound",
    "possession_ending_action_sub_type":"Unknown",
    "pts_scored":0,
    "two_pt_attempts":0,
    "two_pts_made":0,
    "three_pt_attempts":0,
    "three_pts_made":0,
    "free_throw_attempts":2,
    "free_throws_made":0,
    "defensive_rebounds":1,
    "offensive_rebounds":1,
    "assists":0,
    "steals":0,
    "blocks":0,
    "turnovers":0,
    "fouls":1,
    "timeouts":0,
    "possession_ending_block":0,
    "away_team_tricode":"ATL",
    "away_score":9,
    "home_team_tricode":"BOS",
    "home_score":8,
    "away_timeouts_remaining":7,
    "home_timeouts_remaining":7,
    "home_win_probability":0.525131
}