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

# Pagination

> How list responses are shaped and how to iterate through companies, sessions and signals without missing rows.

Every list response has the shape `{ "data": [...], "meta": {...} }`. What `meta` contains depends on whether the list is bounded or a feed.

## Bounded lists

Trackers, tags, segments, personas, analytics buckets, pages, contacts and opportunities return everything that matches up to the endpoint's `limit`, with `meta.returned`:

```json theme={null}
{ "data": [ ... ], "meta": { "returned": 9 } }
```

## Companies

`/companies` pages with `limit` (default 50, maximum 500) and `offset` (maximum 50,000). `meta.has_more` tells you whether another page exists; `meta.total` is filled only when you pass `include_total=true`, because counting roughly doubles the cost.

```python Python theme={null}
import requests

def fetch_companies(tracker_code: str, headers: dict, **params) -> list:
    url = f"https://data.leadinfo.com/v1/trackers/{tracker_code}/companies"
    rows, offset, limit = [], 0, 500
    while True:
        page = requests.get(url, headers=headers, params={**params, "limit": limit, "offset": offset}).json()
        rows.extend(page["data"])
        if not page["meta"]["has_more"]:
            return rows
        offset += limit
```

The same `meta` shape applies to `POST /companies` and to `/opportunities`.

## Feeds

Sessions, identified visitors, form submissions and Leadbot submissions are append-only feeds. They return `meta.total` (with `include_total=true`), `meta.has_more` and `meta.returned`, but no `offset`: rows are ordered by time, so narrow the date window instead of paging when `has_more` is `true`.

```python Python theme={null}
from datetime import date, timedelta

def fetch_sessions(tracker_code: str, headers: dict, start: date, end: date) -> list:
    url = f"https://data.leadinfo.com/v1/trackers/{tracker_code}/sessions"
    rows, day = [], start
    while day <= end:
        page = requests.get(url, headers=headers, params={"start_date": day, "end_date": day, "limit": 1000}).json()
        rows.extend(page["data"])
        day += timedelta(days=1)
    return rows
```

> [!TIP]
>
> Company-level questions are almost always cheaper through `/companies` than by aggregating raw sessions yourself: the row already carries sessions, pages, duration, first and last seen and the scores.


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