You need to enable JavaScript to run this app.
最新活动
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们
导航

内容搜索

最近更新时间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搜索IDString客户侧搜索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&timestamp=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
        },
        ...
    ]
}