> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blitz-api.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> BlitzAPI is the B2B Data API for GTM Builders: company and people search, enrichment, verified emails, US phone numbers and job postings behind one API key.
> Its data infrastructure holds 1B+ records: 550M+ professional profiles, 65M+ companies, 65M+ verified emails, 100M+ job postings and 45M+ US phone numbers.
> Pricing: Start $99, Scale $499, Build Your Infra from $999; every endpoint on every plan; fair use policy in records per month; rate limits per endpoint. Details: https://docs.blitz-api.ai/guide/concepts/pricing
> Company and product facts: https://www.blitz-api.ai/llms.txt

# SDK Pagination: Stream Results Across Pages

> Stream search results across pages with the Python and TypeScript SDKs, cap the records you pull with max_items, or fetch each page yourself.

> **Agents & LLMs**: a Markdown version of this page is available by appending `.md` to the URL, and the full documentation index is at [llms.txt](https://docs.blitz-api.ai/llms.txt).

In the BlitzAPI SDKs, the list methods return an **auto-paginating page**. Iterate it and the SDK fetches each subsequent page for you, with no cursor or page bookkeeping. Each result returned counts as one record, so bound the loop with `max_items` or page manually. This works identically in Python and TypeScript; only the syntax differs.

## Which methods paginate

| Method | Pagination |
| :- | :- |
| `client.search.people()` | Cursor-based |
| `client.search.companies()` | Cursor-based |
| `client.search.employee_finder()` | Page-based |
| `client.company.tam_by_jobs()` | Cursor-based |
| `client.company.tam_by_people()` | Cursor-based |
| `client.jobs.search()` | Cursor-based |
| `client.jobs.company()` | Cursor-based |
| `client.search.waterfall_icp()` | None (one ranked result set) |
| `client.changelog.list()` | None (a plain array of entries) |
| `client.enrichment.*` / `client.utils.*` / `client.account.*` | None (a single response) |

Cursor vs page is an implementation detail: the SDK exposes the same interface for both. Cursors are stable even if new records are added between calls, so you won't see duplicates.

> [!NOTE]
>
> `company.tam_by_jobs` and `company.tam_by_people` pages carry no `total_results` (the API omits it for TAM), so iterate until the `cursor` is `null`. `job.min_per_company` (or `people.min_per_company`) can also make a page come back partial: keep paging rather than stopping on a short page.

## Stream every result

Iterate the returned page to walk every match across all pages. Each page is fetched on demand, through the client's [rate limiter](https://docs.blitz-api.ai/sdks/rate-limits.md).

```python Python theme={null} theme={null}
# The SDK fetches each subsequent page for you.
for person in client.search.people(people={"job_level": ["VP"]}):
    print(person.full_name)
```

```ts TypeScript theme={null} theme={null}
// The SDK fetches each subsequent page for you.
for await (const person of client.search.people({ people: { job_level: ["VP"] } })) {
  console.log(person.full_name);
}
```

> [!WARNING]
>
> `max_results` is the **page size** (1–50), not a total, and each result returned counts as **1 record** against your fair use policy. A bare loop streams *every* match up to the server-side cap (people / companies: 50,000 results or 1,000 pages; TAM by jobs / TAM by people: 50,000 companies; employee finder: 10,000; jobs: 5,000). The page that reaches the cap looks like a normal end of results. Bound it with `max_items`, `break` out of the loop, or drive pages manually (below).

## Bound how much you pull

`max_items` is a **client-side** total cap: it stops the SDK fetching once reached and is never sent on the wire. Use it (with `max_results` tuned for page size) to keep the records counted against your fair use policy predictable.

```python Python theme={null} theme={null}
# Stop after 200 results, across however many pages that takes.
for person in client.search.people(people={"job_level": ["VP"]}).auto_paging_iter(max_items=200):
    print(person.full_name)
```

```ts TypeScript theme={null} theme={null}
// max_items goes in the options object.
for await (const person of client.search.people({ people: { job_level: ["VP"] }, max_items: 200 })) {
  console.log(person.full_name);
}

// Or collect into an array (also honors max_items):
const people = await client.search.people({ people: { job_level: ["VP"] }, max_items: 200 }).collect();
```

## Per-page and manual control

Take the first page, inspect totals and cursors, and fetch the next page yourself when you need explicit control over the loop and the records it uses.

```python Python theme={null} theme={null}
# First page + manual paging.
page = client.search.people(people={"job_level": ["VP"]}, max_results=50)
print(page.results, page.cursor)        # items on this page; cursor is None once exhausted
nxt = page.get_next_page()              # None once exhausted

# Or walk pages and inspect totals as you go.
for p in client.search.companies(company={"industry": {"include": ["Software Development"]}}).iter_pages(max_pages=5):
    print(p.total_results, len(p.results), p.cursor)
```

```ts TypeScript theme={null} theme={null}
// First page + manual paging.
const page = await client.search.companies({ company: { industry: { include: ["Software Development"] } }, max_results: 25 });
page.data;                    // Company[]: items on this page
page.response.total_results;  // the full parsed response (snake_case, 1:1 with the API)
if (page.has_next_page()) {
  const next = await page.get_next_page();
}

// Or walk pages directly:
const first = await client.search.employee_finder({ company_linkedin_url: "https://www.linkedin.com/company/openai", max_results: 50 });
for await (const p of first.iter_pages()) {
  console.log(`page ${p.response.page}/${p.response.total_pages}: ${p.data.length} items`);
}
```

## Page object shape

* **Python**: items are on `page.results`; cursor on `page.cursor`. The page types (`CursorPage`, `PageNumberPage`, and their `Async*` variants) are exported from `blitz_api`.
* **TypeScript**: items are on `page.data`; the full parsed response (snake\_case, 1:1 with the API, e.g. `total_results`, `page`, `total_pages`) is on `page.response`.

## Next steps

> [card] [Rate limits & retries](https://docs.blitz-api.ai/sdks/rate-limits.md)
>
> How the client-side limiter and automatic `429`/`5xx` retries work.

> [card] [Python SDK](https://docs.blitz-api.ai/sdks/python.md)
>
> Full method reference for `blitz-api-py`.

> [card] [TypeScript / JavaScript SDK](https://docs.blitz-api.ai/sdks/typescript.md)
>
> Full method reference for `blitz-api-js`.

> [card] [API reference](https://docs.blitz-api.ai/api-reference/people-search/find-people.md)
>
> Request/response schemas and a try-it console.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.