# PostEverywhere Pagination Reference > How to paginate through PostEverywhere API results. Offset-based pagination with limit and offset parameters. **Source:** https://posteverywhere.ai/docs/pagination **Section:** Reference **API reference:** https://posteverywhere.ai/docs/api/reference --- List endpoints return paginated results using offset-based pagination. You control the page size with `limit` and skip results with `offset`. ## The `limit` and `offset` parameters | Parameter | Type | Default | Description | |-----------|------|---------|-------------| | `limit` | integer | `20` (`50` on `/v1/campaigns`) | Number of items to return. Minimum `1`, maximum `100`. | | `offset` | integer | `0` | Number of items to skip before returning results. | ## A paginated request, end to end Fetch the second page of 10 posts: ```bash curl "https://app.posteverywhere.ai/api/v1/posts?limit=10&offset=10" \ -H "Authorization: Bearer pe_live_abc123..." ``` ## What a paginated response contains Paginated endpoints include a `pagination` object alongside the results: ```json { "data": { "posts": [ { "post_id": "9f3c4d12-...", "content": "..." }, { "post_id": "a81e7b50-...", "content": "..." } ], "pagination": { "limit": 10, "offset": 10 } }, "error": null, "meta": { "request_id": "a1b2c3d4", "timestamp": "2026-03-01T12:00:00Z" } } ``` The `pagination` object contains: | Field | Type | Description | |-------|------|-------------| | `limit` | integer | The `limit` value used for this request. | | `offset` | integer | The `offset` value used for this request. | | `total` | integer | (Since 2026-06-11 on `/v1/posts` + `/v1/campaigns`) The total matching count: lets you know if there are more pages without fetching. | | `has_more` | boolean | (Since 2026-06-11 on `/v1/posts` + `/v1/campaigns`) `true` if more pages exist beyond this one. | ## Looping through every page of results The recommended pattern (using `has_more`): ```javascript import { PostEverywhere } from '@posteverywhere/sdk'; const client = new PostEverywhere({ apiKey: process.env.POSTEVERYWHERE_API_KEY }); async function fetchAllPosts() { const allPosts = []; const limit = 50; let offset = 0; while (true) { const { posts, pagination } = await client.posts.list({ limit, offset }); allPosts.push(...posts); if (!pagination.has_more) break; offset += limit; } return allPosts; } ``` The older pattern (fallback for endpoints that don't yet return `has_more`): keep iterating until the response returns fewer items than the requested `limit`: ```javascript import { PostEverywhere } from '@posteverywhere/sdk'; const client = new PostEverywhere({ apiKey: process.env.POSTEVERYWHERE_API_KEY, }); async function fetchAllPosts() { const allPosts = []; const limit = 50; let offset = 0; while (true) { const response = await client.posts.list({ limit, offset }); const posts = response.posts; // the SDK unwraps the { data } envelope for you allPosts.push(...posts); // If fewer results than the limit, we've reached the last page if (posts.length < limit) { break; } offset += limit; } return allPosts; } ``` ## Which endpoints support pagination The following list endpoints support `limit` and `offset` parameters: - **[List Posts](/docs/api/list-posts)** -- filter by status and platform - **[List Media](/docs/api/list-media)** -- filter by media type - **[List Campaigns](/docs/api/list-campaigns)** -- default `limit` is 50; returns `total` and `has_more` **Related:** [invalid parameter errors](/docs/errors) · [campaigns list pagination](/docs/campaigns) · [aggregate counts without paging](/docs/analytics-summary) · [your first API call](/docs/quick-start)