本接口主要用于有搜索场景需求的客户,通过搜索词查询相关内容,目前支持搜索的内容体裁包括图文、横版短视频、竖版小视频。
若不指定返回条数Count,则默认每次最多返回10条内容。返回的内容信息包括标题、封面图、发布时间、视频时长、作者名称与头像等,客户侧可使用这些数据,自定义实现搜索页UI。
下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。
参数 | 类型 | 是否必填 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | SearchV2 | 要执行的操作,取值:SearchV2。 |
Version | String | 是 | 2021-01-01 | API的版本,取值:2021-01-01。 |
Partner | String | 是 | xxx_default_content | 渠道号。 |
AccessToken | String | 是 | AT6zTZuXzffKpQaxxxBKVv8mp94LR2ARdNJBp2BT86GrLpa3brqLmscGCUipuJNh2piKTT12 | 用户唯一标识。 |
Keyword | String | 是 | 测试 | 搜索字符串。 |
Offset | Integer | 否 | 0 | 分页起始。 |
Count | Integer | 否 | 10 | 每页数量。 |
SearchId | String | 否 | id001 | 搜索ID。 |
NeedGroupTypes | String | 否 | tuwen | 内容类型。
|
下表仅列出本接口特有的返回参数。更多信息请参见返回结构。
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
SearchId | String | id001 | 搜索ID,代表本次搜索的唯一ID。 |
HasMore | Boolean | true | 是否加载更多。
|
Data | Array of SearchArticle | 搜索内容列表。 |
GET /?Action=SearchV2&Version=2021-01-01&Partner=xxx_default_content&AccessToken=AT6zTZuXzffKpQaxxxBKVv8mp94LR2ARdNJBp2BT86GrLpa3brqLmscGCUipuJNh2piKTT12&Keyword=%E6%B5%8B%E8%AF%95 HTTP/1.1 Host: https://mercury.volcengineapi.com/?Action=SearchV2&Version=2021-01-01 X-Date: 20240603T084818Z Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20240603/cn-beijing/content/request, SignedHeaders=host;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f
{ "ResponseMetadata": { "RequestId": "202406031648401031600911103644EF", "Action": "SearchV2", "Version": "2021-01-01", "Service": "content", "Region": "cn-beijing" }, "Result": { "SearchId": "id001", "HasMore": true, "Data": [ { "Abstract": "-", "ArticleType": "小视频", "ArticleUrl": "https://feedcoop.douyin.com/d7269709590722314788/?a_t=AT6zTZxxxTT12&biz_log=B35nBnxxxAq8&group_id=7269709590722314788&isNews=1&item_id=7269709590722314788&label=search&platform_source=1&req_id=2024xxx3135628237D5D376F678A7DB7F9&utm_campaign=open&utm_medium=webview&utm_source=xxx_default_content", "CommentUrl": "https://feedcoop.douyin.com/d7269709590722314788/comment/?a_t=AT6zTZuxxxT12&biz_log=B3xxxAq8&group_id=7269709590722314788&isNews=1&label=search&platform_source=1&req_id=2024060xxx5628237D5D376F678A7DB7F9&utm_source=xxx_default_content", "CoverImages": [ { "Url": "https://p6-open-sign.byteimg.com/tos-cn-i-pk90l89vgd/1c6a1776374c4486a46a5a5cbb145ffa~tplv-tt-cut:3216:1810.jpeg?scene=content&x-expires=1747815830&x-signature=ElLytAjeIfSe2O2WkFMqOBY2VUw%3D", "Width": 3216, "Height": 1810 } ], "CoverMode": 1, "DiggCount": 10000, "GroupId": "7269709590722314788", "HasVideo": true, "PublishTime": 1692611022, "ShareCount": 10000, "ShareUrl": "https://feedcoop.douyin.com/d7269709590722314788/?a_t=AT6zxxxT12&biz_log=BAC6xxx1eA&group_id=7269709590722314788&isNews=1&label=share&platform_source=1&req_id=202xxx03135628237D5D376F678A7DB7F9&utm_campaign=open&utm_medium=webview&utm_source=xxx_default_content", "Title": "标题", "UserInfo": { "AvatarUrl": "-", "Description": "-", "HomePage": "-", "Name": "-", "Follow": true, "FollowerCount": 0, "UserId": "-", "UserVerified": true, "VerifiedContent": "-" }, "VideoWatchCount": 10000, "VideoDetail": { "VideoDuration": 2230.115, "VideoList": [ { "Definition": "360p", "Height": 360, "Width": 640, "Url": "http://mercury.snssdk.com/video/url/?param=ZvBxCxxxK2je&partner=xxx_default_content&version=2&trans_vdata_to_content=1" } ] } } ] } }
您可访问公共错误码,获取更多错误码信息。