Incremental catalog changes v1

Use this catalog-wide feed to keep a local catalog current without repeatedly comparing all listing timestamps. It returns minimal created, updated and removed events. Fetch details for current values; use a listing's historyUrl for before/after pricing and capability changes.

HTTP, MCP and A2A

GET /api/changes
GET /api/changes?since=2026-11-03T10%3A00%3A00.000Z&limit=50
GET /api/changes?cursor=<nextCursor>&limit=50
GET /api/changes?after=<syncToken>&limit=50

MCP: get_catalog_changes {"since":"2026-11-03T10:00:00.000Z","limit":50}
A2A data part: {"skill":"get-catalog-changes","since":"2026-11-03T10:00:00.000Z","limit":50}

No sign-in or key is needed. HTTP supports GET/OPTIONS, CORS, no-store responses and the shared 60 requests/minute/IP agent budget. A2A uses SendMessage with A2A-Version: 1.0. limit is 1–100, default 50. Use at most one of since, cursor or after; unknown and repeated parameters are errors.

Response example

{
  "schemaVersion": 1,
  "feedStartedAt": "2026-11-03T09:00:00.000Z",
  "earliestSupportedAt": "2026-11-03T09:00:00.000Z",
  "retentionDays": 90,
  "since": "2026-11-03T10:00:00.000Z",
  "capturedAt": "2026-11-03T11:00:00.000Z",
  "upperSequence": "120",
  "changes": [
    {
      "eventId": "119",
      "id": "stable-listing-id",
      "slug": "example",
      "type": "updated",
      "reason": "material_update",
      "changedAt": "2026-11-03T10:30:00.000Z",
      "url": "https://agentmarket.trade/products/example",
      "detailsUrl": "https://agentmarket.trade/api/products/example"
    }
  ],
  "hasMore": false,
  "nextCursor": null,
  "syncToken": "opaque-polling-checkpoint",
  "cursorExpiresAt": "2026-11-04T11:00:00.000Z",
  "syncTokenExpiresAt": "2027-02-01T11:00:00.000Z"
}

Applying changes

Events contain stable listing IDs and event IDs, not full listing payloads. A details lookup after an event may reflect a newer state or return 404 if the listing has since disappeared; treat 404 as unavailable. Apply events in feed order and deduplicate retries by eventId. Several events for one listing can occur over time; an unpublish followed by deletion may produce two removal events, which are safe to apply idempotently.

Canonical route and listing timestamps

GET /api/changes is the canonical incremental contract. The search endpoint does not accept since; its validation error links here. HTTP, MCP get_catalog_changes and A2A get-catalog-changes share the same feed. Per-listing history is a separate before/after record, not the discovery cursor.

Search results (including sponsored listings) and listing details expose publishedAt and updatedAt as UTC timestamps. publishedAt is the recorded first public availability time and does not reset for edits, withdrawal or republication. Unknown legacy publication dates remain null rather than being inferred from creation or edit time. Future first publications are stamped by the database.

updatedAt is the latest committed public material catalog event, including nested pricing/interface changes and public provider/category/tag changes. Private credentials, moderation notes, search maintenance and no-op replacements do not advance it. Existing rows are initialized from retained non-baseline public events, or their prior row timestamp where no such event survives; that legacy fallback is best-known metadata, not reconstructed historical evidence.

sort=newest orders current published search results by first publishedAt descending, with unknown dates last, then name and stable ID for ties. Editing an old listing does not make it newly published. sort=updated separately orders by material updatedAt descending with the same tie-breakers. Search page numbers are not feed cursors; use this endpoint for deterministic change traversal.

Timestamp and ordering semantics

since is inclusive: changedAt ≥ since. Supply an ISO-8601 timestamp with an explicit timezone and at most millisecond precision. Offsets are normalized to UTC; responses always use UTC Z. Naive dates, impossible dates, future timestamps and finer precision are rejected. changedAt is the server time assigned to a change within its committing transaction, not the provider's reported update date.

