Case study 02 · Python · API integration

An API sync designed to rerun safely.

The demonstration moves records between mocked REST APIs while preserving progress, avoiding duplicates, recovering from temporary failures, and isolating records that cannot be written.

Public demonstration using synthetic, mocked, or fictional data; not a paid-client result. Both APIs are mocked in-process; compatibility with an undocumented third-party API is not implied.

5/5focused tests
9successful first-run upserts
1poison record isolated

// try the browser demo

Incremental sync · runs in this page

Run it twice

The first run processes every record after the in-page cursor. Run it a second time without changing anything and it becomes a clean no-op — that is the whole point. Add a row with state poison to watch a record dead-letter without blocking the batch.

Use synthetic sample data only. Do not enter confidential information, personal data, credentials, or customer records. Input stays in this page and is discarded on reload or close.

A poison record is isolated after retries; it does not block the other writes.
pulled
upserted
isolated
Ready. Run the first sync, then rerun it to prove the no-op path.
Public demonstration · two mocked REST APIs · no production credentials

// system flow

Read in-page cursorIncremental pullIdempotent upsertRetry temporary errorsAdvance or dead-letter

The failure modes

Quick sync scripts commonly repeat full pulls, duplicate records on rerun, drop rate-limited writes, or let one malformed record block the remaining batch.

Incremental state

An updated_since cursor limits each run to new or changed records. This browser demonstration keeps that cursor only in page memory; the demonstrated second run pulls zero records until reset or reload.

Safe writes

Idempotent upserts prevent duplicate creation and refuse to overwrite a newer destination record with stale source data.

Failure isolation

Rate limits and server failures retry with exponential backoff. A record that still fails moves to a dead-letter queue so the rest of the batch completes.

// verified behaviors

10 pulled → 9 upserted + 1 dead-lettered → second run: 0 pulled

The test suite covers full-to-incremental behavior, poison-record isolation, newer-record protection, exhausted retries, and retry recovery. Real delivery still requires official API documentation, authorized credentials, field mappings, and acceptance examples.

What two systems need to agree?

Send both API documents, the update direction, and redacted example payloads.

contact@metaworld.systems