curl --request GET \
--url https://api.sportquanta.com/v1/mlb/players/{id}/batting-stats \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sportquanta.com/v1/mlb/players/{id}/batting-stats"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sportquanta.com/v1/mlb/players/{id}/batting-stats', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sportquanta.com/v1/mlb/players/{id}/batting-stats",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sportquanta.com/v1/mlb/players/{id}/batting-stats"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sportquanta.com/v1/mlb/players/{id}/batting-stats")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sportquanta.com/v1/mlb/players/{id}/batting-stats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"playerId": "<string>",
"season": 123,
"scope": "all",
"pa": 123,
"ab": 123,
"h": 123,
"doubles": 123,
"triples": 123,
"hr": 123,
"r": 123,
"rbi": 123,
"bb": 123,
"ibb": 123,
"hbp": 123,
"so": 123,
"sb": 123,
"cs": 123,
"sf": 123,
"sh": 123,
"gidp": 123,
"avg": 123,
"obp": 123,
"slg": 123,
"ops": 123,
"iso": 123,
"kPct": 123,
"bbPct": 123,
"woba": 123,
"wrcPlus": 123,
"babip": 123,
"sbPct": 123,
"xwoba": 123,
"xwobacon": 123,
"wrcPlusPark": 123,
"wpa": 123,
"barrels": 123,
"hardHits": 123,
"barrelPct": 123,
"hardHitPct": 123,
"avgExitVelocity": 123,
"avgLaunchAngle": 123,
"maxExitVelocity": 123
},
"_meta": {
"request_id": "<string>",
"served_from": "live",
"cache_ttl_seconds": 123,
"provenance": {},
"availability": {}
}
}Player batting stats
MLB-only route. Returns the canonical player batting stats
document for a player, season, and scope from
player_batting_stats — the full counting line plus advanced
rates (wOBA, wRC+, xwOBA, BABIP, WPA, …).
Requires the stats entitlement (a paid plan). See Responses & Errors for the success envelope and availability rules.
curl --request GET \
--url https://api.sportquanta.com/v1/mlb/players/{id}/batting-stats \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sportquanta.com/v1/mlb/players/{id}/batting-stats"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sportquanta.com/v1/mlb/players/{id}/batting-stats', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sportquanta.com/v1/mlb/players/{id}/batting-stats",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sportquanta.com/v1/mlb/players/{id}/batting-stats"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sportquanta.com/v1/mlb/players/{id}/batting-stats")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sportquanta.com/v1/mlb/players/{id}/batting-stats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"playerId": "<string>",
"season": 123,
"scope": "all",
"pa": 123,
"ab": 123,
"h": 123,
"doubles": 123,
"triples": 123,
"hr": 123,
"r": 123,
"rbi": 123,
"bb": 123,
"ibb": 123,
"hbp": 123,
"so": 123,
"sb": 123,
"cs": 123,
"sf": 123,
"sh": 123,
"gidp": 123,
"avg": 123,
"obp": 123,
"slg": 123,
"ops": 123,
"iso": 123,
"kPct": 123,
"bbPct": 123,
"woba": 123,
"wrcPlus": 123,
"babip": 123,
"sbPct": 123,
"xwoba": 123,
"xwobacon": 123,
"wrcPlusPark": 123,
"wpa": 123,
"barrels": 123,
"hardHits": 123,
"barrelPct": 123,
"hardHitPct": 123,
"avgExitVelocity": 123,
"avgLaunchAngle": 123,
"maxExitVelocity": 123
},
"_meta": {
"request_id": "<string>",
"served_from": "live",
"cache_ttl_seconds": 123,
"provenance": {},
"availability": {}
}
}Authorizations
Send a workspace API token in the Authorization: Bearer <token> header.
Path Parameters
Query Parameters
Required season year. Missing, invalid, or out-of-range values return invalid_query_parameter.
1920 <= x <= 2100all, home, away, l3, l7, l10, vs_lhp, vs_rhp Response
Batting-stats payload.
Hide child attributes
Hide child attributes
all, home, away, l3, l7, l10, vs_lhp, vs_rhp, vs_lhh, vs_rhh, late_inning, vs_risp, first_pitch, two_strike, full_count BABIP = (H − HR) / (AB − K − HR + SF). The "is this hit luck or skill?" peripheral. Null when the denominator is zero.
SB success rate = SB / (SB + CS). Pairs with sprint speed for the baserunner profile. Null when the runner has no SB attempts.
Expected wOBA from per-batted-ball Statcast (EV + LA → empirical outcome distribution). Tracks the quality of contact independent of fielding/luck. Null when the season's xwOBA grid has no overlap (e.g. pre-Statcast historical seasons).
xwOBAcon — xwOBA on contact only (numerator excludes BB / HBP / K).
Park-adjusted wRC+. Uses the player's home venue's full-season wOBA park factor (centred on 100, > 100 inflates). Only emitted on scope='all' — the home/away/L7/vs-hand splits would need stratified park weights that we don't compute. Null when the player's park factor is unknown (no home team or no PF row).
Win Probability Added — sum of per-PA Δ(WE) credited to the batter's team while this player is at the plate. Tango's clutch-summary stat; positive = "added wins," negative = "cost wins." Null until the season's WE matrix has been derived.
Batted-ball quality from per-pitch Statcast, same definitions the pitcher line uses (mirror of MlbPlayerPitchingStats.barrels/hardHits etc.). Counters over balls in play; rates divide by BIP. All null on seasons with no Statcast tracking (grid empty) or a player with no BIP.
Barrels / balls in play — elite contact. Null when BIP is zero.
Balls in play at ≥95 mph exit velocity / BIP. Null when BIP is zero.
Mean exit velocity (mph) over tracked balls in play.
Mean launch angle (deg) over tracked balls in play.
Hardest tracked ball in play this season (mph).
Hide child attributes
Hide child attributes
live, cache Response cache TTL; independent of source freshness. Omitted when zero.
Endpoint-specific availability context, including soccer roster coverage.