# Douyin Posts by user API (douyin.user_posts)

- Canonical page: https://everyinfra.com/en/douyin-api/user_posts
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "douyin", "action": "user_posts", "params": {...}}
- Price: $0.000556 per call ($0.56 per 1,000 requests); failed calls and empty results are not charged
- Returns: list, default 20, max 100 per call
- Pagination: pass next_page_token back as page_token for the next page, other params unchanged; one call per page, tokens last 24 hours
- Mode: sync; add "mode": "async" for slow tasks

Douyin Posts by user lists the videos one account has published, given its `user_id`. Each row carries the caption, hashtags, length, engagement counts and publish time. Use it to see what an account has been posting and which videos perform, when you evaluate creators, watch competitor accounts or study a posting pattern.

`user_id` is the account's secUid, which usually starts with MS4w; take it from `author_id` in search results or from the profile link. Nicknames and short numeric Douyin IDs do not work. A call without `page_token` returns the latest batch and accepts `since`; to walk the whole video list, start with an empty `page_token` and pass each `next_page_token` back. Ignore `view_count` when comparing videos, since Douyin does not publish play counts.

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=douyin&action=user_posts

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| user_id | not declared | yes | not declared | The Douyin user's `secUid` string (typically starting with `MS4w`), not a nickname or short numerical Douyin ID. Used to identify accounts for `profile` and `user_posts` actions; can be obtained from an `author_id` field in search results or a user profile URL. |
| page_token | not declared | no | not declared | Page token for `user_posts`: send an empty string `page_token=""` to start from the newest page, then pass back each response's `next_page_token` exactly as received, keeping the other parameters unchanged. Tokens last 24 hours and only work for the same account and parameters; the last page has no `next_page_token`. Pages hold up to 100 rows, newest first, and skip the `since` lower bound; filter by `posted_at` on your side if you need a date window. Each page is one call. |
| since | not declared | no | not declared | Sets a lower bound for video publish dates in `profile` and `user_posts` actions using the `YYYY-MM-DD` format. Filters videos retrieved for the request rather than account creation date. Omitting this parameter removes the date filter. |
| limit | integer (1–100) | no | 20 | The most rows to return in this call, an integer from 1 to 100. The default applies when you leave it out, and a call can return fewer rows. Larger values return 422 before any charge. |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| next_page_token | Page token (search / user_posts / comments / comment_replies / billboard_video_hot / billboard_low_fan_explosion / billboard_high_completion / billboard_account_search / music_search): pass it back unchanged as page_token to fetch the next page, keeping the other parameters the same; valid for 24 hours. Every row of a page carries the same value, which also appears at the top level of the response. Absent on the last page. Comment pages walk all top-level comments page by page. |
| id | The record's unique ID on the platform. Unique only within one platform; IDs can repeat across platforms. |
| url | Link to the record on the platform. |
| text | Body text with HTML removed, returned in full and never cut short (on a few platforms the list results themselves carry only an excerpt; the platform's field notes say so). |
| media_type | Media type: video, or image for image posts. |
| video_url | Video playback URL (signed, expires; download promptly if you need to keep it). Null for image posts or when the source omits it. |
| like_count | Likes. null means the platform or this capability does not disclose it; it is not 0. |
| comment_count | Comments. null means not disclosed, not 0. |
| share_count | Shares. null means not disclosed, not 0. |
| collect_count | Saves or favorites. null means not disclosed, not 0. |
| view_count | This is not a real play count. Douyin does not publish video play counts; most results omit this field and some show 0, and neither reflects real plays. Judge reach by like_count, comment_count, share_count and collect_count. |
| author_name | Author's display name. |
| author_id | Author's unique ID on the platform. |
| author_douyin_id | The author's Douyin ID. |
| author_uid | Numeric user ID of the author (on comments, of the commenter). author_id is the secUid; both identify the same person. |
| author_bio | The author's profile bio (search / user_posts / video rows). |
| author_avatar_url | Author avatar image URL: the creator on search, user_posts and video rows, the commenter on comments rows. |
| author_follower_count | Author's follower count. null means not disclosed. |
| cover_image_url | Video or image-post cover thumbnail URL (search / user_posts rows). |
| video_width | Video frame width in pixels. |
| video_height | Video frame height in pixels. |
| duration_seconds | Duration in seconds. null for content that is not video or audio. |
| region | Region. |
| hashtags | Hashtags in the text, in order of appearance; absent when there are none. |
| posted_at | Publish time in ISO 8601, UTC (for example 2026-08-07T12:34:56+00:00). Non-standard strings from the platform are passed through as is, so parse defensively. null means the platform does not disclose it. |
| platform | Source platform identifier, the same as platform in the request (for example xiaohongshu, tiktok). |
| image_urls | Array of image links in the platform's display order; absent when there are no images. |
| duration_sec | Video length in seconds. |
| hashtag_ids | platform-native meaning |
| search_rank | platform-native meaning |
| author_is_verified | Whether the author is verified (search / user_posts / video rows). |
| author_following_count | How many accounts the author follows (search / user_posts / video rows). |
| author_like_count | Total likes the author's profile has received (search / user_posts / video / transcript). |
| author_video_count | Total number of posts on the author's profile (search / user_posts / video rows). |
| author_ip_location | The author's IP location, which Douyin displays on every profile. |
| title | Title. null when the platform has no titles (for example text-only posts). |
| music | Background track: id, title, author, is_original (original sound or not), duration_sec, cover_url and play_url (audio link, may expire). Absent when there is no music information. |
| download_count | How many times the post was downloaded. |
| forward_count | How many times the post was forwarded. |
| is_pinned | Whether the item is pinned (post rows: pinned on the author's profile; trending: pinned on the board). |
| is_ad | Whether the post is an ad. |
| video_tags | Content category tags Douyin assigned to the post (for example food or store visit). |
| video_resolution | Video quality tier as Douyin labels it (for example 720p). |
| animated_cover_url | Animated cover link. |
| city | City name in the platform's language, not normalized. |
| city_code | platform-native meaning |
| location | Location description passed through as is; the format varies by platform. |
| text_language | platform-native meaning |
| video_bitrates | platform-native meaning |
| download_url | platform-native meaning |
| has_watermark | platform-native meaning |
| video_url_expires_at | platform-native meaning |
| permissions | platform-native meaning |
| author_gender | platform-native meaning |
| author_age | platform-native meaning |

## Example

```bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "douyin",
  "action": "user_posts",
  "params": {
    "user_id": "https://www.douyin.com/user/MS4wLjABAAAAk1tZ-L085zZf2yW_H5dnVFZWyk8Rt8v4RAvf9KhTyPoVdMDxTs7Q_rvgTJGWXezS"
  }
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "douyin",
        "action": "user_posts",
        "params": {
            "user_id": "https://www.douyin.com/user/MS4wLjABAAAAk1tZ-L085zZf2yW_H5dnVFZWyk8Rt8v4RAvf9KhTyPoVdMDxTs7Q_rvgTJGWXezS",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-09-26T08:56:04Z. `results` and `count` are real with personal information (names, handles, avatars, profile links, contact details) removed; the list keeps the first 2 of 20. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "douyin",
  "action": "user_posts",
  "results": [
    {
      "id": "•••",
      "url": "https://www.douyin.com/video/7534316807973260587",
      "text": "10个实用技巧，告别说英语时忘词！ #英语学习视频 #英语学习分享 #英语听力磨耳朵 #零基础学英语口语",
      "media_type": "video",
      "like_count": 7310,
      "comment_count": 80,
      "share_count": 1378,
      "collect_count": 6115,
      "view_count": 0,
      "author_name": "•••",
      "author_id": "MS4wLjABAAAAk1tZ-L085zZf2yW_H5dnVFZWyk8Rt8v4RAvf9KhTyPoVdMDxTs7Q_rvgTJGWXezS",
      "author_douyin_id": "•••",
      "author_follower_count": 48341,
      "region": "河北",
      "posted_at": "2025-08-04T00:10:00+00:00",
      "platform": "douyin",
      "duration_sec": 244,
      "hashtags": [
        "英语学习视频",
        "英语学习分享",
        "英语听力磨耳朵"
      ]
    },
    {
      "id": "•••",
      "url": "https://www.douyin.com/video/7524662531407793447",
      "text": "英语磨耳朵：春节中国最重要的传统节日 #英语学习视频 #英语听力训练 #四六级翻译 #英语短文",
      "media_type": "video",
      "like_count": 602,
      "comment_count": 19,
      "share_count": 206,
      "collect_count": 474,
      "view_count": 0,
      "author_name": "•••",
      "author_id": "MS4wLjABAAAAk1tZ-L085zZf2yW_H5dnVFZWyk8Rt8v4RAvf9KhTyPoVdMDxTs7Q_rvgTJGWXezS",
      "author_douyin_id": "•••",
      "author_follower_count": 48341,
      "region": "河北",
      "posted_at": "2025-07-09T00:12:00+00:00",
      "platform": "douyin",
      "duration_sec": 40,
      "hashtags": [
        "英语学习视频",
        "英语听力训练",
        "四六级翻译"
      ]
    }
  ],
  "next_page_token": …,
  "pagination": { … },
  "count": 20,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### Where do I find the secUid?

Open the account's Douyin profile: the long string after /user/ that starts with MS4w is the secUid. `author_id` in search and video results is the same value, so you can pass it straight to `user_id`. Nicknames and short numeric Douyin IDs do not identify an account.

### How do I page through every video of an account?

Send `page_token` as an empty string for the first page, then pass each response's `next_page_token` back unchanged with the other parameters the same. Pages hold up to 100 videos, newest first, and the last page has no `next_page_token`. Tokens last 24 hours, and paging ignores `since`, so filter by `posted_at` yourself if you need a date window.

### How do I fetch only new videos?

On a call without `page_token`, pass `since` as a YYYY-MM-DD date to get videos published on or after that day. On a schedule, use the latest publish date from your previous run as the next `since` to sync incrementally.

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=douyin
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
