Documentation

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.

Quickstart

Three steps to data.

1

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"
2

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"
3

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"
Authentication

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
Pagination

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
}
Rate limits

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

Have your key? Start querying.

Open the reference and run your first real request against live data.