> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://statpad.dev/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://statpad.dev/docs/_mcp/server.

# List entities changed in a time window

GET https://api.statpad.dev/v1/{league}/changes

Which entities of a league changed in [`from`, `window_end`), each once per game with its
latest version, for clients that refetch rather than stream. A window ends no later than 60
seconds ago and spans at most 24 hours, so a change is never missed: poll again with
`from=window_end`. For lower latency, follow a stream's seq instead.


Reference: https://statpad.dev/docs/api-reference/changes/list-changed-entities

## Authentication

- `Authorization` header (bearer token, required) — An API key, sent as `Authorization: Bearer <key>`.

## Request

### Path parameters

- `league` (string, required) — The league's alias.

### Query parameters

- `from` (datetime, required)
- `to` (datetime, optional) — Where the window should end. It ends earlier when the limits above say so.
- `cursor` (string, optional) — `next_cursor` from the previous page. Omit it for the first page.
- `limit` (integer, optional, default: 1000) — Page size.

## Response

### 200

A page of changed entities, ordered by type, id and game.

- `data` (list of ChangedEntity, required)
- `window_start` (datetime, required)
- `window_end` (datetime, required) — Where this window ended. Poll the next one with `from` set to it.
- `next_cursor` (string, required, nullable) — Pass as `cursor` for the next page; null on the last page.

## Errors

### 400 Bad Request Error

A parameter is missing or invalid (`bad_request`).

- `type` (string, required) — Identifies the problem type.
- `title` (string, required)
- `status` (integer, required)
- `code` (enum, required) — `bad_request` a malformed request or message. `unauthorized` a missing or invalid API key. `forbidden` the plan doesn't include the league or feature. `not_found`. `rate_limited`. `resync_required` the requested position is older than the retained history, so subscribe again without `resume` for a fresh snapshot (for a game stream, a REST game read with its `seq` also works). `invalid_resume` a resume seq beyond the stream's head. `slow_consumer` the client fell too far behind and was dropped from a stream, so resume from `resume_from`. `too_many_subscriptions`. `unknown_stream`. `internal`. `unavailable`. `quota_exhausted` the account has used its request allowance for the current period.
  - Allowed values: `bad_request`, `unauthorized`, `forbidden`, `not_found`, `rate_limited`, `resync_required`, `invalid_resume`, `slow_consumer`, `too_many_subscriptions`, `unknown_stream`, `internal`, `unavailable`, `quota_exhausted`
- `detail` (string, optional)
- `request_id` (string, optional)
- `min_seq` (long, optional) — With `resync_required`, the oldest seq the stream still holds.
- `resets_at` (datetime, optional) — With `quota_exhausted`, when the next period's allowance starts.

### 401 Unauthorized Error

The API key is missing, unknown or revoked (`unauthorized`).

- `type` (string, required) — Identifies the problem type.
- `title` (string, required)
- `status` (integer, required)
- `code` (enum, required) — `bad_request` a malformed request or message. `unauthorized` a missing or invalid API key. `forbidden` the plan doesn't include the league or feature. `not_found`. `rate_limited`. `resync_required` the requested position is older than the retained history, so subscribe again without `resume` for a fresh snapshot (for a game stream, a REST game read with its `seq` also works). `invalid_resume` a resume seq beyond the stream's head. `slow_consumer` the client fell too far behind and was dropped from a stream, so resume from `resume_from`. `too_many_subscriptions`. `unknown_stream`. `internal`. `unavailable`. `quota_exhausted` the account has used its request allowance for the current period.
  - Allowed values: `bad_request`, `unauthorized`, `forbidden`, `not_found`, `rate_limited`, `resync_required`, `invalid_resume`, `slow_consumer`, `too_many_subscriptions`, `unknown_stream`, `internal`, `unavailable`, `quota_exhausted`
- `detail` (string, optional)
- `request_id` (string, optional)
- `min_seq` (long, optional) — With `resync_required`, the oldest seq the stream still holds.
- `resets_at` (datetime, optional) — With `quota_exhausted`, when the next period's allowance starts.

### 403 Forbidden Error

The plan doesn't include this league or feature (`forbidden`).

