搜索内容

接口描述

通过关键词搜索匹配的视频内容。

请求地址

接口地址:https://api.shuwen.com/mcndata/content/search

请求方式:GET

请求头

参数 是否必填 类型 描述
sw-access-key 必填 String AccessKey

请求参数

参数 是否必填 类型 描述
timestamp 必填 Long 毫秒级时间戳
signature 必填 String 签名信息,详见接口鉴权
keyword 必填 String 搜索关键词,需URLEncode
page 可选 Integer 起始页码,默认为1
size 可选 Integer 单页返回条数,1-100之间整数,默认10

响应结果

以下仅列出了接口响应结果,公共响应结果见请求响应结果

字段 允许为空 类型 描述
total_count Integer 符合条件的结果条数
has_more Integer 是否有更多数据,当has_more为1时表示有更多数据,可使用page和size请求参数进行翻页
+list Array 内容列表,无结果时返回空
└list.cid String 内容ID
└list.title String 内容标题
└list.url String 内容播放页地址
└list.thumbnail String 内容封面
└list.publish String 内容发布时间
└list.platform String 认证信息,未认证的账号返回空
└list.play_count Integer 内容播放数,抖音平台为空
└list.like_count Integer 内容点赞数,部分平台为空
└list.update_time String 内容数据更新时间
└list.video_duration Integer 视频时长
└+list.media Object 发布账号信息
└list.media.mid String 发布账号ID
└list.media.name String 发布账号名称
└list.media.avatar String 发布账号头像
└list.media.is_verified Integer 发布账号认证状态,1为认证账号,0为未认证账号

请求额度

单个应用每日的请求次数如下:

应用状态 请求额度
体验 10次/天
正式 50,000次/天

请求示例

下面使用Python实现该接口调用,开发者可以参考实现其他语言的版本。

import requests
import time
import hashlib

# 应用ak和sk
access_key = "YOUR_ACCESS_KEY"
secret_key = "YOUR_SECRET_KEY"

# 13位的当前时间戳
timestamp = round(time.time() * 1000)


# 生成签名
def getSignature(access_key, secret_key, timestamp):
    temp = secret_key + str(timestamp) + access_key
    return hashlib.md5(temp.encode(encoding="UTF-8")).hexdigest()

# 签名后的字符串
signature = getSignature(access_key, secret_key, timestamp)

# 请求url
url = "https://api.shuwen.com/mcndata/content/search"

# 请求头
headers = {
  "sw-access-key": access_key
}

# 请求参数
params = {
    "timestamp": timestamp,
    "signature": signature,
    "keyword": "特朗普",  # 搜索关键词
    "page": 1,     # 起始页数,默认为1
    "size": 10     # 单页条数,默认为10
}

# 发起http请求
response = requests.get(url, params=params, headers=headers)
print(response.content.decode("utf8"))复制

响应示例

