curl --request GET \
--url https://api.sportquanta.com/v1/mlb/teams/{id}/batting-stats \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sportquanta.com/v1/mlb/teams/{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/teams/{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/teams/{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/teams/{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/teams/{id}/batting-stats")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sportquanta.com/v1/mlb/teams/{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": {
"teamId": "<string>",
"season": 123,
"scopes": {}
},
"_meta": {
"request_id": "<string>",
"served_from": "live",
"cache_ttl_seconds": 123,
"provenance": {},
"availability": {}
}
}Team batting stats
Returns the all, home, away, l3, l7, l10, vs_lhp and
vs_rhp rows that exist in team_batting_stats, keyed by scope.
Missing scopes are omitted and never synthesized.
chasePct (O-Swing%, a 0-1 fraction) is derived per scope from
Statcast zone data and is present on every scope; trackedPitches
carries the coverage denominator so a zero chase count is
distinguishable from absent tracking.
blastPct is Baseball Savant’s blasts-per-bat-contact. Savant’s
bat-tracking leaderboard filters by pitcher handedness and by date but
publishes NO home/away split, so the key is present on all,
vs_lhp, vs_rhp and l7 and absent on home and away.
Consumers must render it as unavailable there rather than repeating
the season figure.
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/teams/{id}/batting-stats \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sportquanta.com/v1/mlb/teams/{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/teams/{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/teams/{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/teams/{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/teams/{id}/batting-stats")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sportquanta.com/v1/mlb/teams/{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": {
"teamId": "<string>",
"season": 123,
"scopes": {}
},
"_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 <= 2100Response
Team batting rows keyed by scope.
Hide child attributes
Hide child attributes
Published scopes only. Missing splits remain absent.
Hide child attributes
Hide child attributes
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 Runs allowed across games in scope. Required for Pythagorean expectation; canonically the opposing team's runs scored, summed per game.
Wins / losses computed from per-game run differential within scope.
Pythagorean win pct (Bill James, with the 1.83 exponent that's standard at MLB run levels): RS^1.83 / (RS^1.83 + RA^1.83). Null when either denominator term is zero.
Actual win pct from wins / (wins + losses). Null with zero games.
actualWinPct − pythWinPct. Positive = over-performing record.
Team-level BABIP, same formula as the player line.
Zone-tracked pitches the team's batters faced in scope — the coverage denominator behind Chase%. Zero means Statcast tracking was absent, not that the team saw no pitches.
Pitches faced in the chase region (Statcast zones 11-14).
Swings at chase-region pitches.
Chase% (O-Swing%) = chaseSwings / chasePitches, a 0-1 fraction to match kPct/bbPct on this line. Null when the team saw no tracked chase pitches in scope. The team-grain counterpart of MlbPlateDiscipline.oSwingPct, and the batter-side mirror of MlbPlayerPitchingStats.chasePct.
Blasts per bat contact, from Baseball Savant's team bat-tracking leaderboard. A 0-1 fraction. OPTIONAL, and that is load-bearing: Savant's board filters by pitcher handedness and by date but publishes NO home/away split, so home and away carry no key at all rather than a null or a repeat of the season figure. Bat speed and squared-up contact are not in our pitch stream, so there is nothing to derive it from and nothing to fall back on.
Competitive swings behind blastPct — sample-size context. Absent wherever blastPct is.
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.