# How to list every video from a Douyin account

Pass the account's sec_uid and page with `data.next`, about 20 videos a page. Five pages are 5 calls and $0.01, newest first, with likes, comments and shares for each video.

Updated 2026-11-22

## List the videos

`id` is the sec_uid: the string starting with `MS4wLjABAAAA` after `/user/` in a douyin.com profile link. From a share link, get it with `douyin.accounts.id_from_url`. The next page's cursor is a timestamp in `data.next`.

[Douyin video list API](https://xtikapi.com/apis/douyin/videos/list): `GET /v1/douyin/videos/list`, $0.002 a call

```bash
curl "https://xtikapi.com/v1/douyin/videos/list?id=MS4wLjABAAAAz1lOStxwzCZF5cJ3h8Sa2FPQ_8_l_vQdpdKEm1oEF_k" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

```python
import requests

URL = "https://xtikapi.com/v1/douyin/videos/list"
HEADERS = {"Authorization": "Bearer YOUR_API_KEY"}

params = {"id": "MS4wLjABAAAAz1lOStxwzCZF5cJ3h8Sa2FPQ_8_l_vQdpdKEm1oEF_k"}
items = []
for _ in range(5):  # one call per page
    for attempt in range(3):  # 5xx errors are not charged: retry
        response = requests.get(URL, params=params, headers=HEADERS, timeout=60)
        if response.status_code < 500:
            break
    response.raise_for_status()
    data = response.json()["data"]
    items += data["items"]
    if not data.get("next"):  # null on the last page
        break
    params.update(data["next"])

print(len(items), "items")
```

```javascript
const URL = "https://xtikapi.com/v1/douyin/videos/list";
const HEADERS = { Authorization: "Bearer YOUR_API_KEY" };

let params = {"id":"MS4wLjABAAAAz1lOStxwzCZF5cJ3h8Sa2FPQ_8_l_vQdpdKEm1oEF_k"};
const items = [];
for (let page = 0; page < 5; page++) {
  let response;
  for (let attempt = 0; attempt < 3; attempt++) {
    // 5xx errors are not charged: retry
    response = await fetch(`${URL}?${new URLSearchParams(params)}`, { headers: HEADERS });
    if (response.status < 500) break;
  }
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  const { data } = await response.json();
  items.push(...data.items);
  if (!data.next) break; // null on the last page
  params = { ...params, ...data.next };
}
console.log(items.length, "items");
```

Recorded response (lists keep the first two items):

```json
{
  "data": {
    "items": [
      {
        "id": "0604894503360517458",
        "url": "https://example.com/link",
        "text": "Example text",
        "author": {
          "id": "xx1xxxxxxxxxx5xxxxxxxxxx6xx5x4xx9xxx_0_x_xxxxxxxx7xxx_x",
          "username": "example_user",
          "name": "Example name",
          "avatar": "https://example.com/image.jpg",
          "description": "Example text"
        },
        "createdAt": "2026-04-21T10:00:00.000Z",
        "likeCount": 516408,
        "commentCount": 13743,
        "shareCount": 349221,
        "cover": "https://example.com/image.jpg"
      },
      {
        "id": "0686305644401440046",
        "url": "https://example.com/link",
        "text": "Example text",
        "author": {
          "id": "xx1xxxxxxxxxx5xxxxxxxxxx6xx5x4xx9xxx_0_x_xxxxxxxx7xxx_x",
          "username": "example_user",
          "name": "Example name",
          "avatar": "https://example.com/image.jpg",
          "description": "Example text"
        },
        "createdAt": "2026-03-01T10:00:02.000Z",
        "likeCount": 246763,
        "commentCount": 6947,
        "shareCount": 126169,
        "cover": "https://example.com/image.jpg"
      }
    ],
    "has_more": true,
    "next": {
      "cursor": 1791280800000
    }
  },
  "meta": {
    "request_id": "example",
    "endpoint": "douyin.videos.list",
    "normalized": true,
    "unavailable": [
      "viewCount"
    ],
    "billing": {
      "charged": true,
      "amount": 0.002,
      "balance": 4.98
    }
  }
}
```

## What the example costs

| Step | Calls | Price | Subtotal |
| --- | --- | --- | --- |
| Videos, 5 pages of about 20 | 5 | $0.002 | $0.01 |
| Total | 5 | | $0.01 |

## Good to know

- In our test on 2026-11-22 the first page held 23 videos and the second 20, with no overlap.
- Douyin does not publish play counts, so `viewCount` is listed in `meta.unavailable`.
- Each video's `id` is the aweme_id that `douyin.comments.list` takes.

## Endpoints

- [Douyin video list API](https://xtikapi.com/apis/douyin/videos/list): $0.002 a call

## More about Douyin

- [How to get all comments on a Douyin video](https://xtikapi.com/guides/douyin-video-comments)
- [Douyin scraper keeps getting CODE 429: what actually works?](https://xtikapi.com/answers/douyin-crawler-code-429)
- [What does "failed to get user data, get a new ttwid from the web" mean for Douyin?](https://xtikapi.com/answers/douyin-get-new-ttwid)
- [f2 Douyin download fails with Client error '403 Forbidden': how to fix it?](https://xtikapi.com/answers/f2-douyin-403-forbidden)
- [How often should a Douyin scraper change its cookie, and how fast can it request?](https://xtikapi.com/answers/douyin-cookie-rotation-frequency)
- [Douyin_TikTok_Download_API works locally but returns no video after Docker deploy: why?](https://xtikapi.com/answers/douyin-tiktok-api-docker-no-video)
- [Douyin user homepage videos API (fetch_user_post_videos) returns 400: why?](https://xtikapi.com/answers/douyin-user-videos-api-400)

## Questions

### How much does this cost with XTikAPI?

The example here is 5 calls, $0.01 in total. Failed calls and timeouts are free, and a new account with a verified email gets $0.50 of trial balance.

### Can I use the numeric Douyin ID instead of sec_uid?

The list call takes sec_uid. Convert a numeric uid with douyin.accounts.uid_to_sec_uid, or a profile link with douyin.accounts.id_from_url.

---

XTikAPI: one API key for public social media data, prepaid per call. [HTML version](https://xtikapi.com/guides/douyin-user-videos) · [llms.txt](https://xtikapi.com/llms.txt) · [OpenAPI](https://xtikapi.com/openapi.json)
