Guides
Pagination
Cursor pagination, in the same place on every list.
Every list response carries a pagination object. Read pagination.next_cursor and send it back as the cursor query parameter to get the next page. pagination.has_more tells you whether there is one. Leave cursor off for the first page.
pagination
"pagination": { "next_cursor": "QVFEbV9xS3Bn…", "has_more": true }
One loop works for every paginated endpoint; only the collection key changes.
paginate.mjs
const url = new URL("https://social-api.airaa.xyz/v1/instagram/user/posts"); url.searchParams.set("username", "instagram"); const posts = []; let cursor; do { if (cursor) url.searchParams.set("cursor", cursor); const res = await fetch(url, { headers: { "X-API-KEY": process.env.AIRAA_KEY }, }); const page = await res.json(); posts.push(...page.posts); cursor = page.pagination.has_more ? page.pagination.next_cursor : undefined; } while (cursor);
Instagram comments pages with cursor like the rest, and also returns pagination.total_count, the number of comments on the whole post.
X search returns next_cursor and previous_cursor and no has_more. Keep paging while next_cursor is present.
X user posts can end on an empty page (posts: [], has_more: false), and a protected account returns posts: [] on the first page.
| Endpoint | Collection | Cursor params |
|---|---|---|
User posts/v1/instagram/user/posts | posts | cursor |
User reels/v1/instagram/user/reels | reels | cursor |
Post comments/v1/instagram/posts/comments | comments | cursor |
TikTok user posts/v1/tiktok/user/posts | posts | cursor |
Facebook user posts/v1/facebook/user/posts | posts | cursor |
List X user posts/v1/twitter/user/posts | posts | cursor |
Search posts/v1/twitter/search | posts | cursor |