> ## Documentation Index
> Fetch the complete documentation index at: https://docs.opengame.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Analytics

> Read weekly analytics for a game you own on OpenGame as saved reports or CSV exports, receive each report by webhook, or drain each change since a cursor.

Weekly reports for a game you own: saved snapshots, CSV exports, webhooks that receive each report, and a drain that returns each change since a cursor, for your own system to store.

[Authentication](https://docs.opengame.io/api-reference/authentication.md) covers each credential, and [errors](https://docs.opengame.io/api-reference/errors.md) covers the JSON error body.

## Read last week's activity for your published games

`GET https://opengame.io/api/v1/analytics/public`

**Authentication:** None.

No sign-in and no parameters. Covers the last complete ISO week, 7 days from Monday 00:00 UTC, frozen the first time it is read, for each published game listed in the gallery. A game with at least one and under 5 players shows null numbers. Games are ordered by a quality score built only from numbers that are shown, then by public ID. Only the 200 includes `Access-Control-Allow-Origin: *`; errors include no CORS header, so a page on another site sees only a failed request.

### Request

```bash cURL theme={"system"}
curl --request GET \
  --url 'https://opengame.io/api/v1/analytics/public'
```

### Response 200

The weekly report.

```json theme={"system"}
{
  "apiVersion": "1",
  "from": "2026-10-12T00:00:00+00:00",
  "asOf": "2026-10-19T00:00:00+00:00",
  "publishedAt": "2026-10-19T00:04:51.318204+00:00",
  "timezone": "UTC",
  "minPlayers": 5,
  "playsToday": null,
  "publications": {
    "asOf": "2026-10-21T15:10:07.902415+00:00",
    "gamesThisWeek": 6
  },
  "games": [
    {
      "publicId": "m3k8v2rw",
      "title": "Lantern Keeper",
      "jams": [],
      "plays": 2210,
      "players": 731,
      "playtimeSeconds": 318400,
      "averagePlaytimeSeconds": 435.5677154582763,
      "recentPlays": null,
      "playsToday": null,
      "livePlayers": null,
      "day1Retention": 0.21625766871165644,
      "qualityScore": 174.75676602975173
    }
  ],
  "freshness": {
    "source": "postgres",
    "quality": "legacy",
    "partial": false,
    "ingestionComplete": false,
    "completeThrough": null,
    "unavailable": [
      "Live players",
      "Current day and hour",
      "Full-session playtime",
      "Peak live players",
      "Day 7 and day 30 retention",
      "Complete history before retained receipts",
      "Late receipts after weekly publication"
    ]
  }
}
```

### Errors

| Status | Meaning |
| - | - |
| 400 | The request had a query string. |
| 503 | The report could not be read. Try again later. |

## Read report mail and alert settings for one game

`GET https://opengame.io/api/v1/analytics/preferences`

**Authentication:** A creator token or a signed-in browser session.

Reads the mail and alert settings for one of your games, with a browser session or a token with the `read` scope. Defaults come back until the settings are first saved.

### Parameters

#### Query

**game** `string` *required*

Game UUID or public ID. Example: `b3e1d9a4-27c6-4f80-9d15-0a6e8c4b2f71`.

### Request

```bash cURL theme={"system"}
curl --request GET \
  --url 'https://opengame.io/api/v1/analytics/preferences?game=b3e1d9a4-27c6-4f80-9d15-0a6e8c4b2f71' \
  --header "Authorization: Bearer $OPENGAME_TOKEN"
```

### Response 200

The settings.

```json theme={"system"}
{
  "preferences": {
    "launch_email": true,
    "weekly_email": true,
    "alerts_email": false,
    "timezone": "UTC",
    "spike_ratio": 2,
    "error_rate": 5,
    "game_id": "b3e1d9a4-27c6-4f80-9d15-0a6e8c4b2f71",
    "owner_id": "8a4d6c12-e3f5-47b9-b0c8-1f2e9d7a5c63"
  }
}
```

| Field | Required | Type |
| - | - | - |
| `preferences` | yes | object |

### Errors

| Status | Meaning |
| - | - |
| 400 | `invalid_request`: pass `game`. |
| 401 | `sign_in_required`, `token_invalid` or `token_revoked`. Sign in again, or use a token that has not been revoked. |
| 403 | `insufficient_scope`: the token lacks the `read` scope or is pinned to another game. `account_banned`: on a change only, OpenGame's moderators have banned the account. Calls still return. `not_launched`: the creator API is closed to this caller. It is open to each signed-in account, so sign in and try again. |
| 404 | `game_not_found`: no game with that UUID or public ID is for this account, or the account is not active. |
| 429 | `rate_limited`: this account made too many analytics requests. Wait `retryAfterSeconds`. |
| 500 | `internal_error`: a failure retrying cannot fix. Quote `requestId` when you report it. |
| 503 | `temporarily_unavailable`, or `rate_limited` when OpenGame could not check the rate limit. Wait `retryAfterSeconds`, then retry. |

## Save report mail and alert settings

`PATCH https://opengame.io/api/v1/analytics/preferences`

**Authentication:** A signed-in browser session.

Browser session only. Send each field; this replaces the settings for this game.

### Parameters

#### Query

**game** `string` *required*

Game UUID or public ID. Example: `b3e1d9a4-27c6-4f80-9d15-0a6e8c4b2f71`.

### Body

Sent as `application/json`.

**launch\_email** `boolean` *required*

Example: `true`.

**weekly\_email** `boolean` *required*

Example: `true`.

**alerts\_email** `boolean` *required*

Example: `true`.

**timezone** `string` (default: UTC)

Always `UTC`. Optional, and UTC only: reports are read in complete UTC weeks.

**spike\_ratio** `number` *required*

From 1.5 to 100. Example: `3`.

**error\_rate** `number` *required*

Above 0, up to 10,000. Example: `5`.

### Request

```bash cURL theme={"system"}
curl --request PATCH \
  --url 'https://opengame.io/api/v1/analytics/preferences?game=b3e1d9a4-27c6-4f80-9d15-0a6e8c4b2f71' \
  --cookie "$OPENGAME_BROWSER_COOKIE" \
  --header 'Origin: https://opengame.io' \
  --header 'Content-Type: application/json' \
  --data '{
  "launch_email": true,
  "weekly_email": true,
  "alerts_email": true,
  "timezone": "UTC",
  "spike_ratio": 3,
  "error_rate": 5
}'
```

### Response 200

The saved settings.

```json theme={"system"}
{
  "preferences": {
    "launch_email": true,
    "weekly_email": true,
    "alerts_email": true,
    "timezone": "UTC",
    "spike_ratio": 3,
    "error_rate": 5,
    "game_id": "b3e1d9a4-27c6-4f80-9d15-0a6e8c4b2f71",
    "owner_id": "8a4d6c12-e3f5-47b9-b0c8-1f2e9d7a5c63"
  }
}
```

| Field | Required | Type |
| - | - | - |
| `preferences` | yes | object |

### Errors

| Status | Meaning |
| - | - |
| 400 | `invalid_request`: no `game`, the body is not JSON, or a field is missing, unknown or out of range. |
| 401 | `sign_in_required`, `token_invalid` or `token_revoked`. Sign in again, or use a token that has not been revoked. |
| 403 | `insufficient_scope`: a token was used, and this operation takes a browser session only. `forbidden`: the change did not come from the OpenGame site, so open the page on OpenGame and try again. `account_banned`: on a change only, OpenGame's moderators have banned the account. Calls still return. `not_launched`: the creator API is closed to this caller. It is open to each signed-in account, so sign in and try again. |
| 404 | `game_not_found`: no game with that UUID or public ID is for this account, or the account is not active. |
| 413 | `body_too_large`: the body is over `analytics.reports.requestBodyBytesMax` (8192) bytes. |
| 415 | `content_type`: send `Content-Type: application/json`. |
| 429 | `rate_limited`: this account made too many analytics requests. Wait `retryAfterSeconds`. |
| 500 | `internal_error`: a failure retrying cannot fix. Quote `requestId` when you report it. |
| 503 | `temporarily_unavailable`, or `rate_limited` when OpenGame could not check the rate limit: wait `retryAfterSeconds`, then retry. `platform_unconfigured`: a fault on OpenGame's side, so try again later. |

## List saved reports for one game

`GET https://opengame.io/api/v1/analytics/reports`

**Authentication:** A creator token or a signed-in browser session.

Newest first, at most 100, from the last 90 days, with a browser session or a token with the `read` scope. Read one by ID for the numbers.

### Parameters

#### Query

**game** `string` *required*

Game UUID or public ID. Example: `b3e1d9a4-27c6-4f80-9d15-0a6e8c4b2f71`.

### Request

```bash cURL theme={"system"}
curl --request GET \
  --url 'https://opengame.io/api/v1/analytics/reports?game=b3e1d9a4-27c6-4f80-9d15-0a6e8c4b2f71' \
  --header "Authorization: Bearer $OPENGAME_TOKEN"
```

### Response 200

The reports.

```json theme={"system"}
{
  "reports": [
    {
      "id": "e41b7c90-3d2a-4f68-8b15-9a0c6e2d7f43",
      "kind": "weekly",
      "period_start": "2026-10-12T00:00:00Z",
      "period_end": "2026-10-19T00:00:00Z",
      "watermark": "2026-10-19T06:00:00Z",
      "insight": {
        "code": "plays",
        "observation": "Plays rose 16% on the week before.",
        "suggestion": "Check which source brought the new players before changing the first level."
      },
      "created_at": "2026-10-19T06:00:04Z"
    }
  ]
}
```

### Errors

| Status | Meaning |
| - | - |
| 400 | `invalid_request`: pass `game`. |
| 401 | `sign_in_required`, `token_invalid` or `token_revoked`. Sign in again, or use a token that has not been revoked. |
| 403 | `insufficient_scope`: the token lacks the `read` scope or is pinned to another game. `account_banned`: on a change only, OpenGame's moderators have banned the account. Calls still return. `not_launched`: the creator API is closed to this caller. It is open to each signed-in account, so sign in and try again. |
| 404 | `game_not_found`: no game with that UUID or public ID is for this account, or the account is not active. |
| 429 | `rate_limited`: this account made too many analytics requests. Wait `retryAfterSeconds`. |
| 500 | `internal_error`: a failure retrying cannot fix. Quote `requestId` when you report it. |
| 503 | `temporarily_unavailable`, or `rate_limited` when OpenGame could not check the rate limit. Wait `retryAfterSeconds`, then retry. |

## Ask for a snapshot report

`POST https://opengame.io/api/v1/analytics/reports`

**Authentication:** A signed-in browser session.

Browser session only. Queues a snapshot of the Stats report for this week and funnel, read at the week's own receipt cutoff. It appears in the report list once it is built. Retrying with the same `Idempotency-Key` queues it once. Rejected while 20 reports, exports and deliveries for this account are already waiting.

### Parameters

#### Query

**game** `string` *required*

Game UUID or public ID. Example: `b3e1d9a4-27c6-4f80-9d15-0a6e8c4b2f71`.

#### Headers

**Idempotency-Key** `string`

Optional. Without one, each request queues another snapshot. 1 to 128 characters. Matches `^[A-Za-z0-9._:-]+$`. Example: `report-2026-w42`.

### Body

Sent as `application/json`.

**window** `string` (default: week)

Only `week`.

**period** `string`

Which ISO week, such as `2026-W43`. Defaults to the newest complete week. At most 104 weeks back, and never a week starting before 2026-08-01. A week that starts more than 90 days ago has numbers only if it was read before then; otherwise they are null and `freshness.unavailable` names why.

**timezone** `string`

Always `UTC`. Optional, and UTC only.

**filters** `object`

Accepted only when empty, for clients written before filters were removed. A filter in it is rejected as `filters_removed`.

**funnel** `array of string`

Event names in order. 2 to 10 items.

### Request

```bash cURL theme={"system"}
curl --request POST \
  --url 'https://opengame.io/api/v1/analytics/reports?game=b3e1d9a4-27c6-4f80-9d15-0a6e8c4b2f71' \
  --cookie "$OPENGAME_BROWSER_COOKIE" \
  --header 'Origin: https://opengame.io' \
  --header 'Idempotency-Key: report-2026-w42' \
  --header 'Content-Type: application/json' \
  --data '{
  "window": "week",
  "timezone": "UTC"
}'
```

### Response 200

Queued.

```json theme={"system"}
{
  "jobKey": "analytics.report:5d1e8f0a3b7c2946e1f8a0d3c5b7e9f2a4c6d8e0b1f3a5c7e9d2b4f6a8c0e1d3",
  "requestId": "report-2026-w42"
}
```

| Field | Required | Type | What it is |
| - | - | - | - |
| `jobKey` | yes | string | Identifies the queued job. No endpoint reads it; watch the report list. |
| `requestId` | yes | string | The `Idempotency-Key` you sent, or a new UUID. |

### Errors

| Status | Meaning |
| - | - |
| 400 | `invalid_range` for a window except `week` or a week a reader may not ask for, including a body that sends `from`, `to` or a `timezone` except UTC; `invalid_request` for no `game`, an unknown field or a funnel that is not valid; `filters_removed` for a body naming any filter. |
| 401 | `sign_in_required`, `token_invalid` or `token_revoked`. Sign in again, or use a token that has not been revoked. |
| 403 | `insufficient_scope`: a token was used, and this operation takes a browser session only. `forbidden`: the change did not come from the OpenGame site, so open the page on OpenGame and try again. `account_banned`: on a change only, OpenGame's moderators have banned the account. Calls still return. `not_launched`: the creator API is closed to this caller. It is open to each signed-in account, so sign in and try again. |
| 404 | `game_not_found`: no game with that UUID or public ID is for this account, or the account is not active. |
| 413 | `body_too_large`: the body is over `analytics.reports.requestBodyBytesMax` (8192) bytes. |
| 415 | `content_type`: send `Content-Type: application/json`. |
| 429 | `report_queue_full`: this account already has 20 analytics jobs waiting (reports, mail, exports, webhook deliveries and drain batches, scheduled ones included). Wait `retryAfterSeconds` and ask again. Or `rate_limited`: wait `retryAfterSeconds`. |
| 500 | `internal_error`: a failure retrying cannot fix. Quote `requestId` when you report it. |
| 503 | `temporarily_unavailable`, or `rate_limited` when OpenGame could not check the rate limit: wait `retryAfterSeconds`, then retry. `platform_unconfigured`: a fault on OpenGame's side, so try again later. |

## Read one saved report

`GET https://opengame.io/api/v1/analytics/reports/{id}`

**Authentication:** A creator token or a signed-in browser session.

Reads one saved report and the numbers, with a browser session or a token with the `read` scope. Reports are kept 90 days. After that the answer is 410 `report_expired` until the report is deleted, and 404 `not_found` afterwards.

### Parameters

#### Path

**id** `string` *required*

Report UUID. Example: `e41b7c90-3d2a-4f68-8b15-9a0c6e2d7f43`.

### Request

```bash cURL theme={"system"}
curl --request GET \
  --url 'https://opengame.io/api/v1/analytics/reports/e41b7c90-3d2a-4f68-8b15-9a0c6e2d7f43' \
  --header "Authorization: Bearer $OPENGAME_TOKEN"
```

### Response 200

The report and the numbers.

```json theme={"system"}
{
  "report": {
    "id": "e41b7c90-3d2a-4f68-8b15-9a0c6e2d7f43",
    "game_id": "b3e1d9a4-27c6-4f80-9d15-0a6e8c4b2f71",
    "owner_id": "8a4d6c12-e3f5-47b9-b0c8-1f2e9d7a5c63",
    "kind": "weekly",
    "period_start": "2026-10-12T00:00:00Z",
    "period_end": "2026-10-19T00:00:00Z",
    "watermark": "2026-10-19T06:00:00Z",
    "report": {
      "apiVersion": "1",
      "gameId": "b3e1d9a4-27c6-4f80-9d15-0a6e8c4b2f71",
      "from": "2026-10-12",
      "to": "2026-10-18",
      "timezone": "UTC",
      "minPlayers": 5,
      "filters": {},
      "summary": {
        "plays": 1284,
        "players": 412,
        "playtimeSeconds": 205600,
        "averagePlaytimeSeconds": 499,
        "returningPlayers": 97,
        "likes": 38,
        "livePlayers": null,
        "peakPlayers": 14
      },
      "window": {
        "kind": "week",
        "period": "2026-W42",
        "start": "2026-10-12T00:00:00Z",
        "end": "2026-10-19T00:00:00Z"
      },
      "comparison": {
        "from": "2026-10-05",
        "to": "2026-10-11",
        "eligible": true,
        "summary": {
          "plays": 1103,
          "players": 371,
          "playtimeSeconds": 171200,
          "averagePlaytimeSeconds": 461,
          "returningPlayers": 82,
          "likes": 29,
          "livePlayers": null,
          "peakPlayers": 12
        }
      },
      "daily": [
        {
          "day": "2026-10-12",
          "plays": 142,
          "players": null,
          "playtimeSeconds": 22700,
          "partial": false
        },
        {
          "day": "2026-10-13",
          "plays": 168,
          "players": null,
          "playtimeSeconds": 26900,
          "partial": false
        },
        {
          "day": "2026-10-14",
          "plays": 155,
          "players": null,
          "playtimeSeconds": 24800,
          "partial": false
        },
        {
          "day": "2026-10-15",
          "plays": 171,
          "players": null,
          "playtimeSeconds": 27400,
          "partial": false
        },
        {
          "day": "2026-10-16",
          "plays": 189,
          "players": null,
          "playtimeSeconds": 30300,
          "partial": false
        },
        {
          "day": "2026-10-17",
          "plays": 247,
          "players": null,
          "playtimeSeconds": 39500,
          "partial": false
        },
        {
          "day": "2026-10-18",
          "plays": 212,
          "players": null,
          "playtimeSeconds": 34000,
          "partial": false
        }
      ],
      "breakdowns": {
        "source": [
          {
            "value": "opengame",
            "label": "opengame",
            "plays": 702,
            "players": 231,
            "playtimeSeconds": 113900,
            "withheld": false
          },
          {
            "value": "direct",
            "label": "direct",
            "plays": 418,
            "players": 129,
            "playtimeSeconds": 66800,
            "withheld": false
          },
          {
            "value": "itch.io",
            "label": "itch.io",
            "plays": 164,
            "players": 52,
            "playtimeSeconds": 24900,
            "withheld": false
          }
        ],
        "surface": [
          {
            "value": "gallery",
            "label": "gallery",
            "plays": 702,
            "players": 231,
            "playtimeSeconds": 113900,
            "withheld": false
          },
          {
            "value": "game",
            "label": "game",
            "plays": 418,
            "players": 129,
            "playtimeSeconds": 66800,
            "withheld": false
          },
          {
            "value": "embed",
            "label": "embed",
            "plays": 164,
            "players": 52,
            "playtimeSeconds": 24900,
            "withheld": false
          }
        ],
        "country": [
          {
            "value": "GB",
            "label": "GB",
            "plays": 391,
            "players": 126,
            "playtimeSeconds": 63100,
            "withheld": false
          },
          {
            "value": "US",
            "label": "US",
            "plays": 344,
            "players": 108,
            "playtimeSeconds": 55800,
            "withheld": false
          },
          {
            "value": "DE",
            "label": "DE",
            "plays": 162,
            "players": 51,
            "playtimeSeconds": 25400,
            "withheld": false
          },
          {
            "value": "withheld",
            "label": "Other / withheld",
            "plays": null,
            "players": null,
            "playtimeSeconds": null,
            "withheld": true
          }
        ],
        "device": [
          {
            "value": "desktop",
            "label": "desktop",
            "plays": 1047,
            "players": 334,
            "playtimeSeconds": 172300,
            "withheld": false
          },
          {
            "value": "mobile",
            "label": "mobile",
            "plays": 237,
            "players": 78,
            "playtimeSeconds": 33300,
            "withheld": false
          }
        ],
        "build": [
          {
            "value": "0d7e3b58-6a21-4f9c-b4e2-93c1a8f05d17",
            "label": "0d7e3b58-6a21-4f9c-b4e2-93c1a8f05d17",
            "plays": 1284,
            "players": 412,
            "playtimeSeconds": 205600,
            "withheld": false
          }
        ]
      },
      "events": [
        {
          "name": "level_complete",
          "events": 2210,
          "players": 288,
          "shareOfPlayers": 0.699,
          "source": "game_reported",
          "properties": [
            {
              "key": "level",
              "value": "1",
              "events": 902,
              "players": 281
            },
            {
              "key": "level",
              "value": "2",
              "events": 731,
              "players": 204
            }
          ]
        },
        {
          "name": "marble_collected",
          "events": 18342,
          "players": 377,
          "shareOfPlayers": 0.915,
          "source": "game_reported"
        }
      ],
      "retention": [
        {
          "day": "2026-10-12",
          "players": 61,
          "day1": 0.2787
        },
        {
          "day": "2026-10-13",
          "players": 58,
          "day1": 0.2414
        }
      ],
      "survival": [
        {
          "seconds": 30,
          "players": 371,
          "share": 0.9005
        },
        {
          "seconds": 120,
          "players": 268,
          "share": 0.6505
        },
        {
          "seconds": 300,
          "players": 154,
          "share": 0.3738
        },
        {
          "seconds": 600,
          "players": 63,
          "share": 0.1529
        }
      ],
      "performance": [
        {
          "buildId": "0d7e3b58-6a21-4f9c-b4e2-93c1a8f05d17",
          "plays": 1284,
          "readyP50Ms": 1840,
          "readyP90Ms": 4210,
          "errorsPer100Plays": 0.86,
          "fpsP50": 60
        }
      ],
      "insights": {
        "from": "2026-10-12",
        "to": "2026-10-18",
        "timezone": "UTC",
        "updatedAt": "2026-10-19T06:00:00Z",
        "minPlayers": 5,
        "discovery": [
          {
            "surface": "gallery",
            "impressions": 9640,
            "pageViews": 1180,
            "plays": 702,
            "clickThrough": 0.12240663900414937,
            "playThrough": 0.5949152542372881
          }
        ],
        "sources": [
          {
            "source": "opengame",
            "players": 231,
            "averagePlaytimeSeconds": 541
          },
          {
            "source": "direct",
            "players": 129,
            "averagePlaytimeSeconds": 457
          },
          {
            "source": "itch.io",
            "players": 52,
            "averagePlaytimeSeconds": 401
          }
        ],
        "benchmarks": {
          "own": {
            "status": "unavailable",
            "games": null,
            "medianSeconds": null,
            "lowerSeconds": null,
            "upperSeconds": null
          },
          "peers": {
            "status": "available",
            "games": 38,
            "medianSeconds": 312,
            "lowerSeconds": 164,
            "upperSeconds": 655
          }
        },
        "drilldown": {
          "builds": [
            {
              "label": "v2",
              "players": 412,
              "plays": 1284,
              "averagePlaytimeSeconds": 499
            }
          ],
          "sessions": [
            {
              "label": "1 session",
              "players": 315,
              "sessions": 315
            },
            {
              "label": "2 or more",
              "players": 97,
              "sessions": 262
            }
          ],
          "errors": [
            {
              "category": "runtime",
              "kind": "webgl_context_lost",
              "players": 9,
              "errors": 11
            }
          ],
          "selectedBuild": "v2",
          "selectedSession": null
        },
        "unavailable": [
          "benchmarks.own"
        ]
      },
      "freshness": {
        "receiptWatermark": "2026-10-19T06:00:00Z",
        "dataSince": "2026-09-28T11:04:51Z",
        "updatedAt": "2026-10-19T06:00:00Z",
        "completeThrough": "2026-10-19T00:00:00Z",
        "partial": false,
        "source": "clickhouse",
        "quality": "exact",
        "unavailable": []
      }
    },
    "insight": {
      "code": "plays",
      "observation": "Plays rose 16% on the week before.",
      "suggestion": "Check which source brought the new players before changing the first level."
    },
    "created_at": "2026-10-19T06:00:04Z"
  }
}
```

### Errors

| Status | Meaning |
| - | - |
| 401 | `sign_in_required`, `token_invalid` or `token_revoked`. Sign in again, or use a token that has not been revoked. |
| 403 | `insufficient_scope`: the token lacks the `read` scope or is pinned to another game. `account_banned`: on a change only, OpenGame's moderators have banned the account. Calls still return. `not_launched`: the creator API is closed to this caller. It is open to each signed-in account, so sign in and try again. |
| 404 | `not_found`: no report with that UUID is in this account. `game_not_found`: the game is no longer yours, or the account is not active. |
| 410 | `report_expired`: reports are kept 90 days. |
| 429 | `rate_limited`: this account made too many analytics requests. Wait `retryAfterSeconds`. |
| 500 | `internal_error`: a failure retrying cannot fix. Quote `requestId` when you report it. |
| 503 | `temporarily_unavailable`, or `rate_limited` when OpenGame could not check the rate limit. Wait `retryAfterSeconds`, then retry. |

## Export a saved report

`POST https://opengame.io/api/v1/analytics/reports/{id}/exports`

**Authentication:** A creator token or a signed-in browser session.

Queues a file of the report in the chosen format, with a browser session or a token with the `read` scope. Asking again for the same report and format answers with the same export and extends how long it is kept. Download it from `downloadUrl`. Exports are kept 7 days.

### Parameters

#### Path

**id** `string` *required*

Report UUID. Example: `e41b7c90-3d2a-4f68-8b15-9a0c6e2d7f43`.

### Body

Sent as `application/json`.

**format** `string` *required*

One of `json`, `csv` or `parquet`.

### Request

```bash cURL theme={"system"}
curl --request POST \
  --url 'https://opengame.io/api/v1/analytics/reports/e41b7c90-3d2a-4f68-8b15-9a0c6e2d7f43/exports' \
  --header "Authorization: Bearer $OPENGAME_TOKEN" \
  --header 'Content-Type: application/json' \
  --data '{
  "format": "csv"
}'
```

### Response 200

Queued.

```json theme={"system"}
{
  "export": {
    "id": "7d3e9a12-c4b6-4e05-a8f1-2b9c5d0e6a74",
    "state": "pending"
  },
  "downloadUrl": "/api/v1/analytics/exports/7d3e9a12-c4b6-4e05-a8f1-2b9c5d0e6a74"
}
```

### Errors

| Status | Meaning |
| - | - |
| 400 | `invalid_request`: the body is not JSON or `format` is not one of the three. |
| 401 | `sign_in_required`, `token_invalid` or `token_revoked`. Sign in again, or use a token that has not been revoked. |
| 403 | `insufficient_scope`: the token lacks the `read` scope or is pinned to another game. `forbidden`: a browser change did not come from the OpenGame site. `account_banned`: on a change only, OpenGame's moderators have banned the account. Calls still return. `not_launched`: the creator API is closed to this caller. It is open to each signed-in account, so sign in and try again. |
| 404 | `not_found`: no report with that UUID is in this account. `game_not_found`: the game is no longer yours, or the account is not active. |
| 410 | `report_expired`. |
| 413 | `body_too_large`: the body is over `analytics.reports.requestBodyBytesMax` (8192) bytes. |
| 415 | `content_type`: send `Content-Type: application/json`. |
| 429 | `report_queue_full`: this account already has 20 analytics jobs waiting (reports, mail, exports, webhook deliveries and drain batches, scheduled ones included). Wait `retryAfterSeconds` and ask again. Or `rate_limited`: wait `retryAfterSeconds`. |
| 500 | `internal_error`: a failure retrying cannot fix. Quote `requestId` when you report it. |
| 503 | `temporarily_unavailable`, which today also covers a report that changed hands after the first checks: wait `retryAfterSeconds`, then retry. `rate_limited` when OpenGame could not check the rate limit. `platform_unconfigured` for a browser change: a fault on OpenGame's side, so try again later. |

## Download an export

`GET https://opengame.io/api/v1/analytics/exports/{id}`

**Authentication:** A creator token or a signed-in browser session.

With a browser session or a token with the `read` scope. JSON and CSV come back as an attachment; the JSON export is `{ snapshotId, window, watermark, insight, report }`. Parquet is a redirect to a private download address that works for 60 seconds, or that address as JSON when the request sends `Accept: application/json`. The 200 and the 307 both include `x-content-sha256`, the hex SHA-256 of the file, so the bytes can be checked. For Parquet it is the hash of the file at the address, not of the JSON that names it.

### Parameters

#### Path

**id** `string` *required*

Export UUID. Example: `7d3e9a12-c4b6-4e05-a8f1-2b9c5d0e6a74`.

### Request

```bash cURL theme={"system"}
curl --request GET \
  --url 'https://opengame.io/api/v1/analytics/exports/7d3e9a12-c4b6-4e05-a8f1-2b9c5d0e6a74' \
  --header "Authorization: Bearer $OPENGAME_TOKEN"
```

### Response 200

The file, or for Parquet with `Accept: application/json`, the address.

#### Headers

**x-content-sha256** `string`

The hex SHA-256 of the exported file. Matches `^[0-9a-f]{64}$`.

```json theme={"system"}
{
  "snapshotId": "e41b7c90-3d2a-4f68-8b15-9a0c6e2d7f43",
  "window": {
    "kind": "week",
    "period": "2026-W42",
    "start": "2026-10-12T00:00:00Z",
    "end": "2026-10-19T00:00:00Z"
  },
  "watermark": "2026-10-19T06:00:00Z",
  "insight": {
    "code": "plays",
    "observation": "Plays rose 16% on the week before.",
    "suggestion": "Check which source brought the new players before changing the first level."
  },
  "report": {
    "apiVersion": "1",
    "gameId": "b3e1d9a4-27c6-4f80-9d15-0a6e8c4b2f71",
    "from": "2026-10-12",
    "to": "2026-10-18",
    "timezone": "UTC",
    "minPlayers": 5,
    "filters": {},
    "summary": {
      "plays": 1284,
      "players": 412,
      "playtimeSeconds": 205600,
      "averagePlaytimeSeconds": 499,
      "returningPlayers": 97,
      "likes": 38,
      "livePlayers": null,
      "peakPlayers": 14
    },
    "window": {
      "kind": "week",
      "period": "2026-W42",
      "start": "2026-10-12T00:00:00Z",
      "end": "2026-10-19T00:00:00Z"
    },
    "comparison": {
      "from": "2026-10-05",
      "to": "2026-10-11",
      "eligible": true,
      "summary": {
        "plays": 1103,
        "players": 371,
        "playtimeSeconds": 171200,
        "averagePlaytimeSeconds": 461,
        "returningPlayers": 82,
        "likes": 29,
        "livePlayers": null,
        "peakPlayers": 12
      }
    },
    "daily": [
      {
        "day": "2026-10-12",
        "plays": 142,
        "players": null,
        "playtimeSeconds": 22700,
        "partial": false
      },
      {
        "day": "2026-10-13",
        "plays": 168,
        "players": null,
        "playtimeSeconds": 26900,
        "partial": false
      },
      {
        "day": "2026-10-14",
        "plays": 155,
        "players": null,
        "playtimeSeconds": 24800,
        "partial": false
      },
      {
        "day": "2026-10-15",
        "plays": 171,
        "players": null,
        "playtimeSeconds": 27400,
        "partial": false
      },
      {
        "day": "2026-10-16",
        "plays": 189,
        "players": null,
        "playtimeSeconds": 30300,
        "partial": false
      },
      {
        "day": "2026-10-17",
        "plays": 247,
        "players": null,
        "playtimeSeconds": 39500,
        "partial": false
      },
      {
        "day": "2026-10-18",
        "plays": 212,
        "players": null,
        "playtimeSeconds": 34000,
        "partial": false
      }
    ],
    "breakdowns": {
      "source": [
        {
          "value": "opengame",
          "label": "opengame",
          "plays": 702,
          "players": 231,
          "playtimeSeconds": 113900,
          "withheld": false
        },
        {
          "value": "direct",
          "label": "direct",
          "plays": 418,
          "players": 129,
          "playtimeSeconds": 66800,
          "withheld": false
        },
        {
          "value": "itch.io",
          "label": "itch.io",
          "plays": 164,
          "players": 52,
          "playtimeSeconds": 24900,
          "withheld": false
        }
      ],
      "surface": [
        {
          "value": "gallery",
          "label": "gallery",
          "plays": 702,
          "players": 231,
          "playtimeSeconds": 113900,
          "withheld": false
        },
        {
          "value": "game",
          "label": "game",
          "plays": 418,
          "players": 129,
          "playtimeSeconds": 66800,
          "withheld": false
        },
        {
          "value": "embed",
          "label": "embed",
          "plays": 164,
          "players": 52,
          "playtimeSeconds": 24900,
          "withheld": false
        }
      ],
      "country": [
        {
          "value": "GB",
          "label": "GB",
          "plays": 391,
          "players": 126,
          "playtimeSeconds": 63100,
          "withheld": false
        },
        {
          "value": "US",
          "label": "US",
          "plays": 344,
          "players": 108,
          "playtimeSeconds": 55800,
          "withheld": false
        },
        {
          "value": "DE",
          "label": "DE",
          "plays": 162,
          "players": 51,
          "playtimeSeconds": 25400,
          "withheld": false
        },
        {
          "value": "withheld",
          "label": "Other / withheld",
          "plays": null,
          "players": null,
          "playtimeSeconds": null,
          "withheld": true
        }
      ],
      "device": [
        {
          "value": "desktop",
          "label": "desktop",
          "plays": 1047,
          "players": 334,
          "playtimeSeconds": 172300,
          "withheld": false
        },
        {
          "value": "mobile",
          "label": "mobile",
          "plays": 237,
          "players": 78,
          "playtimeSeconds": 33300,
          "withheld": false
        }
      ],
      "build": [
        {
          "value": "0d7e3b58-6a21-4f9c-b4e2-93c1a8f05d17",
          "label": "0d7e3b58-6a21-4f9c-b4e2-93c1a8f05d17",
          "plays": 1284,
          "players": 412,
          "playtimeSeconds": 205600,
          "withheld": false
        }
      ]
    },
    "events": [
      {
        "name": "level_complete",
        "events": 2210,
        "players": 288,
        "shareOfPlayers": 0.699,
        "source": "game_reported",
        "properties": [
          {
            "key": "level",
            "value": "1",
            "events": 902,
            "players": 281
          },
          {
            "key": "level",
            "value": "2",
            "events": 731,
            "players": 204
          }
        ]
      },
      {
        "name": "marble_collected",
        "events": 18342,
        "players": 377,
        "shareOfPlayers": 0.915,
        "source": "game_reported"
      }
    ],
    "retention": [
      {
        "day": "2026-10-12",
        "players": 61,
        "day1": 0.2787
      },
      {
        "day": "2026-10-13",
        "players": 58,
        "day1": 0.2414
      }
    ],
    "survival": [
      {
        "seconds": 30,
        "players": 371,
        "share": 0.9005
      },
      {
        "seconds": 120,
        "players": 268,
        "share": 0.6505
      },
      {
        "seconds": 300,
        "players": 154,
        "share": 0.3738
      },
      {
        "seconds": 600,
        "players": 63,
        "share": 0.1529
      }
    ],
    "performance": [
      {
        "buildId": "0d7e3b58-6a21-4f9c-b4e2-93c1a8f05d17",
        "plays": 1284,
        "readyP50Ms": 1840,
        "readyP90Ms": 4210,
        "errorsPer100Plays": 0.86,
        "fpsP50": 60
      }
    ],
    "insights": {
      "from": "2026-10-12",
      "to": "2026-10-18",
      "timezone": "UTC",
      "updatedAt": "2026-10-19T06:00:00Z",
      "minPlayers": 5,
      "discovery": [
        {
          "surface": "gallery",
          "impressions": 9640,
          "pageViews": 1180,
          "plays": 702,
          "clickThrough": 0.12240663900414937,
          "playThrough": 0.5949152542372881
        }
      ],
      "sources": [
        {
          "source": "opengame",
          "players": 231,
          "averagePlaytimeSeconds": 541
        },
        {
          "source": "direct",
          "players": 129,
          "averagePlaytimeSeconds": 457
        },
        {
          "source": "itch.io",
          "players": 52,
          "averagePlaytimeSeconds": 401
        }
      ],
      "benchmarks": {
        "own": {
          "status": "unavailable",
          "games": null,
          "medianSeconds": null,
          "lowerSeconds": null,
          "upperSeconds": null
        },
        "peers": {
          "status": "available",
          "games": 38,
          "medianSeconds": 312,
          "lowerSeconds": 164,
          "upperSeconds": 655
        }
      },
      "drilldown": {
        "builds": [
          {
            "label": "v2",
            "players": 412,
            "plays": 1284,
            "averagePlaytimeSeconds": 499
          }
        ],
        "sessions": [
          {
            "label": "1 session",
            "players": 315,
            "sessions": 315
          },
          {
            "label": "2 or more",
            "players": 97,
            "sessions": 262
          }
        ],
        "errors": [
          {
            "category": "runtime",
            "kind": "webgl_context_lost",
            "players": 9,
            "errors": 11
          }
        ],
        "selectedBuild": "v2",
        "selectedSession": null
      },
      "unavailable": [
        "benchmarks.own"
      ]
    },
    "freshness": {
      "receiptWatermark": "2026-10-19T06:00:00Z",
      "dataSince": "2026-09-28T11:04:51Z",
      "updatedAt": "2026-10-19T06:00:00Z",
      "completeThrough": "2026-10-19T00:00:00Z",
      "partial": false,
      "source": "clickhouse",
      "quality": "exact",
      "unavailable": []
    }
  }
}
```

### Response 307

Parquet: the private download address.

#### Headers

**Location** `string (uri)`

The private download address. It works for 60 seconds.

**x-content-sha256** `string`

The hex SHA-256 of the file at that address. Matches `^[0-9a-f]{64}$`.

### Errors

| Status | Meaning |
| - | - |
| 401 | `sign_in_required`, `token_invalid` or `token_revoked`. Sign in again, or use a token that has not been revoked. |
| 403 | `insufficient_scope`: the token lacks the `read` scope or is pinned to another game. `account_banned`: on a change only, OpenGame's moderators have banned the account. Calls still return. `not_launched`: the creator API is closed to this caller. It is open to each signed-in account, so sign in and try again. |
| 404 | `not_found`: no export with that UUID is in this account. `game_not_found`: the game is no longer yours, or the account is not active. |
| 409 | `export_pending`: the file is not ready, or is being rebuilt. Try again after `retryAfterSeconds`, which is 30. |
| 410 | `report_expired` or `export_expired`. Request the export again. |
| 429 | `rate_limited`: this account made too many analytics requests. Wait `retryAfterSeconds`. |
| 500 | `internal_error`: a failure retrying cannot fix. Quote `requestId` when you report it. |
| 503 | `temporarily_unavailable`, or `rate_limited` when OpenGame could not check the rate limit. Wait `retryAfterSeconds`, then retry. |

## List where this game's reports are sent

`GET https://opengame.io/api/v1/analytics/webhooks`

**Authentication:** A signed-in browser session.

Browser session only. A game has at most one endpoint per account, and it is listed even when turned off.

### Parameters

#### Query

**game** `string` *required*

Game UUID or public ID. Example: `b3e1d9a4-27c6-4f80-9d15-0a6e8c4b2f71`.

### Request

```bash cURL theme={"system"}
curl --request GET \
  --url 'https://opengame.io/api/v1/analytics/webhooks?game=b3e1d9a4-27c6-4f80-9d15-0a6e8c4b2f71' \
  --cookie "$OPENGAME_BROWSER_COOKIE"
```

### Response 200

The endpoints.

```json theme={"system"}
{
  "endpoints": [
    {
      "id": "1f6a8d3c-5e2b-4c97-b0d4-8e3a7c1f9b26",
      "url": "https://hooks.example.com/opengame",
      "enabled": true,
      "created_at": "2026-10-14T10:02:44Z"
    }
  ]
}
```

### Errors

| Status | Meaning |
| - | - |
| 400 | `invalid_request`: pass `game`. |
| 401 | `sign_in_required`, `token_invalid` or `token_revoked`. Sign in again, or use a token that has not been revoked. |
| 403 | `insufficient_scope`: a token was used, and this operation takes a browser session only. `account_banned`: on a change only, OpenGame's moderators have banned the account. Calls still return. `not_launched`: the creator API is closed to this caller. It is open to each signed-in account, so sign in and try again. |
| 404 | `game_not_found`: no game with that UUID or public ID is for this account, or the account is not active. |
| 429 | `rate_limited`: this account made too many analytics requests. Wait `retryAfterSeconds`. |
| 500 | `internal_error`: a failure retrying cannot fix. Quote `requestId` when you report it. |
| 503 | `temporarily_unavailable`, or `rate_limited` when OpenGame could not check the rate limit. Wait `retryAfterSeconds`, then retry. |

## Send this game's reports to an address

`POST https://opengame.io/api/v1/analytics/webhooks`

**Authentication:** A signed-in browser session.

Browser session only. A game has one endpoint per account, and saving turns it on. A new address, an endpoint that was turned off, or `rotateSecret: true` gets a new signing secret, shown in this answer and never again. Saving the same address otherwise keeps the secret your receiver already has and answers `signingSecret: null`.

### Parameters

#### Query

**game** `string` *required*

Game UUID or public ID. Example: `b3e1d9a4-27c6-4f80-9d15-0a6e8c4b2f71`.

### Body

Sent as `application/json`.

**url** `string (uri)` *required*

A public `https://` address with no port, credentials or fragment, at most 2048 bytes. The name must resolve only to public addresses. Example: `https://hooks.example.com/opengame`.

**rotateSecret** `boolean`

Replace the signing secret even though the address is unchanged. Example: `true`.

### Request

```bash cURL theme={"system"}
curl --request POST \
  --url 'https://opengame.io/api/v1/analytics/webhooks?game=b3e1d9a4-27c6-4f80-9d15-0a6e8c4b2f71' \
  --cookie "$OPENGAME_BROWSER_COOKIE" \
  --header 'Origin: https://opengame.io' \
  --header 'Content-Type: application/json' \
  --data '{
  "url": "https://hooks.example.com/opengame",
  "rotateSecret": true
}'
```

### Response 200

The endpoint, and the secret when it is new.

```json theme={"system"}
{
  "endpoint": {
    "id": "1f6a8d3c-5e2b-4c97-b0d4-8e3a7c1f9b26",
    "url": "https://hooks.example.com/opengame",
    "enabled": true,
    "created_at": "2026-10-14T10:02:44Z"
  },
  "signingSecret": "q8Vn2Kx7Rz4Lm1Xp9Tb6Hc3Wd5Yf0GjNs7Ea2Ub4IcT"
}
```

### Errors

| Status | Meaning |
| - | - |
| 400 | `invalid_webhook`: the address is not public HTTPS, has a port, credentials or a fragment, or the name did not resolve to public addresses, which today includes a lookup that timed out. `invalid_request`: no `game`, the body is not JSON, the address is over the byte limit, or a field is unknown. |
| 401 | `sign_in_required`, `token_invalid` or `token_revoked`. Sign in again, or use a token that has not been revoked. |
| 403 | `insufficient_scope`: a token was used, and this operation takes a browser session only. `forbidden`: the change did not come from the OpenGame site, so open the page on OpenGame and try again. `account_banned`: on a change only, OpenGame's moderators have banned the account. Calls still return. `not_launched`: the creator API is closed to this caller. It is open to each signed-in account, so sign in and try again. |
| 404 | `game_not_found`: no game with that UUID or public ID is for this account, or the account is not active. |
| 413 | `body_too_large`: the body is over `analytics.reports.requestBodyBytesMax` (8192) bytes. |
| 415 | `content_type`: send `Content-Type: application/json`. |
| 429 | `rate_limited`: this account made too many analytics requests. Wait `retryAfterSeconds`. |
| 500 | `internal_error`: a failure retrying cannot fix. Quote `requestId` when you report it. |
| 503 | `temporarily_unavailable`, or `rate_limited` when OpenGame could not check the rate limit: wait `retryAfterSeconds`, then retry. `platform_unconfigured`: a fault on OpenGame's side, so try again later. |

## Stop sending reports to an endpoint

`DELETE https://opengame.io/api/v1/analytics/webhooks/{id}`

**Authentication:** A signed-in browser session.

Browser session only. The endpoint is turned off, not deleted, so the delivery history stays readable. Turning off an endpoint that is already off answers the same.

### Parameters

#### Path

**id** `string` *required*

Endpoint UUID. Example: `1f6a8d3c-5e2b-4c97-b0d4-8e3a7c1f9b26`.

### Request

```bash cURL theme={"system"}
curl --request DELETE \
  --url 'https://opengame.io/api/v1/analytics/webhooks/1f6a8d3c-5e2b-4c97-b0d4-8e3a7c1f9b26' \
  --cookie "$OPENGAME_BROWSER_COOKIE" \
  --header 'Origin: https://opengame.io'
```

### Response 200

Turned off.

```json theme={"system"}
{
  "disabled": true
}
```

| Field | Required | Type |
| - | - | - |
| `disabled` | yes | `true` |

### Errors

| Status | Meaning |
| - | - |
| 401 | `sign_in_required`, `token_invalid` or `token_revoked`. Sign in again, or use a token that has not been revoked. |
| 403 | `insufficient_scope`: a token was used, and this operation takes a browser session only. `forbidden`: the change did not come from the OpenGame site, so open the page on OpenGame and try again. `account_banned`: on a change only, OpenGame's moderators have banned the account. Calls still return. `not_launched`: the creator API is closed to this caller. It is open to each signed-in account, so sign in and try again. |
| 404 | `not_found`: no endpoint with that UUID is in this account. `game_not_found`: the game is no longer yours, or the account is not active. |
| 429 | `rate_limited`: this account made too many analytics requests. Wait `retryAfterSeconds`. |
| 500 | `internal_error`: a failure retrying cannot fix. Quote `requestId` when you report it. |
| 503 | `temporarily_unavailable`, or `rate_limited` when OpenGame could not check the rate limit: wait `retryAfterSeconds`, then retry. `platform_unconfigured`: a fault on OpenGame's side, so try again later. |

## List recent webhook deliveries for one game

`GET https://opengame.io/api/v1/analytics/deliveries`

**Authentication:** A signed-in browser session.

Browser session only. Newest first, at most 100.

### Parameters

#### Query

**game** `string` *required*

Game UUID or public ID. Example: `b3e1d9a4-27c6-4f80-9d15-0a6e8c4b2f71`.

### Request

```bash cURL theme={"system"}
curl --request GET \
  --url 'https://opengame.io/api/v1/analytics/deliveries?game=b3e1d9a4-27c6-4f80-9d15-0a6e8c4b2f71' \
  --cookie "$OPENGAME_BROWSER_COOKIE"
```

### Response 200

The deliveries.

```json theme={"system"}
{
  "deliveries": [
    {
      "id": "a9c2e5f8-1b4d-4e7a-9c3f-6d8b0e2a5c17",
      "state": "failed",
      "status_code": 410,
      "attempts": 1,
      "last_error": "http_410",
      "snapshot_id": "e41b7c90-3d2a-4f68-8b15-9a0c6e2d7f43",
      "replay_of": null,
      "created_at": "2026-10-19T06:00:05Z",
      "delivered_at": null,
      "next_attempt_at": "2026-10-19T06:00:06Z"
    }
  ]
}
```

### Errors

| Status | Meaning |
| - | - |
| 400 | `invalid_request`: pass `game`. |
| 401 | `sign_in_required`, `token_invalid` or `token_revoked`. Sign in again, or use a token that has not been revoked. |
| 403 | `insufficient_scope`: a token was used, and this operation takes a browser session only. `account_banned`: on a change only, OpenGame's moderators have banned the account. Calls still return. `not_launched`: the creator API is closed to this caller. It is open to each signed-in account, so sign in and try again. |
| 404 | `game_not_found`: no game with that UUID or public ID is for this account, or the account is not active. |
| 429 | `rate_limited`: this account made too many analytics requests. Wait `retryAfterSeconds`. |
| 500 | `internal_error`: a failure retrying cannot fix. Quote `requestId` when you report it. |
| 503 | `temporarily_unavailable`, or `rate_limited` when OpenGame could not check the rate limit. Wait `retryAfterSeconds`, then retry. |

## Read one delivery and the attempts

`GET https://opengame.io/api/v1/analytics/deliveries/{id}`

**Authentication:** A signed-in browser session.

Browser session only. A delivery is tried up to 8 times. This answer leaves out `next_attempt_at`.

### Parameters

#### Path

**id** `string` *required*

Delivery UUID. Example: `a9c2e5f8-1b4d-4e7a-9c3f-6d8b0e2a5c17`.

### Request

```bash cURL theme={"system"}
curl --request GET \
  --url 'https://opengame.io/api/v1/analytics/deliveries/a9c2e5f8-1b4d-4e7a-9c3f-6d8b0e2a5c17' \
  --cookie "$OPENGAME_BROWSER_COOKIE"
```

### Response 200

The delivery.

```json theme={"system"}
{
  "delivery": {
    "id": "a9c2e5f8-1b4d-4e7a-9c3f-6d8b0e2a5c17",
    "state": "failed",
    "status_code": 410,
    "attempts": 1,
    "last_error": "http_410",
    "snapshot_id": "e41b7c90-3d2a-4f68-8b15-9a0c6e2d7f43",
    "replay_of": null,
    "created_at": "2026-10-19T06:00:05Z",
    "delivered_at": null
  },
  "attempts": [
    {
      "attempt": 1,
      "status_code": 410,
      "error_code": "http_410",
      "finished_at": "2026-10-19T06:00:06Z"
    }
  ]
}
```

### Errors

| Status | Meaning |
| - | - |
| 401 | `sign_in_required`, `token_invalid` or `token_revoked`. Sign in again, or use a token that has not been revoked. |
| 403 | `insufficient_scope`: a token was used, and this operation takes a browser session only. `account_banned`: on a change only, OpenGame's moderators have banned the account. Calls still return. `not_launched`: the creator API is closed to this caller. It is open to each signed-in account, so sign in and try again. |
| 404 | `not_found`: no delivery with that UUID is in this account. `game_not_found`: the game is no longer yours, or the account is not active. |
| 410 | `report_expired`: the report it included is gone. |
| 429 | `rate_limited`: this account made too many analytics requests. Wait `retryAfterSeconds`. |
| 500 | `internal_error`: a failure retrying cannot fix. Quote `requestId` when you report it. |
| 503 | `temporarily_unavailable`, or `rate_limited` when OpenGame could not check the rate limit. Wait `retryAfterSeconds`, then retry. |

## Send a delivery again

`POST https://opengame.io/api/v1/analytics/deliveries/{id}/replay`

**Authentication:** A signed-in browser session.

Browser session only. Queues a new delivery of the same report, which must still be kept, to an endpoint that is turned on. A report that already reached the webhook is not sent again, and asking while one is on the way answers with that one. Replaying to an endpoint that is turned off answers 503 today.

### Parameters

#### Path

**id** `string` *required*

Delivery UUID. Example: `a9c2e5f8-1b4d-4e7a-9c3f-6d8b0e2a5c17`.

### Request

```bash cURL theme={"system"}
curl --request POST \
  --url 'https://opengame.io/api/v1/analytics/deliveries/a9c2e5f8-1b4d-4e7a-9c3f-6d8b0e2a5c17/replay' \
  --cookie "$OPENGAME_BROWSER_COOKIE" \
  --header 'Origin: https://opengame.io'
```

### Response 200

Queued, or already on the way.

```json theme={"system"}
{
  "id": "d2f8b4a6-3e1c-4a79-8b5d-0c6e9f2a7d13",
  "state": "pending"
}
```

### Errors

| Status | Meaning |
| - | - |
| 401 | `sign_in_required`, `token_invalid` or `token_revoked`. Sign in again, or use a token that has not been revoked. |
| 403 | `insufficient_scope`: a token was used, and this operation takes a browser session only. `forbidden`: the change did not come from the OpenGame site, so open the page on OpenGame and try again. `account_banned`: on a change only, OpenGame's moderators have banned the account. Calls still return. `not_launched`: the creator API is closed to this caller. It is open to each signed-in account, so sign in and try again. |
| 404 | `not_found`: no delivery with that UUID is in this account. `game_not_found`: the game is no longer yours, or the account is not active. |
| 409 | `delivery_not_replayable`: the report already reached the webhook. |
| 410 | `report_expired`. |
| 429 | `report_queue_full`: this account already has 20 analytics jobs waiting (reports, mail, exports, webhook deliveries and drain batches, scheduled ones included). Wait `retryAfterSeconds` and ask again. Or `rate_limited`: wait `retryAfterSeconds`. |
| 500 | `internal_error`: a failure retrying cannot fix. Quote `requestId` when you report it. |
| 503 | `temporarily_unavailable`: wait `retryAfterSeconds`, then retry. Today this is also the answer when the endpoint is turned off, which a retry does not fix, so turn it on first. `rate_limited` when OpenGame could not check the rate limit. `platform_unconfigured`: a fault on OpenGame's side, so try again later. |

## Read report changes since a cursor

`GET https://opengame.io/api/v1/analytics/drains`

**Authentication:** A creator token or a signed-in browser session.

For keeping a copy of this game's reports in sync, with a browser session or a token with the `read` scope. Each page holds up to 20 changes in order. Start without `cursor`, then pass `nextCursor` until `hasMore` is false; keep the last cursor to read later changes. A cursor works only for the game, `from` and `to` it was issued for. Changes older than the kept history end the cursor with `cursor_expired`, and a new drain starts again from what is kept.

### Parameters

#### Query

**game** `string` *required*

Game UUID or public ID. Example: `b3e1d9a4-27c6-4f80-9d15-0a6e8c4b2f71`.

**cursor** `string`

`nextCursor` from the previous page. At most 2048 characters.

**from** `string (date)`

Only changes to reports of weeks starting on or after this day. Each change is filed under the week's Monday. Example: `2026-10-14`.

**to** `string (date)`

Only changes to reports of weeks starting on or before this day. Example: `2026-10-21`.

### Request

```bash cURL theme={"system"}
curl --request GET \
  --url 'https://opengame.io/api/v1/analytics/drains?game=b3e1d9a4-27c6-4f80-9d15-0a6e8c4b2f71' \
  --header "Authorization: Bearer $OPENGAME_TOKEN"
```

### Response 200

A page of changes.

```json theme={"system"}
{
  "version": 1,
  "type": "analytics.incremental",
  "gameId": "b3e1d9a4-27c6-4f80-9d15-0a6e8c4b2f71",
  "events": [
    {
      "id": "2b8e4f1a-7c3d-4a96-b5e0-9d1f6c8a3e27",
      "sequence": "1842",
      "day": "2026-10-12",
      "operation": "upsert",
      "entityId": "e41b7c90-3d2a-4f68-8b15-9a0c6e2d7f43",
      "snapshotId": "e41b7c90-3d2a-4f68-8b15-9a0c6e2d7f43",
      "report": {
        "apiVersion": "1",
        "gameId": "b3e1d9a4-27c6-4f80-9d15-0a6e8c4b2f71",
        "from": "2026-10-12",
        "to": "2026-10-18",
        "timezone": "UTC",
        "minPlayers": 5,
        "filters": {},
        "summary": {
          "plays": 1284,
          "players": 412,
          "playtimeSeconds": 205600,
          "averagePlaytimeSeconds": 499,
          "returningPlayers": 97,
          "likes": 38,
          "livePlayers": null,
          "peakPlayers": 14
        },
        "window": {
          "kind": "week",
          "period": "2026-W42",
          "start": "2026-10-12T00:00:00Z",
          "end": "2026-10-19T00:00:00Z"
        },
        "comparison": {
          "from": "2026-10-05",
          "to": "2026-10-11",
          "eligible": true,
          "summary": {
            "plays": 1103,
            "players": 371,
            "playtimeSeconds": 171200,
            "averagePlaytimeSeconds": 461,
            "returningPlayers": 82,
            "likes": 29,
            "livePlayers": null,
            "peakPlayers": 12
          }
        },
        "daily": [
          {
            "day": "2026-10-12",
            "plays": 142,
            "players": null,
            "playtimeSeconds": 22700,
            "partial": false
          },
          {
            "day": "2026-10-13",
            "plays": 168,
            "players": null,
            "playtimeSeconds": 26900,
            "partial": false
          },
          {
            "day": "2026-10-14",
            "plays": 155,
            "players": null,
            "playtimeSeconds": 24800,
            "partial": false
          },
          {
            "day": "2026-10-15",
            "plays": 171,
            "players": null,
            "playtimeSeconds": 27400,
            "partial": false
          },
          {
            "day": "2026-10-16",
            "plays": 189,
            "players": null,
            "playtimeSeconds": 30300,
            "partial": false
          },
          {
            "day": "2026-10-17",
            "plays": 247,
            "players": null,
            "playtimeSeconds": 39500,
            "partial": false
          },
          {
            "day": "2026-10-18",
            "plays": 212,
            "players": null,
            "playtimeSeconds": 34000,
            "partial": false
          }
        ],
        "breakdowns": {
          "source": [
            {
              "value": "opengame",
              "label": "opengame",
              "plays": 702,
              "players": 231,
              "playtimeSeconds": 113900,
              "withheld": false
            },
            {
              "value": "direct",
              "label": "direct",
              "plays": 418,
              "players": 129,
              "playtimeSeconds": 66800,
              "withheld": false
            },
            {
              "value": "itch.io",
              "label": "itch.io",
              "plays": 164,
              "players": 52,
              "playtimeSeconds": 24900,
              "withheld": false
            }
          ],
          "surface": [
            {
              "value": "gallery",
              "label": "gallery",
              "plays": 702,
              "players": 231,
              "playtimeSeconds": 113900,
              "withheld": false
            },
            {
              "value": "game",
              "label": "game",
              "plays": 418,
              "players": 129,
              "playtimeSeconds": 66800,
              "withheld": false
            },
            {
              "value": "embed",
              "label": "embed",
              "plays": 164,
              "players": 52,
              "playtimeSeconds": 24900,
              "withheld": false
            }
          ],
          "country": [
            {
              "value": "GB",
              "label": "GB",
              "plays": 391,
              "players": 126,
              "playtimeSeconds": 63100,
              "withheld": false
            },
            {
              "value": "US",
              "label": "US",
              "plays": 344,
              "players": 108,
              "playtimeSeconds": 55800,
              "withheld": false
            },
            {
              "value": "DE",
              "label": "DE",
              "plays": 162,
              "players": 51,
              "playtimeSeconds": 25400,
              "withheld": false
            },
            {
              "value": "withheld",
              "label": "Other / withheld",
              "plays": null,
              "players": null,
              "playtimeSeconds": null,
              "withheld": true
            }
          ],
          "device": [
            {
              "value": "desktop",
              "label": "desktop",
              "plays": 1047,
              "players": 334,
              "playtimeSeconds": 172300,
              "withheld": false
            },
            {
              "value": "mobile",
              "label": "mobile",
              "plays": 237,
              "players": 78,
              "playtimeSeconds": 33300,
              "withheld": false
            }
          ],
          "build": [
            {
              "value": "0d7e3b58-6a21-4f9c-b4e2-93c1a8f05d17",
              "label": "0d7e3b58-6a21-4f9c-b4e2-93c1a8f05d17",
              "plays": 1284,
              "players": 412,
              "playtimeSeconds": 205600,
              "withheld": false
            }
          ]
        },
        "events": [
          {
            "name": "level_complete",
            "events": 2210,
            "players": 288,
            "shareOfPlayers": 0.699,
            "source": "game_reported",
            "properties": [
              {
                "key": "level",
                "value": "1",
                "events": 902,
                "players": 281
              },
              {
                "key": "level",
                "value": "2",
                "events": 731,
                "players": 204
              }
            ]
          },
          {
            "name": "marble_collected",
            "events": 18342,
            "players": 377,
            "shareOfPlayers": 0.915,
            "source": "game_reported"
          }
        ],
        "retention": [
          {
            "day": "2026-10-12",
            "players": 61,
            "day1": 0.2787
          },
          {
            "day": "2026-10-13",
            "players": 58,
            "day1": 0.2414
          }
        ],
        "survival": [
          {
            "seconds": 30,
            "players": 371,
            "share": 0.9005
          },
          {
            "seconds": 120,
            "players": 268,
            "share": 0.6505
          },
          {
            "seconds": 300,
            "players": 154,
            "share": 0.3738
          },
          {
            "seconds": 600,
            "players": 63,
            "share": 0.1529
          }
        ],
        "performance": [
          {
            "buildId": "0d7e3b58-6a21-4f9c-b4e2-93c1a8f05d17",
            "plays": 1284,
            "readyP50Ms": 1840,
            "readyP90Ms": 4210,
            "errorsPer100Plays": 0.86,
            "fpsP50": 60
          }
        ],
        "insights": {
          "from": "2026-10-12",
          "to": "2026-10-18",
          "timezone": "UTC",
          "updatedAt": "2026-10-19T06:00:00Z",
          "minPlayers": 5,
          "discovery": [
            {
              "surface": "gallery",
              "impressions": 9640,
              "pageViews": 1180,
              "plays": 702,
              "clickThrough": 0.12240663900414937,
              "playThrough": 0.5949152542372881
            }
          ],
          "sources": [
            {
              "source": "opengame",
              "players": 231,
              "averagePlaytimeSeconds": 541
            },
            {
              "source": "direct",
              "players": 129,
              "averagePlaytimeSeconds": 457
            },
            {
              "source": "itch.io",
              "players": 52,
              "averagePlaytimeSeconds": 401
            }
          ],
          "benchmarks": {
            "own": {
              "status": "unavailable",
              "games": null,
              "medianSeconds": null,
              "lowerSeconds": null,
              "upperSeconds": null
            },
            "peers": {
              "status": "available",
              "games": 38,
              "medianSeconds": 312,
              "lowerSeconds": 164,
              "upperSeconds": 655
            }
          },
          "drilldown": {
            "builds": [
              {
                "label": "v2",
                "players": 412,
                "plays": 1284,
                "averagePlaytimeSeconds": 499
              }
            ],
            "sessions": [
              {
                "label": "1 session",
                "players": 315,
                "sessions": 315
              },
              {
                "label": "2 or more",
                "players": 97,
                "sessions": 262
              }
            ],
            "errors": [
              {
                "category": "runtime",
                "kind": "webgl_context_lost",
                "players": 9,
                "errors": 11
              }
            ],
            "selectedBuild": "v2",
            "selectedSession": null
          },
          "unavailable": [
            "benchmarks.own"
          ]
        },
        "freshness": {
          "receiptWatermark": "2026-10-19T06:00:00Z",
          "dataSince": "2026-09-28T11:04:51Z",
          "updatedAt": "2026-10-19T06:00:00Z",
          "completeThrough": "2026-10-19T00:00:00Z",
          "partial": false,
          "source": "clickhouse",
          "quality": "exact",
          "unavailable": []
        }
      }
    }
  ],
  "hasMore": false,
  "nextCursor": "eyJ2ZXJzaW9uIjoxLCJvd25lciI6IjhhNGQ2YzEyLWUzZjUtNDdiOS1iMGM4LTFmMmU5ZDdhNWM2MyIsImdhbWUiOiJiM2UxZDlhNC0yN2M2LTRmODAtOWQxNS0wYTZlOGM0YjJmNzEiLCJ3aW5kb3ciOnsiZnJvbSI6IiIsInRvIjoiIn0sImFmdGVyIjoiMTg0MiIsInRocm91Z2giOm51bGx9.bf3N32gR6ONsQ5OkWfHuXyPlsouTfi0eQ1nK1Wf-KtM"
}
```

### Errors

| Status | Meaning |
| - | - |
| 400 | `invalid_request` for an unknown, repeated or invalid parameter, or `invalid_cursor` for a cursor issued for another game, `from` or `to`. |
| 401 | `sign_in_required`, `token_invalid` or `token_revoked`. Sign in again, or use a token that has not been revoked. |
| 403 | `insufficient_scope`: the token lacks the `read` scope or is pinned to another game. `account_banned`: on a change only, OpenGame's moderators have banned the account. Calls still return. `not_launched`: the creator API is closed to this caller. It is open to each signed-in account, so sign in and try again. |
| 404 | `game_not_found`: no game with that UUID or public ID is for this account, or the account is not active. |
| 410 | `cursor_expired`. Start a new drain. |
| 429 | `rate_limited`: this account made too many analytics requests. Wait `retryAfterSeconds`. |
| 500 | `internal_error`: a failure retrying cannot fix. Quote `requestId` when you report it. |
| 503 | `temporarily_unavailable`, or `rate_limited` when OpenGame could not check the rate limit. Wait `retryAfterSeconds`, then retry. |

## List drain batches the webhook did not accept

`GET https://opengame.io/api/v1/analytics/drain-batches`

**Authentication:** A signed-in browser session.

Browser session only. Newest first, at most 100. A batch with `blocking` true has stopped this game's feed: nothing newer is sent until it is delivered. Send it again with `POST /api/v1/analytics/drains/{id}/replay`.

### Parameters

#### Query

**game** `string` *required*

Game UUID or public ID. Example: `b3e1d9a4-27c6-4f80-9d15-0a6e8c4b2f71`.

### Request

```bash cURL theme={"system"}
curl --request GET \
  --url 'https://opengame.io/api/v1/analytics/drain-batches?game=b3e1d9a4-27c6-4f80-9d15-0a6e8c4b2f71' \
  --cookie "$OPENGAME_BROWSER_COOKIE"
```

### Response 200

The failed batches.

```json theme={"system"}
{
  "batches": [
    {
      "id": "4e8b1d6a-9c3f-4a25-8e7d-0b5c2f9a3d61",
      "status_code": 410,
      "attempts": 1,
      "from_sequence": "1801",
      "to_sequence": "1842",
      "blocking": true,
      "created_at": "2026-10-19T06:01:10Z",
      "replaying": false
    }
  ]
}
```

### Errors

| Status | Meaning |
| - | - |
| 400 | `invalid_request`: pass `game`. |
| 401 | `sign_in_required`, `token_invalid` or `token_revoked`. Sign in again, or use a token that has not been revoked. |
| 403 | `insufficient_scope`: a token was used, and this operation takes a browser session only. `account_banned`: on a change only, OpenGame's moderators have banned the account. Calls still return. `not_launched`: the creator API is closed to this caller. It is open to each signed-in account, so sign in and try again. |
| 404 | `game_not_found`: no game with that UUID or public ID is for this account, or the account is not active. |
| 429 | `rate_limited`: this account made too many analytics requests. Wait `retryAfterSeconds`. |
| 500 | `internal_error`: a failure retrying cannot fix. Quote `requestId` when you report it. |
| 503 | `temporarily_unavailable`, or `rate_limited` when OpenGame could not check the rate limit. Wait `retryAfterSeconds`, then retry. |

## Read one drain batch and the attempts

`GET https://opengame.io/api/v1/analytics/drains/{id}`

**Authentication:** A creator token or a signed-in browser session.

Reads one batch of drain changes sent to this game's webhook, in any state, with each attempt. Takes a browser session or a token with the `read` scope.

### Parameters

#### Path

**id** `string` *required*

Batch UUID. Example: `4e8b1d6a-9c3f-4a25-8e7d-0b5c2f9a3d61`.

### Request

```bash cURL theme={"system"}
curl --request GET \
  --url 'https://opengame.io/api/v1/analytics/drains/4e8b1d6a-9c3f-4a25-8e7d-0b5c2f9a3d61' \
  --header "Authorization: Bearer $OPENGAME_TOKEN"
```

### Response 200

The batch.

```json theme={"system"}
{
  "batch": {
    "id": "4e8b1d6a-9c3f-4a25-8e7d-0b5c2f9a3d61",
    "game_id": "b3e1d9a4-27c6-4f80-9d15-0a6e8c4b2f71",
    "state": "failed",
    "attempts": 1,
    "status_code": 410,
    "from_sequence": 1801,
    "to_sequence": 1842,
    "replay_of": null,
    "created_at": "2026-10-19T06:01:10Z"
  },
  "attempts": [
    {
      "attempt": 1,
      "status_code": 410,
      "finished_at": "2026-10-19T06:01:11Z"
    }
  ]
}
```

### Errors

| Status | Meaning |
| - | - |
| 401 | `sign_in_required`, `token_invalid` or `token_revoked`. Sign in again, or use a token that has not been revoked. |
| 403 | `insufficient_scope`: the token lacks the `read` scope or is pinned to another game. `account_banned`: on a change only, OpenGame's moderators have banned the account. Calls still return. `not_launched`: the creator API is closed to this caller. It is open to each signed-in account, so sign in and try again. |
| 404 | `not_found`: no drain batch with that UUID is in this account. `game_not_found`: the game is no longer yours, or the account is not active. |
| 429 | `rate_limited`: this account made too many analytics requests. Wait `retryAfterSeconds`. |
| 500 | `internal_error`: a failure retrying cannot fix. Quote `requestId` when you report it. |
| 503 | `temporarily_unavailable`, or `rate_limited` when OpenGame could not check the rate limit. Wait `retryAfterSeconds`, then retry. |

## Send a drain batch again

`POST https://opengame.io/api/v1/analytics/drains/{id}/replay`

**Authentication:** A signed-in browser session.

Browser session only. Queues the same changes to the webhook again. Changes that already reached it are not sent again, and asking while they are on their way answers with that batch.

### Parameters

#### Path

**id** `string` *required*

Batch UUID. Example: `4e8b1d6a-9c3f-4a25-8e7d-0b5c2f9a3d61`.

### Request

```bash cURL theme={"system"}
curl --request POST \
  --url 'https://opengame.io/api/v1/analytics/drains/4e8b1d6a-9c3f-4a25-8e7d-0b5c2f9a3d61/replay' \
  --cookie "$OPENGAME_BROWSER_COOKIE" \
  --header 'Origin: https://opengame.io'
```

### Response 200

Queued, or already on the way.

```json theme={"system"}
{
  "id": "5e9a3c7f-2b6d-4f18-9a4e-1d7c0b8f3e65",
  "state": "pending"
}
```

### Errors

| Status | Meaning |
| - | - |
| 401 | `sign_in_required`, `token_invalid` or `token_revoked`. Sign in again, or use a token that has not been revoked. |
| 403 | `insufficient_scope`: a token was used, and this operation takes a browser session only. `forbidden`: the change did not come from the OpenGame site, so open the page on OpenGame and try again. `account_banned`: on a change only, OpenGame's moderators have banned the account. Calls still return. `not_launched`: the creator API is closed to this caller. It is open to each signed-in account, so sign in and try again. |
| 404 | `not_found`: no drain batch with that UUID is in this account. `game_not_found`: the game is no longer yours, or the account is not active. |
| 409 | `drain_not_replayable`: the changes already reached the webhook, a report in them is no longer kept, or the endpoint is turned off. Today a failure on OpenGame's side also answers this, so check the batch with `GET /api/v1/analytics/drains/{id}` before you give up on it. |
| 429 | `report_queue_full`: this account already has 20 analytics jobs waiting (reports, mail, exports, webhook deliveries and drain batches, scheduled ones included). Wait `retryAfterSeconds` and ask again. Or `rate_limited`: wait `retryAfterSeconds`. |
| 500 | `internal_error`: a failure retrying cannot fix. Quote `requestId` when you report it. |
| 503 | `temporarily_unavailable`, or `rate_limited` when OpenGame could not check the rate limit: wait `retryAfterSeconds`, then retry. `platform_unconfigured`: a fault on OpenGame's side, so try again later. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.