offset until a page comes back short or empty.
Prerequisites
- A Bright Data API key with Business Search access, stored in the
BRIGHTDATA_API_KEYenvironment variable as in Step 1 of the quickstart - A query whose first page already returns the records you want. Tune the conditions with Business Search query syntax before you paginate
Step 1: Send the first page
Send the search withoffset set to 0 and limit set to the page size. limit defaults to 10 and its maximum depends on the mode:
How far a search can page also depends on the mode:
- Ludicrous accepts
offsetvalues up to 10,000, so one search can page through up to 10,100 records. - Instant and Smart expose only the first 100 matches of a search.
offsetpluslimitcannot exceed 100, so paginate inside that window or run the same conditions as a structured query in Ludicrous mode.
meta.offset and meta.limit and returns the page in documents. The full meta schema is on the search companies API reference.
Step 2: Request the next page
Addlimit to offset and send the body again with every other property unchanged. The category, source, mode, query and view must stay the same, because changing any of them starts a different search.
After a full first page, this request asks for records 101 to 200 of the same search. Only the highlighted offset changes:
Step 3: Stop on a short or empty page
Stop whendocuments comes back empty or shorter than limit. That page is the last page of the result set.
A Ludicrous request past the last match returns HTTP 200 with an empty documents array, so an empty page is the normal end of a search, not an error. If an Instant or Smart request returns HTTP 500 with error_code backend_search_failed after earlier pages succeeded, the loop has stepped past the 100-record window of those modes. Other causes of each status are listed in Business Search error codes.
An empty documents array on the first page means the search matched nothing. It is not proof that no such company or person exists.
Step 4: Deduplicate the collected records
Each page is a new search against the current index, not a slice of a fixed snapshot, so a record can move between pages while you paginate. Collect every page in one pass and deduplicate onbright_id plus source. Do not re-fetch a single page later and expect the same records.
Frequently asked questions
Can I use meta.matched as the number of results?
No.meta.matched reports how many matches the search reached. Treat it as a lower bound rather than an exhaustive count, particularly for text and natural-language searches, and expect it to grow as offset grows. Do not use it to size a dataset or to tell users that exactly that many companies or people satisfy their intent.
How do I collect more than 100 records from an Instant or Smart search?
Run the same conditions as a structured query in Ludicrous mode. Instant and Smart expose only the first 100 matches of a search, while Ludicrous pages up tooffset 10,000. Business Search query syntax lists the operators and searchable fields for the structured form.
What does meta.coverage_percent mean for a paginated set?
meta.coverage_percent reports the share of the index that answered the request. A value below 100 means the result set is partial, and a results page built on that response should say so. A value of 100 does not mean every relevant record was returned or every field was populated.