> ## Documentation Index
> Fetch the complete documentation index at: https://docs.postinger.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Pagination and filtering

> Read beyond the first page without losing your place.

## Posts

`GET /posts` returns `data.items` and `data.nextCursor`. The default page size is 50; `limit` accepts 1–100.

```bash theme={null}
curl --get --fail-with-body "$POSTINGER_API_URL/public/v1/posts" \
  -H "Authorization: Bearer $POSTINGER_API_KEY" \
  --data-urlencode 'limit=25' \
  --data-urlencode 'status=draft' \
  --data-urlencode 'sort=newest'
```

Pass the returned `nextCursor` as `after` on the next request. Keep all filters and the sort order unchanged. Stop when `nextCursor` is null. A final full page can be followed by an empty page.

| Parameter | Meaning |
| - | - |
| `status` | One post status, such as `draft` or `published` |
| `platform` | Posts targeting the selected platform |
| `q` | Content search, 1–200 characters |
| `sort` | `schedule_desc` (default), `schedule_asc`, `newest`, or `oldest` |
| `after` | Get the next page after this post ID |
| `before` | Get the preceding page before this post ID |

For backward navigation, send the first visible post ID as `before`. Do not send `after` and `before` together. Unscheduled posts come last with either schedule sort. Creation time and ID break ties.

CLI forward pagination uses `postinger posts list --after CURSOR --limit 25`. CLI 0.2.0 does not expose the HTTP sort/backward flags. MCP `list_posts` supports `before`, but not `sort`.

## Post analytics

`GET /analytics/posts` returns one item per **post/account pair**, with its own opaque `nextCursor`. Send it as `cursor`, not `after`. Preserve the date range, account, and platform filters. The same post may appear once for each published target.

```bash theme={null}
postinger analytics posts --days 30 --limit 25 --cursor CURSOR --json
```


## Related topics

- [Automate with the CLI](/cli/automation.md)
- [Read analytics](/guides/analytics.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.