SofaScore API endpoint
Returns every pitch of one baseball at-bat from SofaScore, in pitch order: the ball-strike-out count, outcome code, pitch type and name, speed in kilometres per hour, zone, plate location, strike-zone bounds, batter and pitcher hand, the score, and for balls put in play the hit type, trajectory, hardness and location plus runner movements and fielder credits. Get the at-bat id (`at_bat_id`) from sofascore-event-at-bats for the same event. Returns 404 when SofaScore has no pitches for that at-bat, which includes an at-bat id that does not belong to the event.
/sofascore/event-at-bat-pitchesReturns every pitch of one baseball at-bat from SofaScore, in pitch order, with tracking data.
Query parameters:
id: required. Numeric SofaScore baseball event (match) id, e.g. 17199139.at_bat_id: required. Numeric at-bat id taken from sofascore/event-at-bats for the same event, e.g. 2595879.Notable response behavior:
balls, strikes, outs, pitch_count), a pitch_type code with pitch_code and pitch_description (for example FA, FF, Four-Seam Fastball), pitch_speed in kilometres per hour, pitch_zone, pitch_x/pitch_y plate coordinates, the mlb_x/mlb_y/mlb_zone league tracking values, strike_zone_top and strike_zone_bottom, pitcher_hand and hitter_hand, and the score (home_team_runs, away_team_runs).outcome is SofaScore's result code for the pitch. Values seen: bB (ball), kKL (strike looking), kKS (strike swinging), kF (foul), aS (hit into play, a single in the sample), oFO (fly out), oLO (line out), oGO (ground out). Other codes are passed through unchanged.at_bat_over is true on the pitch that ends the at-bat. For a ball in play hit_type (GB ground ball, LD line drive, FB fly ball), hit_trajectory, hit_hardness, hit_location and hit_x/hit_y are present. runners lists baserunner moves (starting_base 0 is the batter's box, 1 to 3 are the bases) and fielders lists putout and assist credits.404 when SofaScore has no pitches for the at-bat, which includes an at-bat id that does not belong to the event.Example response (shortened):
{
"code": 200,
"msg": "OK",
"data": {
"event_id": 17199139,
"at_bat_id": 2595879,
"source_url": "https://api.sofascore.com/api/v1/event/17199139/atbat/2595879/pitches",
"fetched_at": "2026-10-07T17:00:00Z",
"pitcher": {
"id": 960737,
"name": "Chris Sale",
"short_name": "C. Sale",
"slug": "sale-chris",
"position": "SP",
"jersey_number": "51"
},
"hitter": {
"id": 960736,
"name": "Mookie Betts",
"short_name": "M. Betts",
"slug": "betts-mookie",
"position": "SS",
"jersey_number": "50"
},
"count": 7,
"pitches": [
{
"id": 10178342,
"sequence": 3,
"inning": 1,
"inning_half": "top",
"type": "pitch",
"outcome": "kKL",
"status": "official",
"start_time": "2026-10-06T22:11:49Z",
"end_time": "2026-10-06T22:12:04Z",
"balls": 0,
"strikes": 1,
"outs": 0,
"pitch_count": 1,
"pitch_type": "FA",
"pitch_code": "FF",
"pitch_description": "Four-Seam Fastball",
"pitch_speed": 158.04,
"pitch_zone": 9,
"pitcher_hand": "L",
"hitter_hand": "R",
"pitch_x": 76,
"pitch_y": -47,
"mlb_x": 137.94,
"mlb_y": 184.98,
"mlb_zone": 7,
"strike_zone_top": 3.096,
"strike_zone_bottom": 1.563,
"home_team_runs": 0,
"away_team_runs": 0,
"at_bat_over": false,
"hit": false,
"bunt": false,
"wild_pitch": false,
"passed_ball": false,
"double_play": false,
"triple_play": false
},
"...",
{
"id": 10178348,
"sequence": 9,
"inning": 1,
"inning_half": "top",
"type": "pitch",
"outcome": "aS",
"status": "official",
"start_time": "2026-10-06T22:13:41Z",
"end_time": "2026-10-06T22:13:59Z",
"balls": 3,
"strikes": 2,
"outs": 0,
"pitch_count": 7,
"pitch_type": "SL",
"pitch_code": "SL",
"pitch_description": "Slider",
"pitch_speed": 128.59,
"pitch_zone": 1,
"pitcher_hand": "L",
"hitter_hand": "R",
"pitch_x": -41,
"pitch_y": 52,
"mlb_x": 105.6,
"mlb_y": 165.82,
"mlb_zone": 5,
"strike_zone_top": 3.096,
"strike_zone_bottom": 1.563,
"home_team_runs": 0,
"away_team_runs": 0,
"at_bat_over": true,
"hit": true,
"bunt": false,
"wild_pitch": false,
"passed_ball": false,
"double_play": false,
"triple_play": false,
"hit_type": "GB",
"hit_trajectory": "ground_ball",
"hit_hardness": "medium",
"hit_location": "20",
"hit_x": 164.06,
"hit_y": 164.01,
"runners": [
{
"player_id": 960736,
"player_name": "Mookie Betts",
"jersey_number": "50",
"starting_base": 0,
"ending_base": 1,
"out": false,
"outcome_code": "AD1"
}
]
}
]
}
}
| Field | Filled in, of 7 checked | Values in the sample |
|---|---|---|
| id | 7 | |
| sequence | 7 | 3 to 9, median 6 |
| inning | 7 | 1 |
| inning_half | 7 | top in all 7 |
| type | 7 | pitch in all 7 |
| outcome | 7 | bB (3), kKL (2), kF (1) and 1 more |
| status | 7 | official in all 7 |
| start_time | 7 | 2026-10-06 |
| end_time | 7 | 2026-10-06 |
| balls | 7 | 0 to 3, median 2 |
| strikes | 7 | 1 to 2, median 2 |
| outs | 7 | 0 |
| pitch_count | 7 | 1 to 7, median 4 |
| pitch_type | 7 | FA (4), SL (3) |
| pitch_code | 7 | |
| pitch_description | 7 | Four-Seam Fastball (4), Slider (3) |
| pitch_speed | 7 | 127.14 to 159.49, median 155.46 |
| pitch_zone | 7 | 1 to 13, median 11 |
| pitcher_hand | 7 | L in all 7 |
| hitter_hand | 7 | R in all 7 |
| pitch_x | 7 | |
| pitch_y | 7 | |
| mlb_x | 7 | |
| mlb_y | 7 | |
| mlb_zone | 7 | 5 to 14, median 11 |
| strike_zone_top | 7 | 3.1 |
| strike_zone_bottom | 7 | 1.56 |
| home_team_runs | 7 | 0 |
| away_team_runs | 7 | 0 |
| at_bat_over | 7 | true in 1 of 7 |
| hit | 7 | true in 1 of 7 |
| bunt | 7 | true in 0 of 7 |
| wild_pitch | 7 | true in 0 of 7 |
| passed_ball | 7 | true in 0 of 7 |
| double_play | 7 | true in 0 of 7 |
| triple_play | 7 | true in 0 of 7 |
| hit_type | 1 | “GB” |
| hit_trajectory | 1 | “ground_ball” |
| hit_hardness | 1 | “medium” |
| hit_location | 1 | 20 |
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| id | string | Yes | Numeric SofaScore baseball event (match) id | 17199139 | |
| at_bat_id | string | Yes | Numeric at-bat id from sofascore-event-at-bats for the same event | 2595879 | |
| x-api-key (header) | string | Yes | API key required |
curl -X GET "https://api.crawlora.net/api/v1/sofascore/event-at-bat-pitches?id=17199139&at_bat_id=2595879" \ -H "x-api-key: $CRAWLORA_API_KEY"
{
"code": 200,
"msg": "OK",
"data": {
"event_id": 17199139,
"at_bat_id": 2595879,
"source_url": "https://api.sofascore.com/api/v1/event/17199139/atbat/2595879/pitches",
"fetched_at": "2026-10-07T17:00:00Z",
"pitcher": {
"id": 960737,
"name": "Chris Sale",
"short_name": "C. Sale",
"slug": "sale-chris",
"position": "SP",
"jersey_number": "51"
},
"hitter": {
"id": 960736,
"name": "Mookie Betts",
"short_name": "M. Betts",
"slug": "betts-mookie",
"position": "SS",
"jersey_number": "50"
},
"count": 7,
"pitches": [
{
"id": 10178342,
"sequence": 3,
"inning": 1,
"inning_half": "top",
"type": "pitch",
"outcome": "kKL",
"status": "official",
"start_time": "2026-10-06T22:11:49Z",
"end_time": "2026-10-06T22:12:04Z",
"balls": 0,
"strikes": 1,
"outs": 0,
"pitch_count": 1,
"pitch_type": "FA",
"pitch_code": "FF",
"pitch_description": "Four-Seam Fastball",
"pitch_speed": 158.04,
"pitch_zone": 9,
"pitcher_hand": "L",
"hitter_hand": "R",
"pitch_x": 76,
"pitch_y": -47,
"mlb_x": 137.94,
"mlb_y": 184.98,
"mlb_zone": 7,
"strike_zone_top": 3.096,
"strike_zone_bottom": 1.563,
"home_team_runs": 0,
"away_team_runs": 0,
"at_bat_over": false,
"hit": false,
"bunt": false,
"wild_pitch": false,
"passed_ball": false,
"double_play": false,
"triple_play": false
},
"...",
{
"id": 10178348,
"sequence": 9,
"inning": 1,
"inning_half": "top",
"type": "pitch",
"outcome": "aS",
"status": "official",
"start_time": "2026-10-06T22:13:41Z",
"end_time": "2026-10-06T22:13:59Z",
"balls": 3,
"strikes": 2,
"outs": 0,
"pitch_count": 7,
"pitch_type": "SL",
"pitch_code": "SL",
"pitch_description": "Slider",
"pitch_speed": 128.59,
"pitch_zone": 1,
"pitcher_hand": "L",
"hitter_hand": "R",
"pitch_x": -41,
"pitch_y": 52,
"mlb_x": 105.6,
"mlb_y": 165.82,
"mlb_zone": 5,
"strike_zone_top": 3.096,
"strike_zone_bottom": 1.563,
"home_team_runs": 0,
"away_team_runs": 0,
"at_bat_over": true,
"hit": true,
"bunt": false,
"wild_pitch": false,
"passed_ball": false,
"double_play": false,
"triple_play": false,
"hit_type": "GB",
"hit_trajectory": "ground_ball",
"hit_hardness": "medium",
"hit_location": "20",
"hit_x": 164.06,
"hit_y": 164.01,
"runners": [
{
"player_id": 960736,
"player_name": "Mookie Betts",
"jersey_number": "50",
"starting_base": 0,
"ending_base": 1,
"out": false,
"outcome_code": "AD1"
}
]
}
]
}
}Request schema
No body schema
Response schema
#/definitions/sofascore.eventAtBatPitchesResponseDoc
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| code | integer | No | 200 | |||
| data | sofascore.EventAtBatPitchesResponse | No | ||||
| data.at_bat_id | integer | No | 2595879 | |||
| data.count | integer | No | ||||
| data.event_id | integer | No | 17199139 | |||
| data.fetched_at | string | No | ||||
| data.hitter | sofascore.PlayerBrief | No | ||||
| data.hitter.id | integer | No | 839956 | |||
| data.hitter.jersey_number | string | No | 9 | |||
| data.hitter.name | string | No | Erling Haaland | |||
| data.hitter.position | string | No | F | |||
| data.hitter.short_name | string | No | E. Haaland | |||
| data.hitter.slug | string | No | erling-haaland | |||
| data.pitcher | sofascore.PlayerBrief | No | ||||
| data.pitcher.id | integer | No | 839956 | |||
| data.pitcher.jersey_number | string | No | 9 | |||
| data.pitcher.name | string | No | Erling Haaland | |||
| data.pitcher.position | string | No | F | |||
| data.pitcher.short_name | string | No | E. Haaland | |||
| data.pitcher.slug | string | No | erling-haaland | |||
| data.pitches | array | No | ||||
| data.pitches[].at_bat_over | boolean | No | ||||
| data.pitches[].away_team_runs | integer | No | 0 | |||
| data.pitches[].balls | integer | No | 0 | |||
| data.pitches[].bunt | boolean | No | ||||
| data.pitches[].double_play | boolean | No | ||||
| data.pitches[].end_time | string | No | 2026-10-06T22:12:04Z | |||
| data.pitches[].fielders | array | No | ||||
| data.pitches[].fielders[].first_name | string | No | Frederick | |||
| data.pitches[].fielders[].jersey_number | string | No | 5 | |||
| data.pitches[].fielders[].last_name | string | No | Freeman | |||
| data.pitches[].fielders[].player_id | integer | No | 961444 | |||
| data.pitches[].fielders[].sequence | integer | No | 1 | |||
| data.pitches[].fielders[].type | string | No | putout | Type is the credit, for example `putout` or `assist`. | ||
| data.pitches[].hit | boolean | No | ||||
| data.pitches[].hit_hardness | string | No | medium | |||
| data.pitches[].hit_location | string | No | 20 | |||
| data.pitches[].hit_trajectory | string | No | ground_ball | |||
| data.pitches[].hit_type | string | No | GB | |||
| data.pitches[].hit_x | number | No | 164.06 | |||
| data.pitches[].hit_y | number | No | 164.01 | |||
| data.pitches[].hitter_hand | string | No | R | |||
| data.pitches[].home_team_runs | integer | No | 0 | |||
| data.pitches[].id | integer | No | 10178342 | |||
| data.pitches[].inning | integer | No | 1 | |||
| data.pitches[].inning_half | string | No | top | |||
| data.pitches[].mlb_x | number | No | 137.94 | |||
| data.pitches[].mlb_y | number | No | 184.98 | |||
| data.pitches[].mlb_zone | integer | No | 7 | |||
| data.pitches[].outcome | string | No | kKL | Outcome is SofaScore's result code for the pitch. Seen: `bB` ball, `kKL` strike looking, `kKS` strike swinging, `kF` foul, `aS` hit into play, `oFO` fly out, `oLO` line out, `oGO` ground out. | ||
| data.pitches[].outs | integer | No | 0 | |||
| data.pitches[].passed_ball | boolean | No | ||||
| data.pitches[].pitch_code | string | No | FF | |||
| data.pitches[].pitch_count | integer | No | 1 | |||
| data.pitches[].pitch_description | string | No | Four-Seam Fastball | |||
| data.pitches[].pitch_speed | number | No | 158.04 | PitchSpeed is in kilometres per hour. | ||
| data.pitches[].pitch_type | string | No | FA | PitchType is the short pitch-type code and PitchDescription its name, for example `FA` and `Four-Seam Fastball`. | ||
| data.pitches[].pitch_x | integer | No | 76 | PitchX and PitchY are SofaScore's plate-location plot units. MLBX, MLBY and MLBZone are the league tracking location and zone as provided. | ||
| data.pitches[].pitch_y | integer | No | -47 | |||
| data.pitches[].pitch_zone | integer | No | 9 | |||
| data.pitches[].pitcher_hand | string | No | L | |||
| data.pitches[].runners | array | No | ||||
| data.pitches[].runners[].description | string | No | ||||
| data.pitches[].runners[].ending_base | integer | No | 1 | |||
| data.pitches[].runners[].jersey_number | string | No | 50 | |||
| data.pitches[].runners[].out | boolean | No | ||||
| data.pitches[].runners[].outcome_code | string | No | AD1 | |||
| data.pitches[].runners[].player_id | integer | No | 960736 | |||
| data.pitches[].runners[].player_name | string | No | Mookie Betts | |||
| data.pitches[].runners[].starting_base | integer | No | 0 | StartingBase and EndingBase are base numbers, 0 for the batter's box and 1 to 3 for the bases. | ||
| data.pitches[].sequence | integer | No | 3 | |||
| data.pitches[].start_time | string | No | 2026-10-06T22:11:49Z | |||
| data.pitches[].status | string | No | official | |||
| data.pitches[].strike_zone_bottom | number | No | 1.563 | |||
| data.pitches[].strike_zone_top | number | No | 3.096 | |||
| data.pitches[].strikes | integer | No | 1 | |||
| data.pitches[].triple_play | boolean | No | ||||
| data.pitches[].type | string | No | pitch | Type is the upstream event type, `pitch` for a thrown pitch. | ||
| data.pitches[].wild_pitch | boolean | No | ||||
| data.source_url | string | No | ||||
| msg | string | No | OK |
| Status | Description | Schema |
|---|---|---|
| 400 | Bad Request | #/definitions/app.Response |
| 404 | Not Found | #/definitions/app.Response |
| 429 | Too Many Requests | #/definitions/app.Response |
| 503 | Service Unavailable | #/definitions/app.Response |
Use environment variables for secrets and keep Crawlora API keys server-side.
curl -X GET "https://api.crawlora.net/api/v1/sofascore/event-at-bat-pitches?id=17199139&at_bat_id=2595879" \
-H "x-api-key: $CRAWLORA_API_KEY"