查询视频
概述
给定已授权用户和视频 ID 列表,/v2/video/query/ 端点会验证这些视频是否属于该用户,并返回视频详情。该端点可用于刷新指定视频的封面图片 URL TTL。每个请求最多可包含 20 个视频 ID。
HTTP URL | https://open.tiktokapis.com/v2/video/query/ |
HTTP 方法 | POST |
范围 | video.list |
请求
标头
键 | 类型 | 说明 | 示例 | 必填 |
Authorization | string | 承载 TikTok 用户授权的令牌,通过 /oauth/access_token/ 获取。 | Bearer act.example12345Example12345Example | true |
Content-Type | string | 指明资源的原始媒体类型 | application/json | true |
查询参数
键 | 类型 | 说明 | 示例 | 必填 |
fields | string | 请求的字段,请从以下对象的字段中选择:视频对象: [id, create_time, cover_image_url, share_url, video_description, duration, height, width, title, embed_html, embed_link, like_count, comment_count, share_count, view_count, is_aigc] | id,title,fps | true |
请求正文
键 | 类型 | 说明 | 示例 | 必填 |
filters | VideoFilters | 按 video_ids 筛选视频 | { | true |
请求示例
curl -L -X POST 'https://open.tiktokapis.com/v2/video/query/?fields=id,title' \
-H 'Authorization: Bearer act.example12345Example12345Example' \
-H 'Content-Type: application/json' \
--data-raw '{
"filters": {
"video_ids": [
"1234123412345678567",
"1010102020203030303"
]
}
}'响应
键 | 类型 |
data | map<string, QueryUserVideoResponseData> |
error |
QueryUserVideoResponseData
键 | 类型 | 说明 |
videos | list<视频对象> | 视频对象列表 |
示例
{
"data":{
"videos":[
{
"title":"Video 1",
"id":"1234123412345678567"
},
{
"title":"Video 2",
"id":"1010102020203030303"
}
]
},
"error": {
"code":"ok",
"message":"",
"log_id":"20220829194722CBE87ED59D524E727021"
}
}