Skip to content

get_spray_chart

10 creditsMulti-tablePOST /v1/get_spray_chart

Where a batter or team hits the ball, by trajectory and field

Use it when you want where a hitter or team puts the ball in play, by field and trajectory, or every ball's location to draw a chart.

Parameters

batter_idstringoptional
teamstringoptional
seasonnumber | stringoptional
Season (a year; default: the latest; ignored with game_id).
include_ballsbooleanoptional
Add each ball in play's x/y (up to 3,000).

Notes

  • Over MCP, ask for it in plain English and the client calls get_spray_chart itself. Point any MCP client at https://mcp.fastballapi.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.fastballapi.com/v1/get_spray_chart \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
  "batter_id": "30951",
  "season": 2024
}'

Response

json
{
  "season": 2024,
  "balls_in_play": 422,
  "by_trajectory": [
    {
      "trajectory": "G",
      "balls": 162,
      "hits": 46,
      "hr": 0,
      "hit_rate": 0.284
    },
    {
      "trajectory": "F",
      "balls": 127,
      "hits": 40,
      "hr": 29,
      "hit_rate": 0.315
    },
    {
      "trajectory": "L",
      "balls": 115,
      "hits": 75,
      "hr": 2,
      "hit_rate": 0.652
    }
  ],
  "by_field": [
    {
      "field": "right",
      "balls": 178,
      "hits": 76,
      "hr": 17,
      "hit_rate": 0.427
    },
    {
      "field": "left",
      "balls": 147,
      "hits": 54,
      "hr": 11,
      "hit_rate": 0.367
    },
    {
      "field": "center",
      "balls": 97,
      "hits": 31,
      "hr": 3,
      "hit_rate": 0.32
    }
  ]
}

Response fields

seasonnumber
balls_in_playnumber
by_trajectory[]array
List of objects
by_trajectory[].trajectorystring
by_trajectory[].ballsnumber
by_trajectory[].hitsnumber
by_trajectory[].hrnumber
by_trajectory[].hit_ratenumber
by_field[]array
List of objects
by_field[].fieldstring
by_field[].ballsnumber
by_field[].hitsnumber
by_field[].hrnumber
by_field[].hit_ratenumber

Related endpoints

Try it

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