Resolve the profile first

Start with the profile check endpoint. It gives your integration one place to validate a username before requesting larger post or engagement datasets.

Store the normalized username and the time it was checked. That makes later jobs repeatable when a display name changes or a profile temporarily becomes unavailable.

Treat cursors as checkpoints

Fetch posts in bounded pages and persist the cursor after each successful response. If a worker stops, resume from the last checkpoint instead of starting the whole collection again.

Keep the API response beside your own transformed record until the pipeline is stable. Raw snapshots make schema changes and parsing bugs much easier to diagnose.

Make retries deliberate

Retry rate limits and temporary server failures with exponential backoff and jitter. Avoid retrying validation errors because the same request will keep failing.

Attach your own job identifier to logs, record the returned status, and make writes idempotent. Those three details prevent duplicate posts when a request succeeds but the worker loses its connection before acknowledging it.