Skip to content

B2B Leads API Pagination: Pages, Checkpoints and Duplicates

Implement numeric pagination for Dievio lead search with stable job definitions, durable page checkpoints and explicit duplicate review.

Dievio Team · Growth Systems · May 28, 2026 · 4 min read

A stack advances one saved page into a checkpoint before the next page moves, beneath Save the Page, Then Advance.

Key points

  • Use the documented numeric page and effective page-size fields.
  • Store successful responses before advancing the checkpoint.
  • Reconcile overlap and uncertainty without assuming a stable snapshot.

Dievio's public lead-search API uses numeric pages. A reliable extraction job keeps the filter set and page size consistent, stores each successful response, and advances its checkpoint only after the page is safely recorded.

This guide covers the retrieval loop. For queue sizing and downstream work, use the batch processing guide; for concurrency and failure recovery, use pagination and request controls.

Use the pagination contract the endpoint actually returns

Send a JSON request to POST https://dievio.com/api/public/search, authenticated with your API key as a bearer token. The pagination inputs are _page and _per_page. A result cap belongs in max_results.

{
  "company_websites": ["stripe.com", "webfx.com"],
  "job_titles": ["Head of Sales", "VP of Sales", "Sales Director", "Director of Sales"],
  "include_emails": true,
  "include_phones": false,
  "email_status": "verified",
  "_page": 1,
  "_per_page": 4,
  "max_results": 6
}

In a November 2026 test, the first page returned four records with next_page: 2. The second returned two different records with per_page: 4 and next_page: null. This paid example uses one API credit per new returned record. Counts depend on the available data. Read the pagination contract.

Fields used to control a page loop
FieldMeaning in your client
preview_dataThe returned record array to validate and persist
page and per_pageThe effective page and page size reported by the response
has_moreWhether the response offers another page within the current retrieval scope
next_pageThe next numeric page, when available
max_resultsThe requested upper bound for this extraction

Keep filters and page size part of the checkpoint

Record a job definition before the first call: normalized filters, requested page size, result cap and the intended destination. Give the definition a stable reference. A checkpoint without that context is difficult to interpret after a restart.

Do not change a filter halfway through the same job. If a segment needs refining, create a new job definition and reconcile overlap explicitly. The search filter guide belongs before extraction, when changing the audience is still inexpensive.

Keep _per_page, max_results and the filters fixed while following next_page. The final page can return fewer records than the fixed page size. If a page would exceed the available balance, HTTP 402 leaves it unpaid. Top up and retry the same page with the same parameters.

When a run behaves differently from its definition, use the API debugging checklist to compare request inputs and observed responses. Keep the error-code troubleshooting guide alongside it for failures that require a different recovery action.

Persist the response before advancing

  1. Load the job and checkpoint. Confirm that the filters and page size match the stored definition.
  2. Request the current page. Save a unique Idempotency-Key with the page parameters before sending the first attempt. Reuse it after a timeout within the one-hour replay window. Read the retry rules.
  3. Validate the response. Check success, record-array shape and pagination fields before treating it as a completed page.
  4. Store the page durably. Save returned records and the relevant response metadata.
  5. Commit the checkpoint. Mark the stored page complete and record the reported next page where available.
  6. Apply stop rules. Finish on the result cap, no further page, an empty result, an unresolved response inconsistency or the operating budget.

A source page can be stored even when a later CRM write fails. Resume that write from stored data instead of immediately repeating the source request. See the CRM sync workflow for field ownership and destination recovery.

Dievio

Your workflow. Powered by Dievio.

Bring B2B contact search and LinkedIn enrichment into the tools you already use.

Explore Dievio API

Search contacts · Enrich profiles · Export results

Dievio APIExample
POST /api/public/search{ "job_titles": ["Founder"], "max_results": 10 }
Contacts ready for your workflow

Handle duplicates and changing results explicitly

Numeric pagination can produce overlap or gaps when the underlying result set changes. Deduplicate returned records using identifiers and matching rules your data actually supports. Do not treat a guessed name-and-company match as a guaranteed identity.

Deduplication can prevent repeated destination actions, but it cannot recover an unseen record or make the source a stable snapshot. If completeness matters, define a reconciliation process and record that limitation in delivery reports.

A scheduled second run is a new retrieval. It is not an incremental change feed merely because it starts from yesterday's page number. Use a documented change token only when the provider actually supplies one.

Separate count preview from extraction totals

A free count preview can help assess the size of a segment before retrieval. Matching contact records are not unique companies, usable mailboxes or a market-size estimate.

Do not interpret every total-like response field as a fully enumerated, immutable total. Keep requested scope, returned rows, unique accepted records and unresolved rows as separate measures. The preview versus retrieval guide explains the operational distinction.

Test recovery before increasing scope

  • Restart after a stored page but before the destination write.
  • Return duplicate records in fixtures and check that the destination action is not repeated.
  • Test a short final page, an empty array and inconsistent pagination fields.
  • Simulate HTTP 402, then top up and retry the same page with the same size and result cap.
  • Confirm that a timeout does not silently advance the checkpoint.

Use local fixtures for these cases and a deliberately small live run for contract validation. The testing guide separates mock tests from paid retrieval.

Keep reading

Build your first list.

100 free credits. No credit card required.

Start free