STAT-API

Quickstart: your first request

Every endpoint is a GET under https://api.stat-api.com/api/v1/{league}/{table}. Authentication is a single API key sent as a Bearer token. You can explore with the shared trial key right away, then swap in your own key for unrestricted access.

  1. 1. Send a request with the trial key

    The trial key `trial_demo` runs every endpoint's documented default request — exactly what the Execute buttons in the API reference send. List the NFL seasons:

    curl -sS \
      -H 'Authorization: Bearer trial_demo' \
      'https://api.stat-api.com/api/v1/nfl/seasons'
    
  2. 2. Read the response envelope

    List endpoints return the rows under a key named for the table, plus pagination metadata. `next_from_id` is the cursor for the next page.

    {
      "seasons": [
        {
          "id": 2030,
          "start_year": 2023,
          "regular_season_weeks": 18
        }
      ],
      "limit": 10,
      "next_from_id": 2029
    }
    
  3. 3. Page through with from_id

    Pagination is keyset-based: pass the previous page's `next_from_id` as `from_id` to fetch the next slice — stable even as data changes. Custom parameters like cursors go beyond the trial key's canned defaults, so this is where your own key comes in (free tier: 50,000 records a month, no card).

    curl -sS \
      -H 'Authorization: Bearer YOUR_API_KEY' \
      'https://api.stat-api.com/api/v1/nfl/seasons?limit=10&from_id=2029'
    
  4. 4. Filter with real parameters

    Your key unlocks every documented filter on every table. The header stays identical — only the query string changes. Active NBA players, 50 at a time:

    curl -sS \
      -H 'Authorization: Bearer YOUR_API_KEY' \
      'https://api.stat-api.com/api/v1/nba/players?roster_status=active&limit=50'