最近更新时间:2023.02.14 14:49:39
首次发布时间:2023.02.14 14:49:39
本接口主要用于有搜索场景需求的客户,通过搜索词查询相关内容,目前支持搜索的内容体裁包括图文、横版短视频、竖版小视频。
若不指定返回条数count,则默认每次最多返回10条内容。返回的内容信息包括标题、封面图、发布时间、视频时长、作者名称与头像等,客户侧可使用这些数据,自定义实现搜索页UI。
请求结构 | 说明 |
---|---|
请求域名 | stream-api.feedcoopapi.com |
请求地址 | /data/stream/search/v3/ |
请求协议 | HTTP/HTTPS |
请求方式 | GET |
参数类型 | application/x-www-form-urlencoded |
参数 | 描述 | 类型 | 是否必填 | 说明 |
---|---|---|---|---|
keyword | 搜索字符串 | String | 是 | |
offset | 分页起始 | int | 否 | 默认为0,用于翻页,当has_more为true时,offset=当前偏移量+count |
count | 每页数量 | int | 否 | 指定返回数据条数,最大不超过20,默认返回10条。 |
need_group_types | 内容类型 | String | 否 | 用于指定搜索的内容类型,图文:tuwen,横版短视频:xigua_video,竖版小视频:short_video,多选用英文逗号分隔。 |
search_id | 搜索ID | String | 否 | 客户侧搜索id,代表本次搜索的唯一ID |
参数 | 描述 | 类型 | 说明 |
---|---|---|---|
ret | 响应结果 | long | 参见“错误码”说明 |
msg | 本次请求是否成功 | String | success:成功 |
req_id | 本次请求标识 | String | 惟一标识本次请求,火山引擎侧使用该字段进行具体问题追踪和排查 |
search_id | 搜索ID | String | 代表本次搜索的唯一ID |
has_more | 是否加载更多 | boolean | true:是,加载更多; false:否,已全部加载完毕,没有更多 |
data | 搜索结果列表 | List | 返回的搜索内容列表 |
curl --location --request GET 'https://stream-api.feedcoopapi.com/data/stream/search/v3/?access_token=xxx×tamp=xxx&signature=xxx&nonce=xxx&partner=xxx&keyword=xxx&offset=0&count=10'
{ "ret": 0, "msg": "success", "req_id": "xxx", "has_more": true, "data": [ { "group_id": xxx, "group_id_str": "xxx", "title": "xxx", "abstract": "xxx", "publish_time": 1661953235, "behot_time": 1661953235, "has_video": false, "digg_count": 1, "comment_count": 2, "video_watch_count": 8, "cover_image_list": [ { "url": "", "uri": "", "width": xxx, "height": xxx, "url_list": null, "mimetype": "" } ], "cover_mode": 3, "article_url": "xxx", "comment_url": "", "share_url": "xxx", "video_id": "", "video_duration": null, "user_info": { "avatar_url": "xxx", "description": "", "follow": false, "followers_count": 301, "user_verified": false, "verified_content": "", "home_page": "xxx", "name": "xxx", "user_id": xx }, "share_count": 1 }, ... ] }