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

# Pagination

> Walk a long list page by page with a cursor

`GET /searches`, `GET /searches/{id}` and `GET /lists` return their rows a page at a time, with a `pagination` object:

```json theme={null}
{
  "searches": [ ... ],
  "pagination": {
    "page": 1,
    "per_page": 100,
    "total_count": 245,
    "has_more": true,
    "next_cursor": "WyIyMDI2LTEwLTE3VDEwOjAwOjAwLjAwMDAwMFoiLDQyXQ"
  }
}
```

## Use the cursor

Pass `next_cursor` back unchanged as `cursor` to get the next page. Stop when `has_more` is `false`; the last page has no `next_cursor`.

```bash theme={null}
curl "https://app.pipecorn.com/api/v2/searches?per_page=100&cursor=WyIyMDI2LTEwLTE3VDEwOjAwOjAwLjAwMDAwMFoiLDQyXQ" \
  -H "X-API-KEY: $PIPECORN_API_KEY"
```

A cursor points just after the last row you received, so rows added while you walk the list never make you skip or repeat one. A cursor that was edited or comes from another endpoint answers `400`.

## Parameters

| Parameter | Default | Description |
| - | - | - |
| `cursor` | | `next_cursor` of the previous page. Omit it for the first page. |
| `per_page` | `100` | Rows per page, up to `500`. |
| `page` | `1` | Page number. Still supported, but pages shift when rows are added between two calls: prefer `cursor`. |

In cursor mode, `pagination` has no `page` field.


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