- `type` (string, required) — Identifies the problem type.
- `title` (string, required)
- `status` (integer, required)
- `code` (enum, required) — `bad_request` a malformed request or message. `unauthorized` a missing or invalid API key. `forbidden` the plan doesn't include the league or feature. `not_found`. `rate_limited`. `resync_required` the requested position is older than the retained history, so subscribe again without `resume` for a fresh snapshot (for a game stream, a REST game read with its `seq` also works). `invalid_resume` a resume seq beyond the stream's head. `slow_consumer` the client fell too far behind and was dropped from a stream, so resume from `resume_from`. `too_many_subscriptions`. `unknown_stream`. `internal`. `unavailable`. `quota_exhausted` the account has used its request allowance for the current period.
  - Allowed values: `bad_request`, `unauthorized`, `forbidden`, `not_found`, `rate_limited`, `resync_required`, `invalid_resume`, `slow_consumer`, `too_many_subscriptions`, `unknown_stream`, `internal`, `unavailable`, `quota_exhausted`
- `detail` (string, optional)
- `request_id` (string, optional)
- `min_seq` (long, optional) — With `resync_required`, the oldest seq the stream still holds.
- `resets_at` (datetime, optional) — With `quota_exhausted`, when the next period's allowance starts.

### 404 Not Found Error

No such league or entity (`not_found`).

- `type` (string, required) — Identifies the problem type.
- `title` (string, required)
- `status` (integer, required)
- `code` (enum, required) — `bad_request` a malformed request or message. `unauthorized` a missing or invalid API key. `forbidden` the plan doesn't include the league or feature. `not_found`. `rate_limited`. `resync_required` the requested position is older than the retained history, so subscribe again without `resume` for a fresh snapshot (for a game stream, a REST game read with its `seq` also works). `invalid_resume` a resume seq beyond the stream's head. `slow_consumer` the client fell too far behind and was dropped from a stream, so resume from `resume_from`. `too_many_subscriptions`. `unknown_stream`. `internal`. `unavailable`. `quota_exhausted` the account has used its request allowance for the current period.
  - Allowed values: `bad_request`, `unauthorized`, `forbidden`, `not_found`, `rate_limited`, `resync_required`, `invalid_resume`, `slow_consumer`, `too_many_subscriptions`, `unknown_stream`, `internal`, `unavailable`, `quota_exhausted`
- `detail` (string, optional)
- `request_id` (string, optional)
- `min_seq` (long, optional) — With `resync_required`, the oldest seq the stream still holds.
- `resets_at` (datetime, optional) — With `quota_exhausted`, when the next period's allowance starts.

### 429 Too Many Requests Error

The account's request rate (`rate_limited`) or period allowance (`quota_exhausted`, with `resets_at`) is used up. No data is served.

- `type` (string, required) — Identifies the problem type.
- `title` (string, required)
- `status` (integer, required)
- `code` (enum, required) — `bad_request` a malformed request or message. `unauthorized` a missing or invalid API key. `forbidden` the plan doesn't include the league or feature. `not_found`. `rate_limited`. `resync_required` the requested position is older than the retained history, so subscribe again without `resume` for a fresh snapshot (for a game stream, a REST game read with its `seq` also works). `invalid_resume` a resume seq beyond the stream's head. `slow_consumer` the client fell too far behind and was dropped from a stream, so resume from `resume_from`. `too_many_subscriptions`. `unknown_stream`. `internal`. `unavailable`. `quota_exhausted` the account has used its request allowance for the current period.
  - Allowed values: `bad_request`, `unauthorized`, `forbidden`, `not_found`, `rate_limited`, `resync_required`, `invalid_resume`, `slow_consumer`, `too_many_subscriptions`, `unknown_stream`, `internal`, `unavailable`, `quota_exhausted`
- `detail` (string, optional)
- `request_id` (string, optional)
- `min_seq` (long, optional) — With `resync_required`, the oldest seq the stream still holds.
- `resets_at` (datetime, optional) — With `quota_exhausted`, when the next period's allowance starts.

### 500 Internal Server Error

Something failed on our side (`internal`). Retry with backoff.

- `type` (string, required) — Identifies the problem type.
- `title` (string, required)
- `status` (integer, required)
- `code` (enum, required) — `bad_request` a malformed request or message. `unauthorized` a missing or invalid API key. `forbidden` the plan doesn't include the league or feature. `not_found`. `rate_limited`. `resync_required` the requested position is older than the retained history, so subscribe again without `resume` for a fresh snapshot (for a game stream, a REST game read with its `seq` also works). `invalid_resume` a resume seq beyond the stream's head. `slow_consumer` the client fell too far behind and was dropped from a stream, so resume from `resume_from`. `too_many_subscriptions`. `unknown_stream`. `internal`. `unavailable`. `quota_exhausted` the account has used its request allowance for the current period.
  - Allowed values: `bad_request`, `unauthorized`, `forbidden`, `not_found`, `rate_limited`, `resync_required`, `invalid_resume`, `slow_consumer`, `too_many_subscriptions`, `unknown_stream`, `internal`, `unavailable`, `quota_exhausted`
