抖音用某段音乐的作品 API

按 music_id 读用了同一段抖音音乐的作品,每行带 text、like_count、comment_count、author_name 和 music_post_count,每千次 $0.79。

  • music_post_count 是抖音记的使用作品数,返回的行通常少得多
  • 一次调用返回整份列表,没有翻页
  • 失败和空结果不收费
免费开始

接口健康状态

24h 健康值
正常
  • 健康 / 正常
  • 可用
  • 少量可用
  • 基本不可用
正常

24 小时趋势

30 天趋势

  1. 1请求

    POST /api/v1/social
    {
      "platform": "douyin",
      "action": "music_posts",
      "params": {
        "music_id": "7699717253151558410"
      }
    }
  2. 2JSON 响应

    {
      "results": [
        {
          "text": string,
          "media_type": string,
          "video_url": string,
          "like_count": number
        },
        …
      ]
    }
  3. 3行

    textmedia_typevideo_urllike_count
    stringstringstringnumber
  4. 4CSV

    douyin-music_posts-sample.csv id,url,text,media_type,video_url,like_count,comment_count,share_count,collect_count,author_name,author_id,author_douyin_id,author_bio,author_avatar_url,author_follower_count,author_following_count,author_like_count,author_video_count,author_is_verified,cover_image_url,video_width,video_height,video_bitrates,has_watermark,duration_sec,duration_seconds,hashtags,posted_at,title,music,location,image_urls,is_deleted,is_private,platform,music_post_count

请求带 music_id,返回一份作品列表,results 里每行是一条作品,列成字段表,也可下载为 CSV。

能拿到什么数据

这个能力还没有公开的真实样本。下表列出每行会返回的字段、类型和含义,不放值。

字段类型含义
idstring该记录在原平台上的唯一标识。仅在同一平台内唯一,跨平台可能重复。
urlstring该记录在原平台上的可访问链接。
textstring正文内容,已去除 HTML 标签,全文返回、不截断(个别平台的列表结果本身只有摘要,以该平台的字段说明为准)。
media_typestring媒体类型。
video_urlstring视频播放地址(带签名、会过期,要留存请及时下载);图文笔记或来源没给时为 null。
like_countnumber点赞数。null 表示该平台或该接口不公开此数据,不等于 0。
comment_countnumber评论数。null 表示不公开,不等于 0。
share_countnumber分享/转发数。null 表示不公开,不等于 0。
collect_countnumber收藏数。null 表示不公开,不等于 0。
author_namestring作者昵称(显示名)。
author_idstring作者在原平台的唯一 ID。
author_douyin_idstring作者抖音号。
author_biostring作者主页简介(search / user_posts / video / posts_batch / related_posts / mix_posts / music_posts 行上)。
author_avatar_urlstring作者头像链接:search / user_posts / video / posts_batch / related_posts / mix_posts / music_posts 行上是博主的,live_room 上是主播的,comments 行上是评论者的。
author_follower_countnumber作者粉丝数。null 表示不公开。
author_following_countnumber作者关注数(search / user_posts / video / posts_batch / related_posts / mix_posts / music_posts 行上)。
author_like_countnumber作者主页获赞总数(search / user_posts / video / posts_batch / related_posts / mix_posts / music_posts / transcript)。
author_video_countnumber作者作品总数(search / user_posts / video / posts_batch / related_posts / mix_posts / music_posts 行上)。
author_is_verifiedboolean作者是否认证(search / user_posts / video / posts_batch / related_posts / mix_posts / music_posts 行上;live_room 上是主播是否认证;comments 行上是评论者是否认证)。
cover_image_urlstring封面图链接:search / user_posts / posts_batch / related_posts / mix_posts / music_posts / media_links 是作品封面,music_search / music_detail 是音乐封面,billboard_topic_hot 是话题配图,user_mixes 是合集封面,live_room 是直播间封面;带签名的会过期。
video_widthnumber视频画面宽度(像素)。
video_heightnumber视频画面高度(像素)。
video_bitratesarray各清晰度播放地址:[{quality(清晰度名), bitrate(码率,bps), fps, is_h265(是否 H.265 编码), width, height(像素), url}],来源没给的项不出现;地址带签名、会过期(见 video_url_expires_at)。
has_watermarkboolean平台对这条作品视频文件的水印标记(true 表示带水印)。
duration_secnumber视频时长(秒)。
duration_secondsnumber时长,单位秒。非视频/音频内容为 null。
hashtagsarray正文里的话题标签数组,按出现顺序;没有时不出现这个字段。
posted_atstring发布时间,ISO 8601 格式、UTC 时区(如 2026-08-07T12:34:56+00:00)。平台只给非标准字符串时原样透传,解析前建议做容错。null 表示平台未公开。
titlestring标题。平台无标题概念时(如纯文本帖)为 null。
musicobject作品背景音乐:id、title(曲名)、author(演唱/作者)、is_original(是否原声)、duration_sec(秒)、cover_url、play_url(音频地址,可能会过期);没有音乐信息时没有这个键。
location—作品定位的地点(POI):id、name、category(地点分类)、address、district、city、province、country、city_code、latitude、longitude、cover_url、popularity_text(如 327人想去)、view_count、post_count(该地点下的作品数)、collect_count、visitor_count;作品没带定位时没有这个键。
image_urls—图片链接数组,按平台展示顺序;没有图片时不出现这个字段。
is_deletedboolean作品已被删除时为 true;抖音在作品行上标了才有这个键。
is_privateboolean作品仅自己可见(私密)时为 true;抖音在作品行上标了才有这个键。
platformstring数据来源平台标识,与请求里的 platform 一致(如 xiaohongshu、tiktok)。
music_post_count—抖音记的用了这段音乐的作品数(music_posts),每行相同;music_posts 只给抖音展示的一小部分,通常少得多。