{
    "success": true,
    "code": "0",
    "msg": "Success",
    "requestId": "http-nio-8080-exec-78_709ca4ea6ff74986ab2971b24425dea3",
    "data": {
        "list": [
            {
                "video_duration": 60000,
                "thumbnail": "https://mcn.newscdn.cn/cover/content/20200528/3c8621ce5df69683069d34d692b53832.jpg",
                "update_time": "2020-05-28 16:00:13",
                "like_count": 77,
                "publish": "2020-04-19 11:20:33",
                "media": {
                    "name": "肖锋",
                    "mid": "1079262",
                    "avatar": "https://mcn.newscdn.cn/cover/media/20200414/a35b9ccced22d76fd3e146b662bf0abf.jpg",
                    "is_verified": 1
                },
                "play_count": 40000,
                "title": "特朗普特朗普",
                "platform": "weibo",
                "url": "https://www.mcndata.cn/link/25acw8HzEIVS",
                "cid": "1265915768994930688"
            },
            {
                "video_duration": 15000,
                "thumbnail": "https://mcn.newscdn.cn/cover/content/20200528/e67ab9a8f71fbde25a66645c8e662f1e.jpg",
                "update_time": "2020-06-28 00:08:12",
                "like_count": 5,
                "publish": "2020-03-31 14:13:03",
                "media": {
                    "name": "汽车专家魏杰",
                    "mid": "328144",
                    "avatar": "https://mcn.newscdn.cn/cover/media/20200428/39d55af373baf43f0e53eafde2a43de7.jpg",
                    "is_verified": 1
                },
                "play_count": 410,
                "title": "特朗普特朗普现身",
                "platform": "weibo",
                "url": "https://www.mcndata.cn/link/25azbcNvQsZC",
                "cid": "1265925524715405312"
            },
            {
                "video_duration": 251000,
                "thumbnail": "https://mcn.newscdn.cn/cover/content/20200514/947122e4b15f717d7479f78b81c024e3.jpg",
                "update_time": "2020-05-14 17:32:16",
                "like_count": 0,
                "publish": "2020-04-24 14:34:38",
                "media": {
                    "name": "国际趣闻旁观者",
                    "mid": "819885",
                    "avatar": "https://mcn.newscdn.cn/cover/media/20200414/17201109ccfb2a18d617315534466f96.png",
                    "is_verified": 0
                },
                "play_count": 2,
                "title": "爆笑:特朗普和小特朗普",
                "platform": "uc",
                "url": "https://www.mcndata.cn/link/256s3UTYcs14",
                "cid": "1260865499999371264"
            },
            {
                "video_duration": 138000,
                "thumbnail": "https://mcn.newscdn.cn/cover/content/20200618/1f8270d8662e4d1bfee2581a89f04d87.jpg",
                "update_time": "2020-06-18 16:01:41",
                "publish": "2020-06-18 15:12:55",
                "media": {
                    "name": "娱乐一千馆",
                    "mid": "1019032",
                    "avatar": "https://mcn.newscdn.cn/cover/media/20200414/bc123e6f0686fedb4caef64900f2f4fa.jpg",
                    "is_verified": 0
                },
                "play_count": 0,
                "title": "美国小朋友扮演特朗普吐槽特朗普#美国# #特朗普#",
                "platform": "netease",
                "url": "https://www.mcndata.cn/link/26MEnyILicAw",
                "cid": "1273526280410771456"
            },
            {
                "video_duration": 38000,
                "thumbnail": "https://mcn.newscdn.cn/cover/content/20200516/eb0f45107def44325fae81cbe3cab87f.jpg",
                "update_time": "2020-05-16 07:20:35",
                "like_count": 9020,
                "publish": "2020-05-04 10:20:49",
                "media": {
                    "name": "诡笑的狐狸",
                    "mid": "88059225",
                    "avatar": "https://mcn.newscdn.cn/cover/media/20200428/9fbaf200a9cc83d7eaa17a8bb26a5fd1.jpg",
                    "is_verified": 0
                },
                "play_count": 105906,
                "title": "【特朗普】特 朗 普 秘 制 消 毒 液",
                "platform": "bilibili",
                "url": "https://www.mcndata.cn/link/25AFyecOAGxa",
                "cid": "1261436343087661056"
            },
            {
                "video_duration": 87000,
                "thumbnail": "https://mcn.newscdn.cn/cover/content/20200615/7b79d7e053568dfadd69e9d1f36f6cd5.jpg",
                "update_time": "2020-06-15 16:39:55",
                "like_count": 0,
                "publish": "2020-04-05 13:08:06",
                "media": {
                    "name": "仙溪看剧",
                    "mid": "994396",
                    "avatar": "https://mcn.newscdn.cn/cover/media/20200525/2a40af74ce61110ae64de48bcc78744e.png",
                    "is_verified": 0
                },
                "play_count": 47,
                "title": "特朗普:特朗普庆祝弹劾失败!",
                "platform": "uc",
                "url": "https://www.mcndata.cn/link/26FpcsVqTpHs",
                "cid": "1272448739512041472"
            },
            {
                "video_duration": 87000,
                "thumbnail": "https://mcn.newscdn.cn/cover/content/20200602/7dcc86246a982191a82a26ad32059a49.jpg",
                "update_time": "2020-06-02 22:31:30",
                "like_count": 0,
                "publish": "2020-04-03 09:00:00",
                "media": {
                    "name": "娱乐综艺大神",
                    "mid": "1130163",
                    "avatar": "https://mcn.newscdn.cn/cover/media/20200414/dd8afd24d60ae9cda54ee4d2228feb61.png",
                    "is_verified": 0
                },
                "play_count": 7,
                "title": "特朗普:特朗普庆祝弹劾失败~",
                "platform": "uc",
                "url": "https://www.mcndata.cn/link/25oIYxLBVgcs",
                "cid": "1267826176181850112"
            },
            {
                "video_duration": 87000,
                "thumbnail": "https://mcn.newscdn.cn/cover/content/20200602/a4104229b353a4587955a5b19a575cb3.jpg",
                "update_time": "2020-06-02 22:38:35",
                "like_count": 0,
                "publish": "2020-04-06 14:05:41",
                "media": {
                    "name": "晓然老师3dmax教程",
                    "mid": "951596",
                    "avatar": "https://mcn.newscdn.cn/cover/media/20200414/2eb8353fb3fb3563526941a78cee5e31.png",
                    "is_verified": 0
                },
                "play_count": 0,
                "title": "特普朗,特普朗庆祝弹劾失败",
                "platform": "uc",
                "url": "https://www.mcndata.cn/link/25ocJD9PA3oG",
                "cid": "1267827958492573696"
            },
            {
                "video_duration": 300000,
                "thumbnail": "https://mcn.newscdn.cn/cover/content/20200611/1acf210f143d092b794473595a1622ce.jpg",
                "update_time": "2020-06-11 09:20:36",
                "like_count": 0,
                "publish": "2020-06-11 09:03:48",
                "media": {
                    "name": "孟儿说娱乐",
                    "mid": "1255652",
                    "avatar": "https://mcn.newscdn.cn/cover/media/20200525/06d8d34d07b2569d6065e90d3924cd3b.png",
                    "is_verified": 0
                },
                "play_count": 0,
                "title": "特朗普采访“特朗普”,我有点懵逼",
                "platform": "uc",
                "url": "https://www.mcndata.cn/link/266WXyMRJfco",
                "cid": "1270888630159822848"
            },
            {
                "video_duration": 19000,
                "thumbnail": "https://mcn.newscdn.cn/cover/content/20200427/e57285092a1d2580abb1701d10dfade8.jpg",
                "update_time": "2020-04-30 10:36:55",
                "like_count": 882,
                "publish": "2020-03-17 22:48:37",
                "media": {
                    "name": "CGTN",
                    "mid": "891391",
                    "avatar": "https://mcn.newscdn.cn/cover/media/20200414/0c5ff9095031b699bf91dba9967a46f8.jpg",
                    "is_verified": 1
                },
                "play_count": 130000,
                "title": "特朗普",
                "platform": "weibo",
                "url": "https://www.mcndata.cn/link/24UYrR6vicD4",
                "cid": "1254770730780995584"
            }
        ],
        "total_count": 488502,
        "has_more": 1
    }
}复制