- `detail` (string, optional)
- `request_id` (string, optional)
- `min_seq` (long, optional) — With `resync_required`, the oldest seq the stream still holds.
- `resets_at` (datetime, optional) — With `quota_exhausted`, when the next period's allowance starts.

### 503 Service Unavailable Error

Account access or its limits could not be checked because a dependency is unavailable (`unavailable`). No data is served.

- `type` (string, required) — Identifies the problem type.
- `title` (string, required)
- `status` (integer, required)
- `code` (enum, required) — `bad_request` a malformed request or message. `unauthorized` a missing or invalid API key. `forbidden` the plan doesn't include the league or feature. `not_found`. `rate_limited`. `resync_required` the requested position is older than the retained history, so subscribe again without `resume` for a fresh snapshot (for a game stream, a REST game read with its `seq` also works). `invalid_resume` a resume seq beyond the stream's head. `slow_consumer` the client fell too far behind and was dropped from a stream, so resume from `resume_from`. `too_many_subscriptions`. `unknown_stream`. `internal`. `unavailable`. `quota_exhausted` the account has used its request allowance for the current period.
  - Allowed values: `bad_request`, `unauthorized`, `forbidden`, `not_found`, `rate_limited`, `resync_required`, `invalid_resume`, `slow_consumer`, `too_many_subscriptions`, `unknown_stream`, `internal`, `unavailable`, `quota_exhausted`
- `detail` (string, optional)
- `request_id` (string, optional)
- `min_seq` (long, optional) — With `resync_required`, the oldest seq the stream still holds.
- `resets_at` (datetime, optional) — With `quota_exhausted`, when the next period's allowance starts.

## Types

### ChangedEntity

An entity that changed, once per game it changed in. A game-scoped entity such as a game roster entry or game stats is keyed by the player or team, so `game_id` says which game's entity changed.

- `entity_type` (enum, required) — The kind of entity a change carries, which fixes the payload schema: `game` Game, `live_state` LiveState, `team` Team, `venue` Venue, `season` Season, `season_week` SeasonWeek, `player` Player, `game_roster` GameRosterEntry, `play_group` PlayGroup, `play` Play, `player_game_stats` PlayerGameStats, `team_game_stats` TeamGameStats, `injury` Injury, `transaction` Transaction, `roster` RosterEntry and `depth_chart` DepthChart. A deletion's payload is a Tombstone.
  - Allowed values: `game`, `live_state`, `team`, `venue`, `season`, `season_week`, `player`, `game_roster`, `play_group`, `play`, `player_game_stats`, `team_game_stats`, `injury`, `transaction`, `roster`, `depth_chart`
- `entity_id` (string, required)
- `game_id` (string, required, nullable) — The game whose stream recorded the change, or null for a league-stream entity.
- `version` (integer, required) — Bumps on every change to the entity, deletions included. A client holding a version can ignore any state with a lower one.
- `last_modified` (datetime, required)

## Examples

**Response**

```json
{
  "data": [
    {
      "entity_type": "game",
      "entity_id": "string",
      "game_id": "string",
      "version": 1,
      "last_modified": "2024-01-15T09:30:00Z"
    }
  ],
  "window_start": "2024-01-15T09:30:00Z",
  "window_end": "2024-01-15T09:30:00Z",
  "next_cursor": "string"
}
```

**SDK Code**

```python
import requests

url = "https://api.statpad.dev/v1/nfl/changes"

querystring = {"from":"from"}

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://api.statpad.dev/v1/nfl/changes?from=from';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.statpad.dev/v1/nfl/changes?from=from"

	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(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.statpad.dev/v1/nfl/changes?from=from")

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
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.statpad.dev/v1/nfl/changes?from=from")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.statpad.dev/v1/nfl/changes?from=from', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.statpad.dev/v1/nfl/changes?from=from");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.statpad.dev/v1/nfl/changes?from=from")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```