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, GET /pantry and GET /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.
limitintegerHow many recipes this response holds. Capped at 100.
offsetintegerHow many were skipped.
totalintegerHow 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.
Search is different
GET /search 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. On a business plan, GET /recipes pages through the whole database with filters.