Ship your first request in minutes.
Plain REST over HTTPS. Bearer-token auth. JSON in, JSON out. Explore everything with the trial key, then drop in your own.
Three steps to data.
Get your key
Grab a key from the API console, or explore right now with the shared trial key `trial_demo`.
export STATAPI_KEY="trial_demo"
Make a request
Every resource lives at /api/v1/{league}/{table}. Pass your key as a Bearer token.
curl https://api.stat-api.com/api/v1/mlb/pitches?limit=5 \ -H "Authorization: Bearer $STATAPI_KEY"
Page through results
Responses are cursor-paged. Pass the response's next_from_id as from_id to get the next page.
curl "https://api.stat-api.com/api/v1/mlb/pitches?limit=5&from_id=884214" \ -H "Authorization: Bearer $STATAPI_KEY"
API keys
Send your key on every request as a Bearer token in the Authorization header. The shared trial key `trial_demo` works on the documented example endpoints so you can explore without signing up; your own key unlocks the full surface for your plan.
Authorization: Bearer YOUR_API_KEY
Cursor-based, stable, complete
List endpoints return a page of rows plus a next_from_id cursor. Pass it back as from_id to walk the full result set without skips or duplicates. Control page size with limit (default 50, max 200).
{
"pitches": [ /* ... */ ],
"limit": 50,
"next_from_id": 884264
}
Per-key, per-minute
Each key is rate-limited per minute based on its plan — 300 req/min on One Sport, 1,200 req/min on All Sports. Exceed it and you get a 429 with a Retry-After header telling you exactly how many seconds to wait.
HTTP/1.1 429 Too Many Requests Retry-After: 12
Reference & SDKs
API reference →
Every league, table, filter, and field — with live, runnable examples.
OpenAPI spec →
The full machine-readable OpenAPI 3.1 spec. Generate a client in any language.
TypeScript SDK →
Zero-config typed client. Reads your key from the environment and paginates for you.
Python SDK →
Zero-config Python client for notebooks, scripts, and model pipelines.
Have your key? Start querying.
Open the reference and run your first real request against live data.