# TikTok 图文图片 API (tiktok.photos)

- Canonical page: [https://everyinfra.com/tiktok-api/photos](https://everyinfra.com/tiktok-api/photos?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "tiktok", "action": "photos", "params": {...}}
- Price: $0.000556 per call ($0.56 per 1,000 requests); failed calls and empty results are not charged
- Returns: single object
- Mode: sync; add "mode": "async" for slow tasks

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| url | not declared | yes | not declared | 要取图片的 TikTok 图文作品：带作品编号的链接（https://www.tiktok.com/@用户/photo/<数字>，/video/<数字> 的写法也认），或 15–21 位纯数字作品编号；vm.tiktok.com 这类短链认不出，先在浏览器打开换成完整链接。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| url | 该记录在原平台上的可访问链接。 |
| images | 图文作品里的每张图（photos），按作品里的顺序：[{url, width, height}]，width、height 是像素；图片地址有过期时间，要存的话尽快下载。 |
| image_urls | 图文（轮播）作品的每张图片地址（video_download、photos；photos 里和 images 是同一批图，按作品里的顺序）；商品的全部主图地址（shop_search、shop_category_products、shop_products），shop_search 里第一张同 cover_url。 |
| posted_at | 发布时间，ISO 8601 格式、UTC 时区（如 2026-08-07T12:34:56+00:00）。平台只给非标准字符串时原样透传，解析前建议做容错。null 表示平台未公开。 |
| text | 正文内容，已去除 HTML 标签，全文返回、不截断（个别平台的列表结果本身只有摘要，以该平台的字段说明为准）。 |
| language | 内容语言代码（如 zh、en），由平台判定，可能不准。 |
| location | 地理位置描述，原文透传，格式随平台而异。 |
| media_type | 作品类型（photos）：恒为 photo。 |
| author_username | 作者用户名（@handle），通常可用于拼 URL。 |
| author_name | 评价人名字（shop_product_reviews），平台已打码，如 n**h；photos 里是作品作者的昵称。 |
| author_bio | 作者主页简介；部分请求不返回，user_videos 的结果可能没有。 |
| music_title | 配乐的曲名（photos）。 |
| music_author | 配乐的作者名（photos）。 |
| author_id | 作者在原平台的唯一 ID。 |
| author_sec_uid | 账号的 secUid：在 live_room 里是主播账号的 secUid，以 MS4w 开头；在 photos 里是作品作者账号的 secUid；在 music_detail 里是音乐作者账号的 secUid，原声才有。 |
| music_id | 配乐的音乐 ID（photos）。 |
| author_url | 作者在原平台的主页链接。 |
| author_avatar_url | 作者头像图片链接（多数平台带签名、会过期）。 |
| cover_url | 作品封面图地址（photos）。 |
| music_url | 配乐的地址（photos）。 |
| music_cover_url | 配乐的封面图地址（photos）。 |
| image_count | 这条图文作品的图片张数（photos），即 images 的条数。 |
| view_count | 浏览/播放数。null 表示不公开，不等于 0。 |
| like_count | 点赞数。null 表示该平台或该接口不公开此数据，不等于 0。 |
| comment_count | 评论数。null 表示不公开，不等于 0。 |
| share_count | 分享/转发数。null 表示不公开，不等于 0。 |
| bookmark_count | 收藏数（photos）。 |
| repost_count | 转发数。 |
| author_follower_count | 作者粉丝数。null 表示不公开。 |
| author_following_count | 作者关注的账号数；部分请求不返回。 |
| author_like_count | 作者主页获赞总数；部分请求不返回。 |
| author_video_count | 作者发布的视频总数；部分请求不返回。 |
| duration_sec | 时长，单位秒，与 duration_seconds 同值（两个名字都返回）：视频行是视频时长，music_search、music_chart、music_detail 是声音的时长。 |
| duration_seconds | 时长，单位秒。非视频/音频内容为 null。 |
| music_duration_sec | 配乐的时长，单位秒（photos）。 |
| category_type | 作品的分类类型（photos）。 |
| author_is_verified | 作者是否有认证标；部分请求不返回。 |
| author_is_private | 作者是否私密账号。 |
| author_is_seller | 作者是否 TikTok Shop 卖家；user_videos 的结果通常没有。 |
| music_is_original | 配乐是否为原声（创作者自己的声音）（photos）。 |
| share_enabled | 作品是否允许分享（photos）。 |
| view_count_estimated | 播放数是不是约数（photos）：计数 1 万以上时是 TikTok 页面上那种约数（35.2K 记为 35200），此时为 true。 |
| like_count_estimated | 点赞数是不是约数（photos），规则同 view_count_estimated。 |
| comment_count_estimated | 评论数是不是约数（photos），规则同 view_count_estimated。 |
| share_count_estimated | 分享数是不是约数（photos），规则同 view_count_estimated。 |
| author_follower_count_estimated | 作者粉丝数是不是约数（photos），规则同 view_count_estimated。 |
| author_following_count_estimated | 作者关注数是不是约数（photos），规则同 view_count_estimated。 |
| author_like_count_estimated | 作者获赞总数是不是约数（photos），规则同 view_count_estimated。 |
| author_video_count_estimated | 作者视频总数是不是约数（photos），规则同 view_count_estimated。 |
| is_ad | 是否广告视频；search 的结果通常没有，user_videos 的结果可能没有。 |
| is_private | 是否私密账号。 |
| is_aigc | 作品是否为 AI 生成内容（photos）。 |
| comments_disabled | 作品是否关闭了评论（photos）。 |
| duet_enabled | 作品是否允许合拍（photos）。 |
| stitch_enabled | 作品是否允许拼接（photos）。 |
| hashtags | 正文里的话题标签数组，按出现顺序；没有时不出现这个字段。 |
| mentions | 作品里 @ 提到的账号（photos）。 |
| suggested_words | 这条作品上的推荐词（photos）。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |

## 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": "tiktok",
  "action": "photos",
  "params": {
    "url": "https://www.tiktok.com/@tiktok/photo/7701866987609197837"
  }
}'
```

```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": "tiktok",
        "action": "photos",
        "params": {
            "url": "https://www.tiktok.com/@tiktok/photo/7701866987609197837",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

No real sample for these example parameters yet: structure only, every value is a placeholder (…).

```text
{
  "id": "req_…",
  "platform": "tiktok",
  "action": "photos",
  "results": {
    "id": …,
    "url": …,
    "images": …,
    "image_urls": …,
    "posted_at": …,
    "text": …,
    "language": …,
    "location": …,
    "media_type": …,
    "author_username": …,
    "author_name": …,
    "author_bio": …,
    "music_title": …,
    "music_author": …,
    "author_id": …,
    "author_sec_uid": …,
    "music_id": …,
    "author_url": …,
    "author_avatar_url": …,
    "cover_url": …,
    "music_url": …,
    "music_cover_url": …,
    "image_count": …,
    "view_count": …,
    "like_count": …,
    "comment_count": …,
    "share_count": …,
    "bookmark_count": …,
    "repost_count": …,
    "author_follower_count": …,
    "author_following_count": …,
    "author_like_count": …,
    "author_video_count": …,
    "duration_sec": …,
    "duration_seconds": …,
    "music_duration_sec": …,
    "category_type": …,
    "author_is_verified": …,
    "author_is_private": …,
    "author_is_seller": …,
    "music_is_original": …,
    "share_enabled": …,
    "view_count_estimated": …,
    "like_count_estimated": …,
    "comment_count_estimated": …,
    "share_count_estimated": …,
    "author_follower_count_estimated": …,
    "author_following_count_estimated": …,
    "author_like_count_estimated": …,
    "author_video_count_estimated": …,
    "is_ad": …,
    "is_private": …,
    "is_aigc": …,
    "comments_disabled": …,
    "duet_enabled": …,
    "stitch_enabled": …,
    "hashtags": …,
    "mentions": …,
    "suggested_words": …,
    "platform": …
  },
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## Also

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