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

feed - 内容推荐

最近更新时间2024.03.28 15:38:39

首次发布时间2021.07.05 21:23:10

该接口主要用于图文、视频等内容的个性化推荐。

注意事项

  • 使用限制:
    • 不建议存储推荐接口返回的数据:  因图片视频url变化、失效,内容状态发生变化等不可控因素的影响,会导致内容无法展示或者播放,所以不建议存储推荐接口返回的数据,避免出现问题;
    • 不要使用同一个UniqUserId并发请求推荐接口:  使用同一个UniqUserId进行并发请求,会导致内容展现读取错误,进而返回结果不符预期;
  • 前提条件:调用此接口前,请先完成:推荐配置

请求说明

  • 请求方式:POST
  • 请求地址:https://cms.volcengineapi.com?Action=Feed&Version=2021-06-17
  • 请求头:ServiceName: volc_content_api

调试

请求参数

下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数

Query

参数
类型
是否必填
示例值
描述
Action
String

feed

要执行的操作,取值:feed

Version
String

2021-06-17

API的版本,取值:2021-06-17

Body

参数
类型
是否必填
示例值
描述
Context
Context

上下文信息

UniqUserId
String

用户唯一标识

Category
String

fa00a123

场景id,取值路径:控制台 - 内容分发 - 场景管理 - 场景ID

PersonalRec
Integer

1

是否使用个性化推荐,默认为1。

PersonalRec描述
1使用个性化推荐
0不使用个性化推荐,按内容发文时间倒排返回

返回参数

下表仅列出本接口特有的返回参数。更多信息请参见返回结构

参数
类型
示例值
描述
Data
ArticleList

内容列表,在内容候选量足够的情况下,一次下发12条内容,暂不支持修改配置。

BaseResp
BaseResp

响应结果

请求示例

{
    "UniqUserId": "12345678",
    "Category": "260c69b0",
    "Context": {
        "IP": "",
        "Province": "北京",
        "RefreshType": "open"
    },
    "PersonalRec": 1
}

返回示例

{
	"BaseResp": {
		"StatusCode": 1000,
		"StatusMessage": "success"
	},
	"Data": {
		"ArticleList": [{
				"Abstract": "在阅读正文前,你必须知道一点:***",
				"Author": {
					"AuthorAvatarUrl": "https://p3-open.onewsimg.com/img/user-avatar/5a64bb5f28e956991275bad2c97f8a3b~300x300.image",
					"AuthorBizId": "1953162566048499",
					"AuthorId": "1719178065424519",
					"AuthorName": "作者名称",
					"Description": "作者描述",
					"FollowerCount": 0,
					"HomePage": "https://open.toutiao.com/u1953162566048499/?utm_source=***"
				},
				"CommentCount": 86,
				"CommentUrl": "https://open.toutiao.com/a7049397754094764580/comment/?utm_source=***",
				"Content": "",
				"CoverImages": [{
					"Height": 572,
					"Url": "http://p9-open-sign.onewsimg.com/tos-cn-i-qvj2lq49k0/8b1f4b14fa8440ae9426b5aae369477f~tplv-obj.jpeg?scene=feed.article&x-expires=1704413000&x-signature=AHGgUrtqSADCcQLg7C%2FMD1emn1c%3D",
					"Weight": 1023,
					"Width": 1023
				}],
				"DiggCount": 1573,
				"Extra": "",
				"GenerateType": "toutiao_api",
				"GroupId": 1721064642450455,
				"GroupType": "article",
				"Link": "https://open.toutiao.com/a7049397754094764580/?utm_source=***&label=wap",
				"OpenId": "7049397754094764580",
				"PublishTime": 1641332100,
				"DisplayTag": {
          "tags": "A"
         },
				"Tags": [
					"数字货币",
					"体育",
					"金轮股份",
					"CES",
					"南风股份",
					"恒宝股份",
					"唐德影视",
					"金运激光",
					"神州信息",
					"雪人股份",
					"易华录",
					"天喻信息",
					"*ST川化",
					"我的第一部5G手机",
					"投资",
					"银行",
					"热点图文"
				],
				"Title": "1月5日A股猛料:五大部委联合发文!4板块将迎来重要政策面催化",
				"GoodsIds": ["test_goods_1", "test_goods_2"],
				"GoodsList": [{
						"GoodsId": "test_goods_1",
						"GoodsName": "测试商品1",
						"Keywords": "a;b",
						"Description": "测试用",
						"GoodsSourceId": "1722272335075342"
					},
					{
						"GoodsId": "test_goods_2",
						"GoodsName": "测试商品2",
						"Keywords": "a;b;c",
						"Description": "测试用",
						"GoodsSourceId": "1722272335075342"
					}
				]
			},
			{
				"Abstract": "基建板块***",
				"Author": {
					"AuthorAvatarUrl": "https://p3-open.onewsimg.com/img/user-avatar/5631696dc3f94b19161c24b2c432cedb~300x300.image",
					"AuthorBizId": "3913858107048077",
					"AuthorId": "1720074930427915",
					"AuthorName": "作者名称",
					"Description": "作者描述",
					"FollowerCount": 0,
					"HomePage": "https://open.toutiao.com/u3913858107048077/?utm_source=***"
				},
				"CommentCount": 0,
				"CommentUrl": "https://open.toutiao.com/a7044899212504515086/comment/?utm_source=***",
				"Content": "",
				"DiggCount": 8,
				"Extra": "",
				"GenerateType": "toutiao_api",
				"GroupId": 1720074930426939,
				"GroupType": "article",
				"Link": "https://open.toutiao.com/a7044899212504515086/?utm_source=***&label=wap",
				"OpenId": "7044899212504515086",
				"PublishTime": 1640269006,
				"Tags": [
					"经济",
					"财经",
					"股票",
					"证券投资基金",
					"新能源",
					"行业-图文"
				],
				"Title": "基建分析(基金)",
				"GoodsIds": ["test_goods_1", "603176"],
				"GoodsList": [{
						"GoodsId": "test_goods_1",
						"GoodsName": "测试商品1",
						"Keywords": "a;b",
						"Description": "测试用",
						"GoodsSourceId": "1722272335075342"
					},
					{
						"GoodsId": "603176",
						"GoodsName": "汇通集团",
						"Keywords": "603176",
						"Description": "测试用",
						"GoodsSourceId": "1722281316786190"
					}
				],
				"TopicInfo": {
					"TopicId": "17xxxxxxxxxxx",
					"TopicSource": "cms"
					"OpenId": "",
					"TopicName": "专题测试",
					"Description": "",
					"CoverImgUrl": "",
					"ShareImgUrl": "",
					"LandingPageUrl": "",
					"ExtInfo": ""
				}
			}
		],
		"RequestId": "***"
	}
}

错误码

下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。

状态码
错误码
错误信息
说明
200
1002
服务未知错误

请联系火山引擎技术人员

200
1000
成功

接口请求成功