← 返回目录
📁 API Reference › Video

获取视频推荐封面

您可以使用本接口获取根据视频素材推荐的一系列封面图片。返回中的URL可用于预览封面,您可预览后为自己的视频设置封面图片。

注意
若想为刚上传的视频获取推荐封面,建议您等待 30 秒至 5 分钟,待视频转码处理完成后再调用本接口。若视频转码尚未完成便调用本接口,可能导致报错 Insufficient permissions for some videos(对部分视频的权限不足)。

v1.2与v1.3版本对比

以下表格概括了 v1.2与v1.3接口的变化。 ``xtable |变化内容{30%}|v1.2{35%}|v1.3{35%}| |---|---|---| |接口路径|/v1.2/file/video/suggestcover/|/v1.3/file/video/suggestcover/| |请求参数类型 |advertiser_id: number|advertiser_id`: string|



## 请求

**地址** https://business-api.tiktok.com/open_api/v1.3/file/video/suggestcover/

**方法** GET

**请求Header**

``` xtable
|字段|类型|描述|
|---|---|---|
|Access-Token {必填}|string|授权访问令牌,可以通过[获取访问令牌](https://ads.tiktok.com/marketing_api/docs?id=1738373164380162)接口获取。|

请求参数

|字段|类型|描述|
|---|---|---|
|advertiser_id {必填}|string|广告账号ID。|
|video_id {必填}|string|视频ID。 |
|poster_number |number|要获取的封面数目。取值范围:1-10,默认为`10`。若候选封面总数少于本字段设置的数量,仅返回全部候选封面。 |

示例

(code curl http)
curl --get -H "Access-Token:xxx" \
--data-urlencode "advertiser_id={advertiser_id}" \
--data-urlencode "video_id={video_id}" \
https://business-api.tiktok.com/open_api/v1.3/file/video/suggestcover/
(/code)

返回

|字段|类型|描述|
|---|---|---|
|code |number|返回码。完整返回码列表及描述,可查看[附录-返回码](https://ads.tiktok.com/marketing_api/docs?id=1737172488964097)。  |
|message |string|返回信息。更多信息可查看[附录-返回码](https://ads.tiktok.com/marketing_api/docs?id=1737172488964097)。  |
|data |object|返回数据。  |
#|list |object[]|封面列表。|
##|width |number|图片宽度。|
##|height |number|图片高度。|
##|id |string|图片ID。|
##|url |string|图片预览地址,有效期1小时,过期需重新获取。|
|request_id |string|请求的日志ID,唯一标识一个请求。  |

示例

(code Success-Response http)
HTTPS/1.1 200 OK
{
    "message": "OK",
    "code": 0,
    "data": {
        "list": [
          {
            "url": "http://p1.ipstatp.com/large/tos-useast2a-p-0000/8cc546a4b96a4933a27b0c7fefdd66a9_1584964597",
            "width": 560,
            "id": "tos-useast2a-p-0000/8cc546a4b96a4938a27b0c7fefdd66a9_1584964597",
            "height": 320
          },
          {
            "url": "http://p1.ipstatp.com/large/tos-useast2a-p-0000/36973f6fd2344c9fa5889db57d743ac6_1584964597",
            "width": 560,
            "id": "tos-useast2a-p-0000/36973f6fd2344c90a5889db57d743ac6_1584964597",
            "height": 320
          }
        ]
    },
    "request_id": "2020032312235001018904922349195A66"
}
(/code);

内容来源:TikTok API for Business 官方文档 · 本地归档

在接这个接口时卡住了?
Stuck wiring this API into production? We build ad-delivery tooling on these platforms — campaign automation, reporting pipelines, error-handling and migration between API versions.
联系我们 · Talk to us 每日平台更新简报 →