Skip to content

get_plays

10 creditsMulti-tablePOST /v1/get_plays

Play-by-play with shot locations, zones, expected points and win probability

Use it when you need play-by-play: a whole game in order, or a player's clutch shots, threes or misses across a season, each with location and win probability.

Parameters

game_idstringoptional
One game: every play in order.
player_idstringoptional
A player's plays (with season).
teamstringoptional
A team's plays (id or abbreviation).
seasonnumber | stringoptional
Season by the year it ends (default: the latest; ignored with game_id).
season_typeenum: regular | postseason | play_in | preseasonoptional
shots_onlybooleanoptional
Field goal and free throw attempts only.
madebooleanoptional
Only made (true) or missed (false) shots.
zoneenum: restricted_area | paint | midrange | corner_3 | above_break_3 | free_throwoptional
One shot zone.
periodintegeroptional
clutchbooleanoptional
Last 5 minutes of the 4th quarter (college men: 2nd half) or overtime, score within 5.
limitintegeroptional
Max plays (default 200).
offsetintegeroptional

Notes

  • Over MCP, ask for it in plain English and the client calls get_plays itself. Point any MCP client at https://mcp.dunkapi.com/mcp?key=YOUR_API_KEY.
  • Each call costs 10 credits, taken before it runs and refunded if the server errors.
  • Not the call you need? Find the right call by what you are trying to answer.

Request

curl -X POST https://mcp.dunkapi.com/v1/get_plays \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
  "game_id": "401585601",
  "shots_only": true,
  "limit": 3
}'

Response

json
{
  "plays": [
    {
      "game_id": "401585601",
      "seq": 1,
      "period": 1,
      "clock_seconds": 699,
      "team": "LAL",
      "type": "Pullup Jump Shot",
      "text": "Austin Reaves makes 24-foot three pointer (LeBron James assists)",
      "shot": {
        "made": true,
        "points_attempted": 3,
        "x": 6,
        "y": 15,
        "distance_ft": 24.2,
        "zone": "above_break_3",
        "expected_points": 1.122
      },
      "points": 3,
      "player_id": "4066457",
      "player": "Austin Reaves",
      "player2_id": "1966",
      "home_score": 3,
      "away_score": 0,
      "home_win_prob": 0.593
    },
    {
      "game_id": "401585601",
      "seq": 2,
      "period": 1,
      "clock_seconds": 684,
      "team": "GS",
      "type": "Driving Hook Shot",
      "text": "Andrew Wiggins makes 10-foot two point shot (Draymond Green assists)",
      "shot": {
        "made": true,
        "points_attempted": 2,
        "x": 19,
        "y": 9,
        "distance_ft": 10.8,
        "zone": "paint",
        "expected_points": 0.78
      },
      "points": 2,
      "player_id": "3059319",
      "player": "Andrew Wiggins",
      "player2_id": "6589",
      "home_score": 3,
      "away_score": 2,
      "home_win_prob": 0.573
    },
    {
      "game_id": "401585601",
      "seq": 3,
      "period": 1,
      "clock_seconds": 660,
      "team": "LAL",
      "type": "Jump Shot",
      "text": "Rui Hachimura misses 22-foot three point jumper",
      "shot": {
        "made": false,
        "points_attempted": 3,
        "x": 48,
        "y": 1,
        "distance_ft": 23,
        "zone": "corner_3",
        "expected_points": 1.164
      },
      "points": 0,
      "player_id": "4066648",
      "player": "Rui Hachimura",
      "player2_id": null,
      "home_score": 3,
      "away_score": 2,
      "home_win_prob": 0.551
    }
  ],
  "count": 3,
  "next_offset": 3
}

Response fields

plays[]array
List of objects
plays[].game_idstring
plays[].seqnumber
plays[].periodnumber
plays[].clock_secondsnumber
plays[].teamstring
plays[].typestring
plays[].textstring
plays[].shotobject
plays[].shot.madeboolean
plays[].shot.points_attemptednumber
plays[].shot.xnumber
plays[].shot.ynumber
plays[].shot.distance_ftnumber
plays[].shot.zonestring
plays[].shot.expected_pointsnumber
plays[].pointsnumber
plays[].player_idstring
plays[].playerstring
plays[].player2_idstring
plays[].home_scorenumber
plays[].away_scorenumber
plays[].home_win_probnumber
countnumber
next_offsetnumber

Related endpoints

Try it

500 credits free on signup: 50 calls to get_plays, and no card.