# Pagination

> Lists come a page at a time. Follow next_cursor until it is null.

Web page: https://www.signalvan.com/developers/pagination

## Pages

Lead searches, leads and companies take `limit` (1 to 200, 50 by default) and `cursor`. Each page carries `next_cursor`: pass it back to get the next page; it is `null` on the last one. Lead and company pages also carry `total`. A cursor is opaque: use it as it is (a made-up cursor answers `400`).

The leads of a lead search that is still running come back empty, with the lead search's `status`: wait for it to finish first.

## Walking every page

Python:

```python
cursor = None
while True:
    page = requests.get(f"https://api.signalvan.com/v1/searches/{sid}/leads",
                        headers=H, params={"limit": 200, **({"cursor": cursor} if cursor else {})}).json()
    for lead in page["leads"]:
        handle(lead)
    cursor = page["next_cursor"]
    if not cursor:
        break
```
