---
title: "SofaScore event at-bat pitches"
method: GET
path: "/sofascore/event-at-bat-pitches"
tags: ["SofaScore"]
---

# SofaScore event at-bat pitches

`GET /sofascore/event-at-bat-pitches`

## Request

- Base URL: `https://api.crawlora.net/api/v1`
- URL: `https://api.crawlora.net/api/v1/sofascore/event-at-bat-pitches`
- Auth: API key in header `x-api-key`

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.

## Query parameters

- `id` string, required
- `at_bat_id` string, required

## Headers

- `x-api-key` string, required

## Response `200`

OK

- SofascoreEventAtBatPitchesResponseDoc
  - `code` integer
  - `data` SofascoreEventAtBatPitchesResponse
    - `at_bat_id` integer
    - `count` integer
    - `event_id` integer
    - `fetched_at` string
    - `hitter` SofascorePlayerBrief
      - `id` integer
      - `jersey_number` string
      - `name` string
      - `position` string
      - `short_name` string
      - `slug` string
    - `pitcher` SofascorePlayerBrief
      - `id` integer
      - `jersey_number` string
      - `name` string
      - `position` string
      - `short_name` string
      - `slug` string
    - `pitches` SofascoreBaseballPitch[]
      - `at_bat_over` boolean
      - `away_team_runs` integer
      - `balls` integer
      - `bunt` boolean
      - `double_play` boolean
      - `end_time` string
      - `fielders` SofascoreBaseballFielder[]
        - `first_name` string
        - `jersey_number` string
        - `last_name` string
        - `player_id` integer
        - `sequence` integer
        - `type` string: Type is the credit, for example `putout` or `assist`.
      - `hit` boolean
      - `hit_hardness` string
      - `hit_location` string
      - `hit_trajectory` string
      - `hit_type` string
      - `hit_x` number
      - `hit_y` number
      - `hitter_hand` string
      - `home_team_runs` integer
      - `id` integer
      - `inning` integer
      - `inning_half` string
      - `mlb_x` number
      - `mlb_y` number
      - `mlb_zone` integer
      - `outcome` string: 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.
      - `outs` integer
      - `passed_ball` boolean
      - `pitch_code` string
      - `pitch_count` integer
      - `pitch_description` string
      - `pitch_speed` number: PitchSpeed is in kilometres per hour.
      - `pitch_type` string: PitchType is the short pitch-type code and PitchDescription its name, for example `FA` and `Four-Seam Fastball`.
      - `pitch_x` integer: PitchX and PitchY are SofaScore's plate-location plot units. MLBX, MLBY and MLBZone are the league tracking location and zone as provided.
      - `pitch_y` integer
      - `pitch_zone` integer
      - `pitcher_hand` string
      - `runners` SofascoreBaseballRunner[]
        - `description` string
        - `ending_base` integer
        - `jersey_number` string
        - `out` boolean
        - `outcome_code` string
        - `player_id` integer
        - `player_name` string
        - `starting_base` integer: StartingBase and EndingBase are base numbers, 0 for the batter's box and 1 to 3 for the bases.
      - `sequence` integer
      - `start_time` string
      - `status` string
      - `strike_zone_bottom` number
      - `strike_zone_top` number
      - `strikes` integer
      - `triple_play` boolean
      - `type` string: Type is the upstream event type, `pitch` for a thrown pitch.
      - `wild_pitch` boolean
    - `source_url` string
  - `msg` string

## Other responses

- `400`: Bad Request
- `404`: Not Found
- `429`: Too Many Requests
- `503`: Service Unavailable

---

[API](https://skmtc.dev/crawlora/apis/crawlora-api.md) · [All operations](https://skmtc.dev/crawlora/apis/crawlora-api/llms.txt) · [OpenAPI document](https://skmtc.dev/crawlora/apis/crawlora-api/revisions/afac9b012a27?raw)
