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

内容输出

最近更新时间2024.03.14 13:27:28

首次发布时间2023.06.27 18:54:03

本文档介绍内容定制提供的对外输出能力接入,包括以下接口:

  • 【扫描输出内容】:按输出顺序遍历最近一段时间输出的内容,并返回内容详情;

  • 【批量获取输出内容】:使用内容唯一键,获取输出内容详情和状态。

接口说明

公共部分

请求

请求URL

请求URL由3部分组成

KEYVALUE/说明
Host(固定值)https://mercury.volcengineapi.com
Action按实际Action填写,下文写明
Version(固定值)2023-01-01

例如

https://mercury.volcengineapi.com?Action=ScanSyncArticles&Version=2023-01-01

请求Header

KEYVALUE/说明
Content-Type(固定值)application/json
ServiceName(固定值)volc_torchlight_api
AccessKey按实际AK填写
SecretKey按实际SK填写

验签及请求公共参数逻辑参考火山引擎官网:

响应

ResponseMetadata

字段名
字段类型
是否必填
说明
RequestId
string
请求链路Id
Action
string
访问Action
Version
string
API版本号
Service
string
访问的服务名称
Region
string
访问区域
Error
Error
错误信息

扫描输出内容 - ScanSyncArticles

该接口按同步时间升序,扫描该渠道下最近14天同步的内容,用于做增量内容拉取和数据回溯。

说明

  • 该接口用于数据拉取,不建议直接承接线上流量,接口单客户限流10QPS;

  • 如何判断已经拉取到最新的数据?
    返回的Articles为空数组,NextToken和上次请求的一致。

请求URL

https://mercury.volcengineapi.com?Action=ScanSyncArticles&Version=2023-01-01

请求Method

POST

数据入参

字段名字段类型是否必填说明
UtmSourcestring渠道号
NextTokenstring分页获取下一页内容的游标;不传递则返回第一页的内容(最近14天内最早的一篇同步内容)
MaxResultsnumber返回每页的条数,默认值为10,最大值为30,不填或非法输入默认返回10条

数据出参

字段名
字段类型
说明
ResponseMetadata
ResponseMetadata
通用返回
Result
ScanSyncArticlesResult
基本请求结果

Tags返回示例(以Categories为例):

{
    "Categories": [
        {
            "Name": "娱乐",
            "SubCategories": [
                {
                    "Name": "影视",
                    "SubCategories": []
                },
                {
                    "Name": "综艺",
                    "SubCategories": []
                }
            ]
        },
        {
            "Name": "美食",
            "SubCategories": []
        }       
    ]
}

Locations返回示例:

{
    "Locations": [
        {
            "Code": "33",
            "Name": "浙江省"
        },
        {
            "Code": "330100",
            "Name": "杭州市"
        },
        {
            "Code": "330110",
            "Name": "余杭区"
        }
    ]
}

相关枚举

ArticleType说明
article图文。类今日头条的图文内容
feed_video中视频。类西瓜视频横版Feed视频流
short_video短视频。类抖音竖版视频
short_content短内容。类今日头条的微头条内容

调用示例

携带公共参数验签,POST请求接口同步内容基本信息(公共参数验签参见上文)

{
    "UtmSource": "xxxx_default_content",
    "NextToken": "",
    "MaxResults":2
}

返回示例

正常返回示例