Events sort by ascending global sequence, serialized as strings to avoid JavaScript integer precision loss. Equal timestamps are ordered by sequence. A transactional database counter serializes feed commits; a visible upperSequence never has a lower uncommitted event arrive beneath it later. The deferred checks compare the final transaction state and canonical public metadata, so replaced row IDs and no-op saves do not generate events.

Safe traversal and subsequent polling

  1. Start with since, or omit it to request the earliest supported window. The first response freezes upperSequence.
  2. While hasMore is true, send nextCursor as cursor. Do not also send since or after. The signed cursor binds the original window and upper boundary; changing page size is allowed. New events committed during traversal are held for the next poll.
  3. Only after the final page returns hasMore false, save syncToken. Send it as after to open a fresh traversal for later sequences. Replace it with the new syncToken when that traversal completes.

Do not poll using capturedAt as the next since: an in-flight transaction could have an earlier timestamp but commit after that boundary. The sequence-based syncToken handles that case. Manually repeating inclusive since requests may repeat boundary events; deduplicate by eventId. Page retries are safe while their cursor remains valid.

Window, expiry and bootstrap guarantees

The initial timestamp window is the last 90 days, limited by feedStartedAt. earliestSupportedAt advertises the exact lower bound. Rollout emits baseline creations for listings already published, with the observation time rather than invented historical creation dates. Changes before rollout are unknown; once those baselines age out, this feed is not a full catalog snapshot.

Complete a frozen traversal within 24 hours. Final polling checkpoints expire after 90 days, and are also invalid if required events have been pruned or the feed has been reset. Physical events, including deletion tombstones, are pruned on later feed writes after a 91-day buffer, preserving the guaranteed initial window plus traversal time. Endpoint reads never prune data. Token-signing secret rotation invalidates existing tokens.

For an initial/full refresh, first finish a feed traversal and retain its syncToken, then fetch the full catalog and catch up with after=syncToken. This catches changes committed during the refresh. Do not interpret an empty feed as evidence that the catalog is empty or never changed.

HTTP 400 invalid_input covers malformed timestamps, tokens, combined selectors and limits. HTTP 410 window_expired covers unsupported old windows, expired tokens and resets; range errors include the supported window. Refresh your catalog and obtain a fresh checkpoint after 410. HTTP 429 includes Retry-After; HTTP 503 unavailable indicates feed initialization or cursor-signing setup is unavailable.

Privacy and material fields

Never-published drafts do not appear. Returning a listing to review emits only removal, using its last public slug. Draft descriptions, prices, capability values, moderation state and private slugs stay private until republished. Deletion tombstones outlive the listing but contain only the minimal public ID/slug/event metadata; no account identity, credentials, private notes or listing payload is retained in the feed.

Material metadata includes public descriptions, URLs, types, category, tags, capabilities and evidence, pricing, interface/API access, public trial availability, listing verification/demo flags and public provider profile/claim changes. Usage/ranking counters, search reindexing, history counters, private trial credentials, moderation notes and computed freshness aging do not generate feed updates.

Deployment verification

Deploy the release and run prisma migrate deploy against the same database before routing traffic. /api/changes responses identify X-AgentMarket-Catalog-Contract: 1 and, on Vercel when configured, X-AgentMarket-Commit. Missing feed tables/columns return 503 unavailable with migration guidance. Missing feed initialization or token-signing configuration also returns 503. A 404 or absent contract marker can indicate a stale build or incorrect route/origin; verify the deployed commit before changing client queries.

npm run smoke:catalog -- https://agentmarket.trade /tmp/catalog-production-smoke.json

The read-only smoke script requires Node/npm and curl. It preserves the host proxy/CA configuration, bounds requests and response bytes, and records request URLs, application HTTP statuses, contract/release headers and representative bodies for initial feed traversal, listing timestamps/history, since and incremental after polling. It does not publish or edit production listings. A null application status means no app response was received; transportStatus can identify a proxy rejection. A blocked or skipped check is a failure, never a successful production verification. The script samples discovery rather than building a full catalog mirror.