You need to enable JavaScript to run this app.
导航

内容搜索

最近更新时间2023.09.25 16:53:59

首次发布时间2023.02.14 14:49:39

本接口主要用于有搜索场景需求的客户,通过搜索词查询相关内容,目前支持搜索的内容体裁包括图文、横版短视频、竖版小视频。
若不指定返回条数count,则默认每次最多返回10条内容。返回的内容信息包括标题、封面图、发布时间、视频时长、作者名称与头像等,客户侧可使用这些数据,自定义实现搜索页UI。

请求结构说明
请求域名stream-api.feedcoopapi.com
请求地址/data/stream/search/v4/
请求协议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
返回的搜索内容列表

请求示例

GET /data/stream/search/v4/?access_token=xxx&timestamp=1695624033&signature=xxx&nonce=123&partner=xxx&keyword=xxx&offset=0&count=10 HTTP/1.1
Host: stream-api.feedcoopapi.com

响应示例

{
    "ret": 0,
    "msg": "success",
    "req_id": "202309251442051A590A80E0B16903BFBE",
    "search_id": "3227dbc4897d403f61469535a71f6642",
    "has_more": true,
    "data": [
        {
            "abstract": "",
            "article_type": "小视频",
            "article_url": "https://feedcoop.douyin.com/d7248210575673737788/?...",
            "comment_count": 2,
            "comment_url": "https://feedcoop.douyin.com/d7248210575673737788/comment/?...",
            "cover_images": [
                {
                    "url": "https://p6-open-sign.onewsimg.com/tos-cn-p-0015/c41944c27a5c4c34aca383a031111944_1687605492~tplv-tt-cut:1080:1920.jpeg?scene=search&x-expires=1758696126&x-signature=uPUk3Uz9q%2B2CVmqrAycKyFD5cOU%3D",
                    "height": 1920,
                    "width": 1080
                }
            ],
            "cover_mode": 1,
            "digg_count": 92575,
            "group_id": "7248210575673737788",
            "has_video": true,
            "publish_time": 1687605487,
            "share_count": 3880,
            "share_url": "https://feedcoop.douyin.com/d7248210575673737788/?...",
            "title": "xxx",
            "user_info": {
                "avatar_url": "https://p3-open-sign.onewsimg.com/aweme-avatar/tos-cn-avt-0015_0508c47a0e949dc3e5b7886d19b0c8a6~tplv-obj.jpeg?scene=core&x-expires=1758696110&x-signature=eC%2Bvkr9Zi4QW2NHh%2B4aVKplISAo%3D",
                "description": "会说会笑,浑身带着骄傲🇨🇳\n去发光,而不是被照亮\n我愿先颠沛流离,再遇见温暖的你🤍\n🤝商务🛰️:MQ891088(备注品牌)",
                "follow": false,
                "follower_count": 1695633,
                "home_page": "https://feedcoop.douyin.com/u67187729583/?...",
                "name": "xxx",
                "user_id": 67187729583,
                "user_verified": true,
                "verified_content": "情感自媒体"
            },
            "video_watch_count": 7279436,
            "video_detail": {
                "video_duration": 126.967,
                "video_list": [
                    {
                        "url": "http://open.toutiao.com/video/url/v1/?...",
                        "height": 640,
                        "width": 360,
                        "definition": "360p"
                    }
                ]
            }
        },...
    ]
}