{
    "ResponseMetadata": {
        "RequestId": "202306211106236436C29742C741A10485",
        "Action": "ScanSyncArticles",
        "Version": "2023-01-01",
        "Service": "volc_torchlight_api",
        "Region": "cn-north-1"
    },
    "Result": {
        "NextToken": "176801242193xxxx",
        "Articles": [
            {
                "GroupId": "726979524640427xxxx",
                "Title": "火山岩涂装运动版途锐亮相成都车展,大众豪华SUV的新王者?",
                "ArticleType": "feed_video",
                "PublishTime": 1692631106,
                "CreateTime": 1700450117,
                "ArticleUrl": "https://open.toutiao.com/a726979524640427xxxx/?biz_log=BCNjrqxb2FYqBqyco4t9Vj4WCbHi3bRdVLHH6ZugbxjCuCgHpMV15v1KuF18dQDauc679ZbSBRbJtiZU6mQzq4dstQmH42HVmnt9BbjFUsZeFiZyoUPHCRcVTzR2o57sgfisbjDWAAevGnAn&group_id=7269795246404272674&label=torchlight&utm_source=xxx_default_content",
                "CoverImages": [
                    {
                        "Width": 1280,
                        "Height": 720,
                        "Url": "http://p3-open-sign.onewsimg.com/motor-article-img/e8b98ba0652e49a8987a6916fd3f9c13~tplv-tt-cs0:1280:720.jpeg?scene=core&x-expires=1763522164&x-signature=RN97yC7ctsm%2BtYJI97pXmrHOq%2Fo%3D"
                    }
                ],
                "Author": {
                    "Name": "车道笔迹",
                    "AvatarUrl": "https://p9-open-sign.onewsimg.com/user-avatar/39fedeb0377f9aeeb146d57368f0083e~tplv-obj.jpeg?scene=core&x-expires=1763522164&x-signature=oFi2p6RN7wIngCMnJz0PhdK2jQU%3D"
                },
                "Video": {
                    "Duration": 197,
                    "VideoPlayInfos": [
                        {
                            "VideoUrl": "https://open.toutiao.com/video/url/?param=4f2UqG3KiZePLyxazxqWgYPVB8Di1Dhcm2Av9HKSaVN2tCzuH4c8pniDt8JbhWWDfkKXA8z9xdj1ZWTvbiqKfZszHPcZ7sWQo541UWxFatpeNwv87P68ii9pVHzbjNL6Q6SzMdG4Yu6bQi1wZKHq68tzPqbbLd8TphpZ44kUZYmrUvtwW8yxf42pn8c6paJ8PjkXjz2WrC&partner=xxx_default_content&version=3",
                            "Definition": "360p",
                            "Size": 12075872,
                            "Width": 640,
                            "Height": 360
                        },
                        ...
                    ]
                },
                "Interactions": {
                    "ReadCount": 357,
                    "DiggCount": 0,
                    "ShareCount": 0,
                    "CommentCount": 0,
                    "CommentUrl": "https://open.toutiao.com/a726979524640427xxxx/comment/?utm_source=xxx_default_content"
                },
                "Tags": {
                    "Categories": [
                        {
                            "Name": "汽车",
                            "SubCategories": [
                                {
                                    "Name": "汽车选买",
                                    "SubCategories": [
                                        {
                                            "Name": "新车资讯",
                                            "SubCategories": []
                                        },
                                        {
                                            "Name": "汽车导购评测",
                                            "SubCategories": []
                                        }
                                    ]
                                }
                            ]
                        }
                    ],
                    "FinanceCategories": [
                        {
                            "Name": "生活",
                            "SubCategories": [
                                {
                                    "Name": "汽车",
                                    "SubCategories": [
                                        {
                                            "Name": "新车测评",
                                            "SubCategories": []
                                        }
                                    ]
                                }
                            ]
                        }
                    ],
                    "CarCategories": [
                        {
                            "Name": "大众",
                            "SubCategories": [
                                {
                                    "Name": "大众(进口)",
                                    "SubCategories": [
                                        {
                                            "Name": "途锐",
                                            "SubCategories": []
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                },
                "Locations": [
                    {
                        "Code": "51",
                        "Name": "四川省"
                    },
                    {
                        "Code": "510100",
                        "Name": "成都市"
                    }
                ], 
                "Collection": {
                    "CollectionId": "178259984667xxxx",
                    "CollectionName": "***"
                }
            },...
        ]
    }
}

错误返回示例

{
    "ResponseMetadata": {
        "RequestId": "202210271151020102121450321B8D2A21",
        "Action": "ScanSyncArticles",
        "Version": "2023-01-01",
        "Service": "volc_torchlight_api",
        "Region": "cn-north-1",
        "Error": {
            "CodeN": 100010,
            "Code": "SignatureDoesNotMatch",
            "Message": "The request signature we calculated does not match the signature you provided. Check your Secret Access Key and signing method. Consult the service documentation for details."
        }
    }
}

批量获取输出内容 - MGetSyncArticles

该接口可查看历史同步过的全量内容,用于定向内容更新、状态更新、早期数据回溯。

说明

  • 该接口用于数据拉取,不建议直接承接线上流量,接口单客户限流20QPS。

请求URL

https://mercury.volcengineapi.com?Action=MGetSyncArticles&Version=2023-01-01

请求Method

POST

数据入参

字段名字段类型是否必填说明
UtmSourcestring渠道号
GroupIds[]string文章ID列表。一次性最多传入30条,超过30条会截取前30个ID

数据出参

字段名
字段类型
说明
ResponseMetadata
ResponseMetadata
通用返回
Result
MGetSyncArticleResult
基本请求结果

相关枚举

MissReason说明
500001内容未同步;对应同步文章内容不在该租户下
500008内容因其他原因不可用,可以提供RequestId或GroupId协助查询
500009内容因合规问题被全局下架

调用示例

携带公共参数验签,POST请求接口同步内容基本信息(公共参数验签参见上文)

{
    "UtmSource": "xxxx_default_content",
    "GroupIds": ["724626020041459xxxx","725212278880954xxxx"]
}

返回示例

正常返回示例

{
    "ResponseMetadata": {
        "RequestId": "202311201116049E5B58E9D49D7385CB18",
        "Action": "MGetSyncArticles",
        "Version": "2023-01-01",
        "Service": "volc_torchlight_api",
        "Region": "cn-north-1"
    },
    "Result": {
        "Articles": {
            "727312169685988xxxx": {
                "GroupId": "727312169685988xxxx",
                "Title": "三款MPV亮相成都车展,29万起步的全尺寸,1200公里续航+双电机",
                "ArticleType": "feed_video",
                "PublishTime": 1693405606,
                "CreateTime": 1700450117,
                "ArticleUrl": "https://open.toutiao.com/a727312169685988xxxx/?biz_log=BCNjrqxb2FYqBqyco4t9Vj4WCbHi3bRdVLHH6ZugbxjCuCgHpMV15v1KuF19wMUU4Rci6k5129CqegNQtRYR4HEceGTfDedvEAxGqLcoK5aY3STCLpAKv46dBuea38hpZZsYK2NH3MkXrYZG&group_id=7273121696859882040&label=torchlight&utm_source=xxx_default_content",
                "CoverImages": [
                    {
                        "Width": 1920,
                        "Height": 1080,
                        "Url": "http://p6-open-sign.onewsimg.com/tos-cn-i-0004/oMhP4EkMqAtAfOMeQAAxH24YGo3tJgAckBUjAf~tplv-tt-cs0:1920:1080.jpeg?scene=core&x-expires=1763522164&x-signature=tOi22YmMGyXMhJEoaj%2Fdts0UGfk%3D"
                    }
                ],
                "Author": {
                    "Name": "晓百侃车",
                    "AvatarUrl": "https://p6-open-sign.onewsimg.com/user-avatar/29dcbe3b49401f5ca86f3226a64afd24~tplv-obj.jpeg?scene=core&x-expires=1763522164&x-signature=LGlNQwHxqpGup8bXitwVYJLHbE4%3D"
                },
                "Video": {
                    "Duration": 198,
                    "VideoPlayInfos": [
                        {
                            "VideoUrl": "https://open.toutiao.com/video/url/?param=4f2UqG3KiZePLyxazxqWgYPVB8Di1Dhcm2Av9HKSaVN2tCzuH4c8pniDt8JbhWWDfkKXA8z9xdj1ZWTvbiqKfZszHPcZ7sZZWenMmVtiqReEdb82QzLFDnUVZTSWpvhBFGrgCBtrLxMoFjTdNP1YRRmJuq9SfAPxfMftJmJ8hN2FS4rfm4ZNnCUV771m1edkUG5px3tg7a&partner=xxx_default_content&version=3",
                            "Definition": "360p",
                            "Size": 11307462,
                            "Width": 640,
                            "Height": 360
                        },
                        {
                            "VideoUrl": "https://open.toutiao.com/video/url/?param=4f2VvmmkcpkWerQK3d9AfJwy9Xpe1u85SxcqM4KMferAmvC93MmbAozCuTWkuUEGGguip2Bg8u5yfi2J78kyecUqa4tLcq3YLL6f9JBRZ9P8jCkMPSiJryZzQn4p94Afayn7DooKMFAnn99dvWpxehhAFCo6dphQtKRP7vT2M96RH5nMxQ6NXxDwCPWTCG81scpnJ9aQNk&partner=xxx_default_content&version=3",
                            "Definition": "480p",
                            "Size": 16674282,
                            "Width": 854,
                            "Height": 480
                        },
                        {
                            "VideoUrl": "https://open.toutiao.com/video/url/?param=4f2ZAMdXqYfg6esjQyCkbfx8vjXm7xFaNB48Cg6y4zmbRzWVTdPc6YsTZ7NA3pVBpQ6MvhSpLLDx87NNH7w5GubzuebZc2VXZ1LEvnz4C3AuLfjjhoyZfRbPaDQM3FT7HeMpmZoA5v2ZEZFrMHVqygBNRDLjGLC2XFUQbFPcCfhfX1mnFhKgh8joHCsoQihbE3fQyGvdEx&partner=xxx_default_content&version=3",
                            "Definition": "720p",
                            "Size": 34146158,
                            "Width": 1280,
                            "Height": 720
                        },
                        {
                            "VideoUrl": "https://open.toutiao.com/video/url/?param=H9CXsm1PFcRQST1UCD3sDWmDg5AASBMozrohPa3H1cQYSRjp84uF1hfPXQtM6aTc4yeh6QiHnRm2Mfon4uNYtR5JxbCzeYwtwCfjUiCuqJ6cTatLe4RXR1fxv4bvpsmbxGeXy9SxebTnuV1rAfNTaxcuZtQXLqUnrtAkFfbDkRuyoN9MZvimnjf6FneEBgEXC23pWJ5Ff1A&partner=xxx_default_content&version=3",
                            "Definition": "1080p",
                            "Size": 66908082,
                            "Width": 1920,
                            "Height": 1080
                        }
                    ]
                },
                "Interactions": {
                    "ReadCount": 518,
                    "DiggCount": 1,
                    "ShareCount": 0,
                    "CommentCount": 0,
                    "CommentUrl": "https://open.toutiao.com/a727312169685988xxxx/comment/?utm_source=xxx_default_content"
                },
                "Tags": {
                    "Categories": [
                        {
                            "Name": "汽车",
                            "SubCategories": [
                                {
                                    "Name": "汽车选买",
                                    "SubCategories": [
                                        {
                                            "Name": "新车资讯",
                                            "SubCategories": []
                                        },
                                        {
                                            "Name": "汽车导购评测",
                                            "SubCategories": []
                                        }
                                    ]
                                }
                            ]
                        }
                    ],
                    "FinanceCategories": [
                        {
                            "Name": "生活",
                            "SubCategories": [
                                {
                                    "Name": "汽车",
                                    "SubCategories": [
                                        {
                                            "Name": "新车测评",
                                            "SubCategories": []
                                        }
                                    ]
                                }
                            ]
                        }
                    ],
                    "CarCategories": [
                        {
                            "Name": "大众",
                            "SubCategories": [
                                {
                                    "Name": "上汽大众",
                                    "SubCategories": [
                                        {
                                            "Name": "威然",
                                            "SubCategories": []
                                        }
                                    ]
                                }
                            ]
                        },
                        {
                            "Name": "理想汽车",
                            "SubCategories": [
                                {
                                    "Name": "理想汽车",
                                    "SubCategories": [
                                        {
                                            "Name": "理想L8",
                                            "SubCategories": []
                                        }
                                    ]
                                }
                            ]
                        },
                        {
                            "Name": "魏牌",
                            "SubCategories": [
                                {
                                    "Name": "长城汽车",
                                    "SubCategories": [
                                        {
                                            "Name": "高山DHT-PHEV",
                                            "SubCategories": []
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                },
                "Locations": [
                    {
                        "Code": "51",
                        "Name": "四川省"
                    },
                    {
                        "Code": "510100",
                        "Name": "成都市"
                    }
                ],
                "Collection": {
                    "CollectionId": "178259984667xxxx",
                    "CollectionName": "横版-同步"
                }
            }
        },
        "MissReasons": {
            "724626020041459xxxx": 500001
        }
    }
}

错误返回示例

{
    "ResponseMetadata": {
        "RequestId": "20221027161954010150140026033A4C8B",
        "Action": "MGetSyncArticles",
        "Version": "2023-01-01",
        "Region": "cn-north-1",
        "Error": {
            "CodeN": 100025,
            "Code": "InvalidCredential",
            "Message": "Invalid credential in 'Authorization', Pls check your authorization header."
        }
    }
}