用途

  • 看一段音乐都配了什么内容

    读各行的 text 和 hashtags,看用这段音乐的作品在讲什么。

  • 找用这段音乐的账号

    读 author_id 和 author_follower_count,列出用它发过作品的账号和规模。

  • 比较作品互动

    比较各行的 like_count、comment_count、share_count,找出用这段音乐表现最好的几条。

  • 和音乐详情搭配

    先用 music_detail 读 use_count,再用这一页看抖音展示出来的那部分作品。

抖音开放平台 与 EveryInfra 对比

下面拿抖音开放平台「总体授权说明」里的原文,对比 EveryInfra music_posts 怎么接入。

对比项抖音开放平台EveryInfra
权限申请"根据接口权限不同,开放平台提供三种不同权限下的用户权限的状态样式,您可以根据获取权限点的实际场景,按需申请。"不用按权限点申请;同一把 EveryInfra API Key 还能调用抖音的其他能力,请求只带 music_id。

引文出自抖音开放平台「总体授权说明」页,2026-11-22 核对;页面没有标更新日期。抖音官方文档没有讲同一段音乐下的作品,所以这里只比接入方式。 官方出处: 总体授权说明

限制和注意事项

  • music_id 必填,是纯数字 ID,取自作品行里 music 的 id 或 music_detail;也收 douyin.com/music/<ID> 链接。
  • music_post_count 是抖音记的使用作品数,每行相同;抖音只展示其中一部分,返回的行通常远少于它。
  • 一次调用返回整份列表,没有翻页。
  • video_url 带签名、会过期,要留存请及时下载。
  • 有些作品行带 is_deleted 或 is_private,抖音标了才有这个键。

价格

每次调用 $0.000792,按次计费,不按作品条数算;一次调用返回一份列表。失败和空结果不收费。

调用次数费用
10,000$7.92
100,000$79.17
1,000,000$791.67

合计按每次调用的标价算。

代码示例

#
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": "music_posts",
  "params": {
    "music_id": "7699717253151558410"
  }
}'

OpenAPI 定义 (JSON)示例从环境变量 EVERYINFRA_API_KEY 读取 Key,复制出去的代码不含你的 Key。

API 参考

下面是 music_posts 的参数、响应字段、错误和计费,可以复制整页,或用 Markdown 打开后交给 AI 助手。

POST

AI 提示词

#
请帮我用 EveryInfra 的「抖音用某段音乐的作品」接口(douyin/music_posts)写一个数据采集脚本。

