> For the complete Lynkow documentation index in agent-friendly format, see [llms.txt](/llms.txt).

# Pagination

**Published**: 2026-11-30
**Category**: Getting Started

> Lists on both APIs are paginated the same way: `page` and `limit` in the query, `data` and `meta` in the response. Search is the one exception. Previous: [Errors](/sdk/getting-started/api-errors) | Next: [Rate Limits](/sdk/getting-started/rate-limits)

> **Reference** - This guide is a tutorial. For exhaustive, always-current signatures and field lists, see the auto-generated reference:
> 
> - SDK: [`ContentsService`](/sdk/services/sdk-contents-service), [`SearchService`](/sdk/services/sdk-search-service)
> - API: [Storefront: Content](/storefront-api/storefront-content)

## Prerequisites

- A first request done ([Quick Start](/sdk/getting-started/quick-start))

## Query parameters

```bash
curl "https://api.lynkow.com/storefront/a779c43c-430e-45d1-8749-2144d7f60a0f/contents?page=2&limit=10&locale=en"
```

| Parameter | Default | Maximum |
| --- | --- | --- |
| `page` | `1` |  |
| `limit` | `20` | `100` |


Pages count from 1. A page past the last one returns an empty `data` array. Keep `limit` at 100 or below: depending on the list, a larger value returns 422 or is lowered to the maximum.

Two Storefront routes built to fetch a whole catalog in one call default to 500 items and accept up to 500: a category with its posts (`/categories/{slug}`, `categories.getBySlug()` in the SDK) and path resolution (`/resolve`).

The Admin API (`/v1`) uses the same parameters, defaults and maximum.

## The `meta` object

```json
{
  "data": [ ... ],
  "meta": {
    "total": 42,
    "perPage": 10,
    "currentPage": 2,
    "lastPage": 5,
    "firstPage": 1,
    "firstPageUrl": "/?page=1",
    "lastPageUrl": "/?page=5",
    "nextPageUrl": "/?page=3",
    "previousPageUrl": "/?page=1"
  }
}
```

- `total`: items matching the query, across all pages.
- `perPage`: the page size applied.
- `currentPage` and `lastPage`: where you are, and the last page number. `lastPage` is `1` when nothing matches.
- `firstPage`: always `1`.
- The `...Url` fields hold a query string only, without the endpoint path or your other parameters. `nextPageUrl` is `null` on the last page. Build the next request from `currentPage` instead.

There is another page while `currentPage < lastPage`.

## With the SDK

List methods take `page` and `limit` and return `{ data, meta }`:

```typescript
import { lynkow } from '@/lib/lynkow'

const { data, meta } = await lynkow.contents.list({ page: 2, limit: 10 })
const hasNext = meta.currentPage < meta.lastPage
```

To read a whole list, loop until the last page:

```typescript
import type { ContentSummary } from 'lynkow'
import { lynkow } from '@/lib/lynkow'

export async function allPosts(): Promise<ContentSummary[]> {
  const posts: ContentSummary[] = []
  let page = 1
  let lastPage = 1
  do {
    const { data, meta } = await lynkow.contents.list({ page, limit: 100 })
    posts.push(...data)
    lastPage = meta.lastPage
    page++
  } while (page <= lastPage)
  return posts
}
```

The SDK's `PaginationMeta` type also declares `hasMorePages` and `hasPreviousPages`. The API never sends them, so they are always `undefined`: compare `currentPage` with `lastPage` and with `1`.

## Search results

Search endpoints (`/search` and `/search/{profileSlug}`, `search.search()` in the SDK) return a different `meta`:

```json
{
  "data": [ ... ],
  "meta": {
    "total": 37,
    "page": 1,
    "totalPages": 4,
    "perPage": 10,
    "query": "pricing",
    "processingTimeMs": 3,
    "profile": "default"
  }
}
```

- `page` and `totalPages` replace `currentPage` and `lastPage`. `totalPages` is `0` when nothing matches.
- `total` is an estimate.
- The default and maximum `limit` come from the search profile's settings.

```typescript
const results = await lynkow.search.search('pricing', { page: 1, limit: 10 })
const hasNext = results.meta.page < results.meta.totalPages
```

[Instant Search](/sdk/features/search) builds a search page on top of it.

## Reference

- SDK: [`ContentsService`](/sdk/services/sdk-contents-service), [`SearchService`](/sdk/services/sdk-search-service), [SDK Types](/sdk/types)
- API: [Storefront: Content](/storefront-api/storefront-content), [Storefront: Search](/storefront-api/storefront-search)

## Next Steps

- [Rate Limits](/sdk/getting-started/rate-limits) - the limits a long loop can reach, and how to retry
- [Build a Blog with Next.js](/sdk/getting-started/blog-nextjs) - a paginated blog list
- [Instant Search](/sdk/features/search) - search with pages and filters