Skip to content

Designing pagination and retries for scraper runs

Engineering · Sep 30, 2026 · BatScrape Team

Illustration accompanying designing pagination and retries for scraper runs

Pagination turns one request into a sequence of decisions: where to start, when to continue, and when enough data has been collected. Retries add another question: what should happen when a run stops partway through?

These are design questions for BatScrape’s Actors in development. We have not released a universal resume mechanism or a guarantee of free retries.

Define progress for each source

Some sources expose a cursor; others use page numbers or offsets. A progress marker is useful only if it still refers to the intended next result when the run continues. Results may change between requests.

Document the source’s behavior before deciding what to persist. Keep the requested limit separate from the number of records actually collected.

Think about duplicates

A retry can repeat work. Where a source provides a stable identifier, it can help recognize records already seen. Without one, a deduplication strategy needs explicit assumptions and sample tests.

Saving progress and saving output also need careful ordering. A checkpoint that advances beyond durable output can skip records on the next attempt.

Verify the promise

Test interruption before and after a page is written. Check the resulting dataset for gaps and duplicates. Then describe the actual behavior in the Actor’s documentation, including limitations. Run costs and retry behavior should be checked on the published listing rather than inferred from a design article.

BatScrape Team

Building BatScrape

Back to blog

YOUR NEXT DATA PROJECT STARTS HERE

Explore a source. Imagine what’s next.

From public platforms to structured data. We’re building source-specific Actors for Apify, so you can spend more time on what comes next.

Building on Apify JSON / CSV

TikTok Shop, Reddit, Threads, TikTok, Douyin, FollowScores, and Realtor.com are live on Apify. The other sources in the example are planned.

LIVE & PLANNED SOURCES → EXAMPLE DATASET

BAT SCRAPE
Runs on Apify
{ } your-data.json JSON
{
  "id": "0000000000000000001",
  "description": "Example description #example",
  "createDate": "2026-09-01",
  "searchKeyword": "coffee"
}

Pick a platform. See what comes out.

your-data.json EXAMPLE
{
  "id": "0000000000000000001",
  "description": "Example description #example",
  "createDate": "2026-09-01",
  "searchKeyword": "coffee"
}