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` works against the documented default parameters, so it's perfect for a first call. List a few NBA players:

    curl -sS \
      -H 'Authorization: Bearer trial_demo' \
      'https://api.stat-api.com/api/v1/nba/players?status=Active&limit=3'
    
  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.

    {
      "players": [ { "id": 201939, "full_name": "Stephen Curry" } ],
      "total": 3,
      "limit": 3,
      "next_from_id": 201939
    }
    
  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. This is stable even as data changes.

    curl -sS \
      -H 'Authorization: Bearer trial_demo' \
      'https://api.stat-api.com/api/v1/nba/players?status=Active&limit=3&from_id=201939'
    
  4. 4. Use your own key

    Subscribe to mint a personal key, then swap it in for higher rate limits, full row counts, and arbitrary parameters. The header is identical.

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