# Walking Through Results

> Archie's list endpoints return one page at a time. Ask for a window with limit and offset; each response gives the total and whether more is waiting.

Archie's list endpoints return one page at a time. You ask for a window with limit and offset.

Each response tells you how many rows exist in total and whether another page is waiting.

The request

## Ask for a Window

A list call takes two query parameters. To read the next page, add the limit to the offset and call again.

limit

integer, max 100

How many rows you want. Most lists default to 20; clients.list defaults to 50.

offset

integer

How many rows to skip. Defaults to 0.

The response

## The Pagination Object

A REST list route, such as GET https://uk.heyarchie.com/api/v1/workstreams/workplans, carries a pagination object alongside the rows. A skill that lists, such as clients.list, puts total_count and has_more in its output instead. Read has_more to decide whether to keep going; there is no need to do the arithmetic against total yourself.

total

integer

How many rows match in full, across every page.

limit

integer

The page size you asked for, echoed back.

offset

integer

How many rows were skipped to reach this page.

has_more

boolean

True when another page exists past this one.

Example

## A List Response

On a REST list route the rows sit in items, and the pagination object sits beside them.

json

```
{
  "items": [ /* up to "limit" rows */ ],
  "pagination": {
    "total": 137,
    "limit": 20,
    "offset": 0,
    "has_more": true
  }
}
```

Read the lot

## Reading Every Page

Loop until has_more is false, moving the offset on by the limit each time.

python

```
def fetch_all_clients(client, page_size=50):
    rows, offset = [], 0
    while True:
        reply = client.skills.invoke("clients.list", limit=page_size, offset=offset)
        out = reply["output"]
        rows.extend(out["clients"])
        if not out["has_more"]:
            return rows
        offset += page_size
```

Hold the limit steady

Keep the same limit for a whole run. The offset counts rows rather than pointing at a particular one, so changing the page size partway through can skip or repeat a row near the boundary.

Next

### WorkStreams

Templates, workplans, cycles and tasks all page this way.

### Rate Limits

Stay inside the per-minute budget while you page.

On this page

[Ask for a Window](https://heyarchie.com/en-gb/developers/pagination/#s-the-request)[The Pagination Object](https://heyarchie.com/en-gb/developers/pagination/#s-the-response)[A List Response](https://heyarchie.com/en-gb/developers/pagination/#s-example)[Reading Every Page](https://heyarchie.com/en-gb/developers/pagination/#s-read-the-lot)
