Download Markdown

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

EventCreated whenThen read
document.createdA new document is storedRead documents in batch
document.version.createdTitle, body or other content changes and a new version is createdRead that version’s body with version_id
document.metrics.updatedMetrics changeRead metric snapshots

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

First read

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_ids on a page and read them in batch.

ParameterMeaning
cursorThe previous page’s next_cursor. Omit on the first read
limit1 to 200 per page, default 100
event_typeEvent types, comma-separated
source_platformPlatforms, comma-separated
ingested_from, ingested_toFilter by ingest time, RFC 3339

The sync 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

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

  • 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

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

  • 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 by ingest time.

When something fails

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. The Python and Go SDKs work too, but you still save the cursor yourself.