Pagination
List endpoints return paginated results using offset-based pagination. You control the page size with limit and skip results with offset.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | integer | 20 | Number of items to return. Minimum 1, maximum 100. |
offset | integer | 0 | Number of items to skip before returning results. |
Example Request
Fetch the second page of 10 posts:
curl "https://app.posteverywhere.ai/api/v1/posts?limit=10&offset=10" \
-H "Authorization: Bearer pe_live_abc123..."
Response Format
Paginated endpoints include a pagination object alongside the results:
{
"data": {
"posts": [
{ "id": 1, "content": "..." },
{ "id": 2, "content": "..." }
],
"pagination": {
"limit": 10,
"offset": 10
}
},
"error": null,
"meta": {
"requestId": "req_abc123",
"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. |
Iterating Through All Results
To fetch all results, increment offset by limit on each request until the response returns fewer items than the requested limit:
import { PostEverywhere } from 'posteverywhere';
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.data.posts;
allPosts.push(...posts);
// If fewer results than the limit, we've reached the last page
if (posts.length < limit) {
break;
}
offset += limit;
}
return allPosts;
}
Paginated Endpoints
The following list endpoints support limit and offset parameters:
- List Posts -- filter by status and platform
- List Media -- filter by media type