---
title: Change Feed
description: Keep pulling new documents, new versions and metric changes to sync data into your own system.
type: guide
status: stable
updated: 2026-12-03
url: /en/docs/change-feed
markdown: /en/docs/change-feed.md
---

Read as needed; not a required onboarding step. Path：[Data Access Path](/en/docs)

# Change Feed

The change feed lets your program keep pulling "which documents are new or changed", then read details as needed. By the end of this page you can write a sync job that misses nothing.

It's pull-only: your program polls, and MarsYoo never pushes.

## Event types [#events]

| Event | Created when | Then read |
| --- | --- | --- |
| `document.created` | A new document is stored | [Read documents in batch](/en/docs/documents#batch) |
| `document.version.created` | Title, body or other content changes and a new version is created | [Read that version's body](/en/docs/documents#content) with `version_id` |
| `document.metrics.updated` | Metrics change | [Read metric snapshots](/en/docs/metrics#document) |

Delete and takedown events aren't reliable yet; don't use them to sync deletions.

## First read [#first]


```bash
curl -sS --get "$WHALE_BASE_URL/v1/changes" \
  -H "Authorization: Bearer $WHALE_API_KEY" \
  --data-urlencode "event_type=document.created,document.version.created,document.metrics.updated" \
  --data-urlencode "limit=100"
```


Without `cursor`, reading starts from the earliest event in the retention window.


```json
{
  "items": [
    {
      "sequence": 42,
      "event_id": "chg_xxx",
      "event_type": "document.version.created",
      "source_platform": "reddit",
      "document_id": "doc_xxx",
      "version_id": "ver_xxx",
      "changed_fields": ["title", "body", "metadata"],
      "occurred_at": "2026-10-09T11:55:00Z",
      "ingested_at": "2026-10-09T12:00:02Z"
    }
  ],
  "next_cursor": "opaque-cursor"
}
```


Events carry only IDs and changed field names, no body. Collect the `document_id`s on a page and [read them in batch](/en/docs/documents#batch).

| Parameter | Meaning |
| --- | --- |
| `cursor` | The previous page's `next_cursor`. Omit on the first read |
| `limit` | 1 to 200 per page, default 100 |
| `event_type` | Event types, comma-separated |
| `source_platform` | Platforms, comma-separated |
| `ingested_from`, `ingested_to` | Filter by ingest time, RFC 3339 |

## The sync loop [#loop]

1. Request a page with your saved cursor.
2. Process every event on the page.
3. After processing succeeds, save `next_cursor`.
4. Request the next page with the new cursor.

> Note: Always finish the whole page before saving the cursor. Save first and crash mid-way, and you'll skip events.

The same cursor always returns the same page.

### An empty page doesn't mean you're done [#empty-page]

Each request searches for up to 8 seconds. Events outside your access are filtered out, so a page may have fewer than `limit` events or none at all, while `next_cursor` still moves forward.

- Process and save that cursor, then keep requesting.
- When the cursor stops changing, there are no new events for now; wait before requesting again.

### Deduplication [#dedupe]

- Every event is delivered at least once. Rarely, the same event appears twice with the same `event_id` and different `sequence`. Deduplicate by `event_id` or make processing idempotent.
- Events come in increasing `sequence`. Gaps in `sequence` are normal, not losses.

### Cursors are tied to filters [#cursor-scope]

A cursor works only with the application and filters that produced it. If you change application, event types, platforms or time filters, start again without the old cursor.

## Latency and retention [#retention]

- New events are readable about 2 to 3 minutes after ingest.
- Events are kept for 30 days. Older cursors return `410`.
- If your job may stop for a long time, monitor when the cursor was last saved so it doesn't exceed retention.

On `410`:

1. Drop the cursor and read again from the earliest retained event.
2. Fill the gap with a [bulk export](/en/docs/exports) by ingest time.

## When something fails [#errors]

On `503 changes_timeout` or `changes_unavailable`, wait for `Retry-After` and retry with **the same cursor**. Don't skip ahead.

Other errors: [Error codes](/en/docs/errors). The [Python and Go SDKs](/en/docs/sdk) work too, but you still save the cursor yourself.

## Continue Your Task

[Return to the integration path](/en/docs); return to your task after consulting this reference.
