---
title: "Pagination — Tiny Plates recipe API"
description: "How to page through recipe lists with limit and offset, what the pagination object in each response holds, and where the page size caps are."
url: "https://www.tinyplates.dev/docs/pagination"
---

# Pagination

The list endpoints page with limit and offset and tell you the total, so you always know how far you have left to go.

## How it works

* `limit` — how many to return. Defaults to 20 and is capped at 100\. Asking for more gives you 100, not an error.
* `offset` — how many to skip. Defaults to 0.

These parameters apply to [GET /popular](https://www.tinyplates.dev/docs/api/popular-recipes), [GET /pantry](https://www.tinyplates.dev/docs/api/pantry-recipes) and [GET /recipes](https://www.tinyplates.dev/docs/api/list-recipes), the last of which needs a business plan.

These endpoints collapse recipes from the same publisher with matching titles, source ingredient lines, and instructions before counting or paging. Case and whitespace differences are ignored. Recipes from different publishers or with different content remain separate. The total counts these distinct results.

```
curl 'https://api.tinyplates.dev/recipes?limit=20&offset=40' \
  -H 'Authorization: Bearer rd_your_api_key'
```

## The pagination object

Every paged response carries one, alongside the rows. It reflects the page you asked for and the size of the whole filtered set.

`limit`integer

How many recipes this response holds. Capped at 100.

`offset`integer

How many were skipped.

`total`integer

How many match the filter in total.

## Walking the whole list

Stop when the offset reaches the total. Filters change the total, so read it from each response rather than assuming it.

```
const limit = 100
let offset = 0
let total = Infinity

while (offset < total) {
  const response = await fetch(
    `https://api.tinyplates.dev/recipes?limit=${limit}&offset=${offset}`,
    { headers: { Authorization: 'Bearer rd_your_api_key' } }
  )

  const page = await response.json()

  total = page.pagination.total
  offset += limit

  for (const recipe of page.recipes) {
    console.log(recipe.title)
  }
}
```

At 100 a page and 50 requests a day, an account can read 5,000 recipes in a day and 30,000 in a week. See [rate limits](https://www.tinyplates.dev/docs/rate-limits).

## Search is different

[GET /search](https://www.tinyplates.dev/docs/api/search-recipes) ranks results by relevance and returns only the best ones, so it has no `offset` and no `pagination` object. Its `limit` defaults to 10 and caps at 50\. If you need to page, narrow the query, or use [GET /popular](https://www.tinyplates.dev/docs/api/popular-recipes). On a business plan, [GET /recipes](https://www.tinyplates.dev/docs/api/list-recipes) pages through the whole database with filters.
