# Pagination

> For the complete documentation index, see [llms.txt](https://www.shortsintel.com/llms.txt). Every docs page is also available as markdown: add .md to its URL. To connect, read [agents.md](https://www.shortsintel.com/agents.md).

> How lists page with items and a cursor, and how to read every page without paying twice.

- Shape: Each page is an `items` array and a `next_cursor`.
- Last page: `next_cursor` is `null`. There is no page number or total.
- Page size: `limit` is 25 by default and 100 at most on lists over stored results. Paid lists set their own ceiling.
- Price: Lists over stored results are free. A hashtag's videos cost 3 credits per page, a sound's 6 credits per page.

Lists in this API page with an `items` array and a `next_cursor`. Pass the cursor back to get the next page. When it comes back `null`, you have every page. There is no page number, no total count and no offset.

## A page is items and a cursor

200 · `{ items, next_cursor }`. With `intelligence=true`, the Run envelope `{ run, result }` instead, `result` being the page with `intelligence` on each analysed video (or `{ estimate_credits,... }` with `estimate=true`).

```json
{
  "items": [
    {
      "platform": "tiktok",
      "id": "7300000000000000000",
      "url": "https://www.tiktok.com/@someone/video/7300000000000000000",
      "description": "3 minutes at 4°C every morning for 30 days. Here is what actually changed. #coldplunge #recovery",
      "posted_at": "2026-09-05T06:32:11.000Z",
      "duration_seconds": 41,
      "thumbnail_url": "https://p16-sign.tiktokcdn.com/obj/tos-cover-7300000000000000000.jpeg",
      "hashtags": [
        "coldplunge",
        "recovery",
        "morningroutine"
      ],
      "sound": {
        "id": "7180000000000000000",
        "title": "original sound - someone",
        "author": "someone",
        "is_original": true,
        "commercial_use": null
      },
      "sound_mix": {
        "sound_volume": 0,
        "original_volume": 50,
        "mix": "voiceover"
      },
      "creator": {
        "id": "cre_9d4b2a7f1c",
        "handle": "someone",
        "name": "Someone",
        "follower_count": 184300,
        "avatar_url": "https://p16-sign.tiktokcdn.com/obj/tos-avatar-someone.jpeg",
        "verified": false
      },
      "region": "US",
      "language": "en",
      "title": null,
      "commerce": {
        "is_ad": false,
        "paid_partnership": null,
        "affiliate": null,
        "shop_url": null,
        "anchors": [
          {
            "kind": "54",
            "label": "CapCut · Editing made easy"
          }
        ],
        "products": [],
        "seller_ids": null,
        "sales_event": null
      },
      "people": {
        "mentions": [
          "coldplungeco"
        ],
        "collaborators": []
      },
      "location": null,
      "topics": {
        "keywords": [],
        "genre": null,
        "labels": [
          "Fitness",
          "Health"
        ]
      },
      "suggested_searches": [
        "cold plunge benefits",
        "cold plunge"
      ],
      "on_screen_text": [
        {
          "text": "3 minutes at 4°C",
          "start_ms": 0,
          "end_ms": 2500
        }
      ],
      "chapters": null,
      "ai_generated": false,
      "is_pinned": null,
      "format": "short",
      "slides": null,
      "reactions": null,
      "most_replayed": null,
      "audio_languages": null,
      "is_sponsored": null,
      "sponsor": null,
      "snapshot": {
        "at": "2026-09-08T09:14:04.219Z",
        "views": 1284000,
        "likes": 143200,
        "comments": 2810,
        "shares": 9040,
        "saves": 21600
      },
      "engagement": {
        "at": "2026-09-08T09:14:04.219Z",
        "views": 1284000,
        "likes": 143200,
        "comments": 2810,
        "shares": 9040,
        "saves": 21600
      },
      "scores": {
        "outlier": 4.21,
        "outlier_p90": 1.6,
        "percentile": 95,
        "velocity": {
          "views_per_hour": 6698.6,
          "window": "snapshot",
          "since": "2026-10-03T08:00:00.000Z"
        },
        "engagement_rate": 0.1376,
        "anomaly": false,
        "reason": null,
        "baseline": {
          "median_views": 305000,
          "p90_views": 802000,
          "engagement_rate": 0.1342,
          "posts_per_week": 4.1,
          "sample": 20,
          "confidence": "high",
          "source": "videos",
          "computed_at": "2026-09-08T09:14:03.902Z",
          "stale": false
        }
      }
    },
    {
      "platform": "tiktok",
      "id": "7300000000000000042",
      "url": "https://www.tiktok.com/@anotherone/video/7300000000000000042",
      "description": "I tried cold plunging before every workout for a week. #coldplunge",
      "posted_at": "2026-09-06T13:04:52.000Z",
      "duration_seconds": 28,
      "thumbnail_url": "https://p16-sign.tiktokcdn.com/obj/tos-cover-7300000000000000042.jpeg",
      "hashtags": [
        "coldplunge",
        "gym"
      ],
      "sound": {
        "id": "7180000000000000099",
        "title": "Winter Air",
        "author": "Northbound",
        "is_original": false,
        "commercial_use": true
      },
      "sound_mix": {
        "sound_volume": 50,
        "original_volume": 0,
        "mix": "music_only"
      },
      "creator": {
        "id": "cre_1a77c0b3de",
        "handle": "anotherone",
        "name": "Another One",
        "follower_count": 21400,
        "avatar_url": null,
        "verified": null
      },
      "region": "GB",
      "language": "en",
      "title": null,
      "commerce": {
        "is_ad": false,
        "paid_partnership": null,
        "affiliate": null,
        "shop_url": null,
        "anchors": [],
        "products": [],
        "seller_ids": null,
        "sales_event": null
      },
      "people": null,
      "location": null,
      "topics": null,
      "suggested_searches": null,
      "on_screen_text": null,
      "chapters": null,
      "ai_generated": null,
      "is_pinned": null,
      "format": "short",
      "slides": null,
      "reactions": null,
      "most_replayed": null,
      "audio_languages": null,
      "is_sponsored": null,
      "sponsor": null,
      "snapshot": {
        "at": "2026-09-08T09:14:04.219Z",
        "views": 96200,
        "likes": 8140,
        "comments": 212,
        "shares": 401,
        "saves": 1180
      },
      "engagement": {
        "at": "2026-09-08T09:14:04.219Z",
        "views": 96200,
        "likes": 8140,
        "comments": 212,
        "shares": 401,
        "saves": 1180
      },
      "scores": null
    }
  ],
  "next_cursor": "eyJpZCI6ImNsdjRxOHkifQ"
}
```

`next_cursor` is a string when there is more and `null` when there is not. Do not test the length of `items` to decide whether to stop. A full page can still be the last one, and an empty page can still carry a cursor. The cursor is the only signal.

## When to walk every page

Walk a list to the end when you need all of it, such as every video a creator posted or every item of a Run. Read only the first page when the newest rows are enough.

The research list reads are the exception. They page with `limit` and `offset` and report a `total`, because a research is a fixed set. See [Research](https://www.shortsintel.com/docs/concepts/research).

## How a cursor works

A cursor is an opaque token. It is not an id, an offset or a timestamp, and what it encodes differs by operation. A simple list holds one keyset position. A cross-platform search holds one position per platform, since one page there is one request per platform.

Do not construct, decode or edit a cursor. A cursor that cannot be read is an `invalid_request` problem.

A cursor belongs to the list it came from. A cursor from `GET /v1/runs` means nothing to `GET /v1/runs/{id}/items`. Keep each cursor with the loop that produced it and discard it when the loop ends.

Keyset paging is stable under inserts. Rows added while you walk do not shift the pages you have already read, as they would with an offset. New rows at the top of a newest-first list are not in your walk. Start again from the first page to get them.

## Limits and prices

| Limit | Value |
| --- | --- |
| `limit` on lists over stored results | 25 by default, 100 at most |
| `limit` on `GET /v1/hashtags/{platform}/{tag}/videos` | 25 by default, 30 at most |
| `limit` on `GET /v1/sounds/{platform}/{id}/videos` | 25 by default, 30 at most |
| `limit` on `POST /v1/ads/search` | Meta: 50 by default, 500 at most. TikTok: 25 by default, 30 at most. Google: 40 by default, 200 at most. |
| `GET /v1/runs/{id}/items` | Free: the charge happened once, when the work did. |
| `GET /v1/runs` | Free. |
| `GET /v1/hashtags/{platform}/{tag}/videos` | 3 credits per page. |
| `GET /v1/sounds/{platform}/{id}/videos` | 6 credits per page. |

A `limit` over the ceiling is an `invalid_request` problem. The API does not clamp it to a smaller page.

Lists over stored results are free to page as often as you like. These are a Run, its items, a creator’s videos, a Tracker’s Snapshots and Change Reports, your Runs and your webhook deliveries.

Paging back through a Run you already paid for is free. The work happened once, when the Run ran, and reading its items again does not repeat it. Walk a fifty-item Run to the last page, walk it again tomorrow, and the total charge is unchanged.

`GET /v1/runs/{id}/items` · Free: the charge happened once, when the work did.

curl:

```bash
curl "https://www.shortsintel.com/v1/runs/run_8f2c1ad04b/items?limit=25&type=videos" \
  -H "Authorization: Bearer sk_live_YOUR_KEY"
```

TypeScript:

```typescript
const response = await fetch(
  "https://www.shortsintel.com/v1/runs/run_8f2c1ad04b/items?limit=25&type=videos",
  {
    method: "GET",
    headers: {
      "Authorization": "Bearer sk_live_YOUR_KEY",
    },
  },
);

if (!response.ok) {
  throw new Error(`ShortsIntel ${response.status}`);
}

const data = await response.json();
```

Python:

```python
import requests

response = requests.get(
    "https://www.shortsintel.com/v1/runs/run_8f2c1ad04b/items?limit=25&type=videos",
    headers={
        "Authorization": "Bearer sk_live_YOUR_KEY",
    },
)
response.raise_for_status()

data = response.json()
```

A hashtag’s or a sound’s videos are a fetch. Each page asks the platform for its current ordering, which stored rows cannot answer, so each page is a Run and is charged. The price line on each operation says which kind of list it is.

See [Runs](https://www.shortsintel.com/docs/concepts/runs) for why re-reads are free, and [pricing and estimates](https://www.shortsintel.com/docs/concepts/pricing-and-estimates) for pricing a paid page before you ask for it.

## Example: walk every page

Request the largest page the endpoint allows. That means fewer round trips and, on the paid lists, fewer pages to pay for.

`GET /v1/creators/{platform}/{handle}/videos` · Free. Counts toward the per-key request limit. `intelligence=true` costs 20 credits for each of the first 20 videos analysed, whether analysed now or already; the page itself stays free.

curl:

```bash
curl "https://www.shortsintel.com/v1/creators/tiktok/someone/videos?limit=100&wait=30" \
  -H "Authorization: Bearer sk_live_YOUR_KEY"
```

TypeScript:

```typescript
const response = await fetch(
  "https://www.shortsintel.com/v1/creators/tiktok/someone/videos?limit=100&wait=30",
  {
    method: "GET",
    headers: {
      "Authorization": "Bearer sk_live_YOUR_KEY",
    },
  },
);

if (!response.ok) {
  throw new Error(`ShortsIntel ${response.status}`);
}

const data = await response.json();
```

Python:

```python
import requests

response = requests.get(
    "https://www.shortsintel.com/v1/creators/tiktok/someone/videos?limit=100&wait=30",
    headers={
        "Authorization": "Bearer sk_live_YOUR_KEY",
    },
)
response.raise_for_status()

data = response.json()
```

[Run it in the Playground](https://www.shortsintel.com/console/playground?op=listCreatorVideos&platform=tiktok&handle=someone&limit=100) (no API Key needed)

The walk is a loop that passes each `next_cursor` back and stops on `null`:

```typescript
const key = process.env.SHORTSINTEL_API_KEY ?? "sk_live_YOUR_KEY";

// Pass the largest `limit` the operation allows: it differs by list.
async function* pages(url: string, limit: number) {
  let cursor: string | null = null;
  do {
    const query = new URLSearchParams({ limit: String(limit) });
    if (cursor) query.set("cursor", cursor);

    const response = await fetch(`${url}?${query}`, {
      headers: { Authorization: `Bearer ${key}` },
    });
    if (!response.ok) throw new Error(`${response.status} from ${url}`);

    const page = (await response.json()) as {
      items: unknown[];
      next_cursor: string | null;
    };
    yield page.items;
    cursor = page.next_cursor;
  } while (cursor !== null); // null means this was the last page
}
```



```python
import os

import httpx

key = os.environ.get("SHORTSINTEL_API_KEY", "sk_live_YOUR_KEY")


# Pass the largest limit the operation allows: it differs by list.
def pages(url: str, limit: int):
    cursor = None
    while True:
        params = {"limit": limit}
        if cursor:
            params["cursor"] = cursor

        response = httpx.get(url, params=params,
                             headers={"Authorization": f"Bearer {key}"})
        response.raise_for_status()

        page = response.json()
        yield page["items"]

        cursor = page["next_cursor"]
        if cursor is None:  # None means that was the last page
            return
```

## Questions about Pagination

### How do I know I have reached the last page?

`next_cursor` is `null`. Do not rely on the length of `items`.

### How many items can one page hold?

On lists over stored results, up to 100, and 25 without `limit`. Paid lists differ: a hashtag’s videos go up to 30, a sound’s to 30, Meta Ads to 500, TikTok Ads to 30 and Google Ads to 200.

### Does paging a list cost Credits?

Not for lists over stored results, such as a Run’s items. A hashtag’s videos cost 3 credits per page and a sound’s 6 credits per page.

### Can I build or reuse a cursor myself?

No. Pass back the `next_cursor` you were given, on the same list.
