Skip to Content
Pagination

Pagination

When you query creators, items, or engagement history, the API doesn’t return everything at once. Instead, it delivers results in pages — like flipping through pages of a book.

This is called cursor-based pagination. Here’s how it works in plain terms:


How it works

Think of it like scrolling through a social media feed:

  1. You ask for the first batch — “Give me the first 20 items”
  2. The API gives you 20 items + a bookmark — the bookmark tells the API where you stopped
  3. You ask for the next batch using the bookmark — “Give me the next 20 items, starting from where I left off”
  4. Repeat until there are no more results

The “bookmark” is what the API calls a cursor (the endCursor value). It’s a long encoded string like eyJpZCI6Ii4uLiJ9 — you don’t need to understand what’s inside it, just pass it back to the API.


Step by step

Step 1: Make your first request

Ask for the first page of results. Always include pageInfo so you know if there are more pages:

query FirstPage { items(first: 20) { totalCount nodes { id caption type } pageInfo { hasNextPage endCursor } } }

Step 2: Check the response

Look at pageInfo in the response:

{ "data": { "items": { "totalCount": 350, "nodes": [ { "id": "abc-123", "caption": "First post...", "type": "REEL" }, { "id": "def-456", "caption": "Second post...", "type": "POST" } ], "pageInfo": { "hasNextPage": true, "endCursor": "eyJpZCI6Ii4uLiJ9" } } } }
  • totalCount: 350 — there are 350 items total
  • hasNextPage: true — there are more results after this page
  • endCursor: "eyJpZCI6Ii4uLiJ9" — this is your bookmark for the next page

Step 3: Get the next page

Pass the endCursor value as the after parameter:

query NextPage { items(first: 20, after: "eyJpZCI6Ii4uLiJ9") { nodes { id caption type } pageInfo { hasNextPage endCursor } } }

Step 4: Repeat until done

Keep repeating Step 3 with the new endCursor from each response. When hasNextPage is false, you’ve reached the last page.


Quick reference

FieldWhat it means
firstHow many results per page (max 100)
afterThe cursor (bookmark) from the previous page
totalCountTotal number of results across all pages — use this for displaying “X of Y” (e.g. “Showing 20 of 1,284”)
hasNextPagetrue = more pages available, false = this is the last page — use this to control your pagination loop
endCursorThe bookmark to pass as after in your next request
hasPreviousPagetrue = there are pages before this one
startCursorBookmark for the first item on this page

Which queries use pagination?

QueryPaginated?
itemsYes
creatorsYes
engagementHistoryYes
workspacesYes
filterPresetsNo — returns all at once
mediaContentsNo — returns all for the given item IDs
transcriptionsNo — returns all for the given item IDs

Tips

  • Max page size is 100. Setting first higher than 100 will return an error.
  • You don’t need to paginate manually with AI. Just tell Claude to “get all results” and it will handle the pagination loop for you.
  • Cursors are temporary. Don’t store them for long-term use — they may expire. Always start fresh from the first page.

Using with AI:

“Get all my creators, not just the first 20” “Fetch every item in my workspace across all pages” “Keep going until there are no more pages”

Last updated on