MLB API endpoint
Use Crawlora's MLB Swing Timing API to extract supported public MLB data as structured JSON. This page includes request parameters, cURL examples, response schema, error behavior, credit cost, and a Playground link for testing before integration.
/mlb/statcast-swing-timingReturns batter, batting-team, pitcher, pitching-team, or league rows with the page's season, game type, pitch-group, split, team, date, swing, contact, zone, pitch hand/type, count, timing-axis, and timing-flag filters. Sorting is local. Use mlb_discovery for exact values. Developers commonly use this endpoint for data enrichment, monitoring, research dashboards, internal automation, and agent-native workflows that need repeatable structured public web data. Authentication uses the documented Crawlora headers, and usage is metered with the credit cost shown on this page.
Request parameters are generated from the active endpoint catalog. Required values must be sent before Crawlora can call the upstream public web data source.
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| type | string | No | Row type Allowed values: batter, batting-team, pitcher, pitching-team, league | ||
| seasons | array | No | One or more seasons | ||
| game_types | array | No | One or more game types | ||
| splits | array | No | One or more split dimensions | ||
| min_swings | string | No | Minimum swing threshold Allowed values: q, 1, 5, 10, 25, 50, 100, 200, 500, 1000 | ||
| min_split | string | No | Minimum swings per split group Allowed values: 1, 5, 10, 25, 50, 100, 200, 500, 1000 | ||
| split_year | string | No | Split years into separate rows Allowed values: 1, 0 | ||
| teams | array | No | One or more MLB team ids | ||
| date_start | string | No | Optional range start in YYYY-MM-DD | ||
| date_end | string | No | Optional range end in YYYY-MM-DD | ||
| bat_side | string | No | Batter side Allowed values: L, R | ||
| contact_type | string | No | Contact type Allowed values: 2, 4, 9 | ||
| attack_zone | string | No | Attack zone Allowed values: 0, 1, 1.1, 2, 3 | ||
| pitch_hand | string | No | Pitcher hand Allowed values: L, R | ||
| pitch_types | array | No | One or more pitch type codes | ||
| counts | array | No | One or more ball-strike counts | ||
| swing_timing_x | array | No | Tied-up, centered, or flailed | ||
| swing_timing_y | array | No | Early, on-time, or late | ||
| swing_timing_z | array | No | Under, lined-up, or over | ||
| flags | array | No | Positive timing flags | ||
| not_flags | array | No | Excluded timing flags | ||
| sort | string | No | Local sort field Allowed values: name, team_name, pitch_hand_type, bat_side_type, n_swings, competitive_swings, strikes_swinging, miss_distance, flails, centers, tied_ups, earlys, on_times, lates, unders, lined_ups, overs, delta_run_exp, whiff_rate, competitive_percent, perfect_percent, flawed_percent | ||
| sort_dir | string | No | Sort direction Allowed values: asc, desc | ||
| limit | integer | No | Rows per page (1-500) Minimum: 1. Maximum: 500. | ||
| offset | integer | No | Zero-based row offset Minimum: 0. Maximum: 5000. | ||
| x-api-key (header) | string | Yes | API key required |
curl -X GET "https://api.crawlora.net/api/v1/mlb/statcast-swing-timing?type=batter&min_swings=q&min_split=1&split_year=1&bat_side=L&contact_type=2&attack_zone=0&pitch_hand=L&sort=name&sort_dir=asc&limit=10" \ -H "x-api-key: $CRAWLORA_API_KEY"
Send your scraping API key in the x-api-key header. Use the console API Keys page to rotate or select the active key.
Endpoint usage is metered in credits. The plan prices, included credits, limits, and overage rates below match the active backend billing configuration.
| Plan | Price | Included credits | Daily cap | Rate limit | Overage |
|---|---|---|---|---|---|
| Free | $0/mo | 2,000 | 500 daily credits | 5/min | No overage |
| Starter | $9/mo | 20,000 | 5,000 daily credits | 15/min | $0.75/1,000 overage credits when enabled |
| Growth | $29/mo | 100,000 | 25,000 daily credits | 45/min | $0.45/1,000 overage credits when enabled |
| Pro | $79/mo | 400,000 | No daily cap | 120/min | $0.30/1,000 overage credits |
| Business | $199/mo | 1,200,000 | No daily cap | 300/min | $0.20/1,000 overage credits |
| Enterprise | $499/mo | 5,000,000 | No daily cap | 1,000/min | $0.12/1,000 overage credits |
This endpoint is executed through Crawlora's managed scraping infrastructure.
Returns table rows plus the applied seasons, game types, split dimensions, source URL, and fetch timestamp. Upstream values are preserved in row maps. The first-party per-swing miss-distance expansion endpoint is not included in this table response. Example response: ```json {"code":0,"data":{"board":"swing-timing-miss-distance","type":"batter","total":1,"sort":"n_swings","sort_dir":"desc","offset":0,"limit":1,"rows":[{"uniqueId":"666018_FF_2026","name":"Sample Player","n_swings":100}]}} ```
Crawlora does not silently return bad data when the upstream page cannot be used.
| Status | Common failure case |
|---|---|
| 400 | Invalid input or missing required parameter |
| 429 | Plan or endpoint rate limit exceeded |
| 500 | Internal execution error |
| 502 | Upstream platform failed, returned unusable HTML, or served a challenge page that could not be resolved |
When possible, Crawlora returns structured error context so your integration can retry, back off, or inspect the request.
| Status | Description | Schema |
|---|---|---|
| 400 | Bad Request | #/definitions/app.Response |
| 404 | Not Found | #/definitions/app.Response |
| 503 | Service Unavailable | #/definitions/app.Response |
{
"code": 0,
"data": {
"board": "swing-timing-miss-distance",
"type": "batter",
"total": 1,
"sort": "n_swings",
"sort_dir": "desc",
"offset": 0,
"limit": 1,
"rows": [
{
"uniqueId": "666018_FF_2026",
"name": "Sample Player",
"n_swings": 100
}
]
}
}Request schema
No body schema
Response schema
#/definitions/mlb.statcastSwingTimingResponseDoc
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| board | string | No | swing-timing-miss-distance | |||
| game_types | array | No | R | |||
| rows | array | No | ||||
| seasons | array | No | 2026 | |||
| splits | array | No | api_pitch_type_group09 | |||
| total | integer | No | 926 | |||
| type | string | No | batter |
Use environment variables for secrets and keep Crawlora API keys server-side.
curl -X GET "https://api.crawlora.net/api/v1/mlb/statcast-swing-timing?type=batter&min_swings=q&min_split=1&split_year=1&bat_side=L&contact_type=2&attack_zone=0&pitch_hand=L&sort=name&sort_dir=asc&limit=10" \
-H "x-api-key: $CRAWLORA_API_KEY"Crawlora is designed for responsible structured public web data workflows. Customers are responsible for using Crawlora in compliance with applicable laws, third-party rights, target-platform rules, and Crawlora terms.
Read Crawlora terms