接口约定:
- 请求:POST https://api.everyinfra.com/api/v1/social,请求头 Authorization: Bearer <API Key>;Key 从环境变量 EVERYINFRA_API_KEY 读取,不要写进代码。
- 请求体里 platform 填 douyin,action 填 music_posts,参数放在 params 里。
- 必填参数:
  - music_id:抖音音乐 ID,纯数字,取自作品 music.id 或 music_detail;也收 douyin.com/music/<ID> 链接。
- 可选参数:
  - limit:这次调用最多返回的条数,整数,至少为 1;不传按默认值,实际返回可能少于这个数。
- 返回一组记录,每条记录的主要字段:id、url、text、media_type(媒体类型)、video_url(视频播放地址(带签名、会过期)、like_count、comment_count、share_count、collect_count、author_name、author_id、author_douyin_id(作者抖音号);一共 35 个字段,完整列表见 https://api.everyinfra.com/api/v1/social/catalog?platform=douyin。
- 示例请求体:
{
  "platform": "douyin",
  "action": "music_posts",
  "params": {
    "music_id": "7699717253151558410"
  }
}
- 计费:$0.79 / 千次;失败和空结果不扣费。
- 一次要采几十上百个时,在请求体加 "mode": "async":先拿到 job_id,再轮询 GET https://api.everyinfra.com/api/v1/jobs/{job_id} 取结果。
- 返回 422 时,按错误信息里的候选参数和允许值修正;返回 429 或 503 时,按 Retry-After 等待后重试。

写代码前,先问清楚我要采哪些对象、一共多少个、需要哪些字段、结果存成什么格式,再把方案和大概花费讲给我确认。

请求参数

#
参数名位置类型必填默认值说明
Authorizationheaderstring是-Bearer 加你的 API Key。在控制台创建;不要放进网址或代码仓库。
platformbodystring是douyin平台标识,固定值。
actionbodystring是music_posts能力标识,固定值。
music_idbody.paramsstring是-抖音音乐 ID,纯数字,取自作品 music.id 或 music_detail;也收 douyin.com/music/<ID> 链接。
limitbody.paramsinteger (1–)否-这次调用最多返回的条数,整数,至少为 1;不传按默认值,实际返回可能少于这个数。

响应示例

#
这组示例参数还没有真实样例:这里只按接口定义列出响应结构和字段,值用 … 占位,不是一次真实调用的结果。
json
{  "id": "req_…",  "platform": "douyin",  "action": "music_posts",  "results": [    {      "id": …,      "url": …,      "text": …,      "media_type": …,      "video_url": …,      "like_count": …,      "comment_count": …,      "share_count": …,      "collect_count": …,      "author_name": …,      "author_id": …,      "author_douyin_id": …,      "author_bio": …,      "author_avatar_url": …,      "author_follower_count": …,      "author_following_count": …,      "author_like_count": …,      "author_video_count": …,      "author_is_verified": …,      "cover_image_url": …,      "video_width": …,      "video_height": …,      "video_bitrates": …,      "has_watermark": …,      "duration_sec": …,      "duration_seconds": …,      "hashtags": …,      "posted_at": …,      "title": …,      "music": …,      "location": …,      "image_urls": …,      "is_deleted": …,      "is_private": …,      "platform": …,      "music_post_count": …    }  ],  "count": …,  "billing": {    "charged": …,    "charged_usd": …,    "balance_after_usd": …,    …  },  "quota": { … }}

返回字段

#

业务数据在 results 里;下表是每条记录可能包含的字段,平台没有提供的值不会被编造。

字段含义
id该记录在原平台上的唯一标识。仅在同一平台内唯一,跨平台可能重复。
url该记录在原平台上的可访问链接。
text正文内容,已去除 HTML 标签,全文返回、不截断(个别平台的列表结果本身只有摘要,以该平台的字段说明为准)。
media_type媒体类型。
video_url视频播放地址(带签名、会过期,要留存请及时下载);图文笔记或来源没给时为 null。
like_count点赞数。null 表示该平台或该接口不公开此数据,不等于 0。
comment_count评论数。null 表示不公开,不等于 0。
share_count分享/转发数。null 表示不公开,不等于 0。
collect_count收藏数。null 表示不公开,不等于 0。
author_name作者昵称(显示名)。
author_id作者在原平台的唯一 ID。
author_douyin_id作者抖音号。
author_bio作者主页简介(search / user_posts / video / posts_batch / related_posts / mix_posts / music_posts 行上)。
author_avatar_url作者头像链接:search / user_posts / video / posts_batch / related_posts / mix_posts / music_posts 行上是博主的,live_room 上是主播的,comments 行上是评论者的。
author_follower_count作者粉丝数。null 表示不公开。
author_following_count作者关注数(search / user_posts / video / posts_batch / related_posts / mix_posts / music_posts 行上)。
author_like_count作者主页获赞总数(search / user_posts / video / posts_batch / related_posts / mix_posts / music_posts / transcript)。
author_video_count作者作品总数(search / user_posts / video / posts_batch / related_posts / mix_posts / music_posts 行上)。
author_is_verified作者是否认证(search / user_posts / video / posts_batch / related_posts / mix_posts / music_posts 行上;live_room 上是主播是否认证;comments 行上是评论者是否认证)。
cover_image_url封面图链接:search / user_posts / posts_batch / related_posts / mix_posts / music_posts / media_links 是作品封面,music_search / music_detail 是音乐封面,billboard_topic_hot 是话题配图,user_mixes 是合集封面,live_room 是直播间封面;带签名的会过期。
video_width视频画面宽度(像素)。
video_height视频画面高度(像素)。
video_bitrates各清晰度播放地址:[{quality(清晰度名), bitrate(码率,bps), fps, is_h265(是否 H.265 编码), width, height(像素), url}],来源没给的项不出现;地址带签名、会过期(见 video_url_expires_at)。
has_watermark平台对这条作品视频文件的水印标记(true 表示带水印)。
duration_sec视频时长(秒)。
duration_seconds时长,单位秒。非视频/音频内容为 null。
hashtags正文里的话题标签数组,按出现顺序;没有时不出现这个字段。
posted_at发布时间,ISO 8601 格式、UTC 时区(如 2026-08-07T12:34:56+00:00)。平台只给非标准字符串时原样透传,解析前建议做容错。null 表示平台未公开。
title标题。平台无标题概念时(如纯文本帖)为 null。
music作品背景音乐:id、title(曲名)、author(演唱/作者)、is_original(是否原声)、duration_sec(秒)、cover_url、play_url(音频地址,可能会过期);没有音乐信息时没有这个键。
location作品定位的地点(POI):id、name、category(地点分类)、address、district、city、province、country、city_code、latitude、longitude、cover_url、popularity_text(如 327人想去)、view_count、post_count(该地点下的作品数)、collect_count、visitor_count;作品没带定位时没有这个键。
image_urls图片链接数组,按平台展示顺序;没有图片时不出现这个字段。
is_deleted作品已被删除时为 true;抖音在作品行上标了才有这个键。
is_private作品仅自己可见(私密)时为 true;抖音在作品行上标了才有这个键。
platform数据来源平台标识,与请求里的 platform 一致(如 xiaohongshu、tiktok)。
music_post_count抖音记的用了这段音乐的作品数(music_posts),每行相同;music_posts 只给抖音展示的一小部分,通常少得多。

错误与计费

#
401
缺少 Key 或 Key 无效。
402
余额不足,先充值。
422
参数名或取值不对,按错误信息给的候选改;不扣费。
429
超过每分钟请求上限,按 Retry-After 等待后再试。
503
暂时无法完成,预扣的费用退回;结果未知时先核对,不要直接重发。
200 空结果
没有数据,不扣费。

错误码

常见问题

抖音音乐作品接口返回什么?

一份作品列表,每行一条作品:id、url、text、media_type、like_count、comment_count、share_count、collect_count、作者字段、hashtags、posted_at 等,另有 music_post_count。

为什么返回的行比 music_post_count 少很多?

music_post_count 是抖音记的使用作品数,而抖音只展示其中一部分,接口读到的就是展示出来的这部分。

music_id 从哪里来?

取自作品行里 music 的 id,或者 music_detail;douyin.com/music/<ID> 形式的链接也行。

读一份要多少钱?

每次 $0.000792,每千次 $0.79,按调用次数算,不按作品条数算。失败和空结果不收费。

同一把 Key 还能调用抖音的其他能力。

Google Analytics 同意才加载 隐私