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

内容输出

最近更新时间2023.07.07 16:48:31

首次发布时间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": []
        }       
    ]
}

相关枚举

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

调用示例

携带公共参数验签,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": "725199324971848xxxx",
                "Title": "A股见底了嘛?影响7月核心因素有哪些?边风炜:打好7月翻身仗!",
                "ArticleType": "article",
                "PublishTime": 1688487019,
                "CreateTime": 1688524200,
                "ArticleUrl": "https://open.toutiao.com/a725199324971848xxxx/?biz_log=B3v1W6kLdfnjVfFVNt4jrMG8oo8c794U48cfaPg4ChzuoCxpfvxXxrL2v3CogSf4BoBbhZkjT8t7Qkt2JMHFffkuqQduEx2mqU5Scs&group_id=725199324971848xxxx&isNews=0&item_id=0&stick_protect=0&sticky=0&utm_campaign=open&utm_medium=webview&utm_source=xxxx_default_content",
                "CoverImages": [
                    {
                        "Width": 564,
                        "Height": 563,
                        "Url": "https://p9-open-sign.onewsimg.com/tos-cn-i-qvj2lq49k0/85df42a9bb55437c8cb6c2f0fbb2d3b2~tplv-tt-cs0:564:563.jpeg?scene=torchlight&x-expires=1751772414&x-signature=R4RhKcG8QDOj8uGs40oNmF5TywU%3D"
                    }
                ],
                "Author": {
                    "Name": "上海热线财经",
                    "AvatarUrl": "https://p6-open-sign.onewsimg.com/mosaic-legacy/14f000277f8a15d1772~tplv-obj.jpeg?scene=core&x-expires=1751772381&x-signature=cUOZYfIpGnvTWlp6qoe8mPUbgDo%3D"
                },
                "Video": null,
                "Interactions": {
                    "ReadCount": 2333,
                    "DiggCount": 24,
                    "ShareCount": 5,
                    "CommentCount": 2,
                    "CommentUrl": "https://open.toutiao.com/a725199324971848xxxx/comment/?biz_log=B3v1W6kLdfnjVfFVNt4jrMG8oo8c794U48cfaPg4ChzuoCxpfvxXxrL2v3CogSf4BoBbhZkjT8t7Qkt2JMHFffkuqQduEx2mqU5Scs&group_id=725199324971848xxxx&isNews=0&item_id=0&stick_protect=0&sticky=0&utm_source=xxxx_default_content"
                },
                "Tags": {
                    "Categories": [
                        {
                            "Name": "财经",
                            "SubCategories": [
                                {
                                    "Name": "股票",
                                    "SubCategories": []
                                }
                            ]
                        }
                    ],
                    "FinanceCategories": [
                        {
                            "Name": "财经",
                            "SubCategories": [
                                {
                                    "Name": "股票",
                                    "SubCategories": [
                                        {
                                            "Name": "大盘动态",
                                            "SubCategories": []
                                        },
                                        {
                                            "Name": "个股行情",
                                            "SubCategories": []
                                        },
                                        {
                                            "Name": "板块动态",
                                            "SubCategories": []
                                        }
                                    ]
                                }
                            ]
                        }
                    ],
                    "CarCategories": []
                }
            },
            {
                "GroupId": "725042906040736xxxx",
                "Title": "6子!还记得我之前教你的弹射起步吗?#奥迪a6l #宝马5系 #大众cc",
                "ArticleType": "feed_video",
                "PublishTime": 1688122065,
                "CreateTime": 1688464800,
                "ArticleUrl": "https://open.toutiao.com/a725042906040736xxxx/?biz_log=B3v1W6kLdfnjVfFVNswrwWmud7BvM1MvWYUg3sbrykUmSDWAGe9ZhPwFv8PhJdbXv1xdigorpoB2x85j3USPNEDUiV22AvSLbgD4dH&group_id=725042906040736xxxx&isNews=0&item_id=0&stick_protect=0&sticky=0&utm_campaign=open&utm_medium=webview&utm_source=xxxx_default_content",
                "CoverImages": [
                    {
                        "Width": 3147,
                        "Height": 1769,
                        "Url": "https://p3-open-sign.onewsimg.com/tos-cn-i-dy/49f989e8059b4ff3b899961348960f09~tplv-tt-cs0:3147:1769.jpeg?scene=torchlight&x-expires=1751771322&x-signature=XDA2mAkd5Sc3dBP84o6WjXFdFJU%3D"
                    }
                ],
                "Author": {
                    "Name": "京娱汽车大电影",
                    "AvatarUrl": "https://p3-open-sign.onewsimg.com/user-avatar/8bafb9c5e31d7482ce0300a3fca06554~tplv-obj.jpeg?scene=core&x-expires=1751771322&x-signature=Yuy5esE2nEyozwnFhO%2B%2F3cKG5W4%3D"
                },
                "Video": {
                    "Duration": 123,
                    "VideoPlayInfos": [
                        {
                            "VideoUrl": "https://open.toutiao.com/video/url/?param=4f2WzoqRn4A2ipRACy28e7Ap3vsjZaybZbcXAyiCpk4pA6khNLzsT88VdX5BESa8SD2NM3p4TAYbjxTnqomnMc9Q7PMDfVAKRisceVhq2qUkVQkxiqbBqVip8nirczijx22R8w6smKWbbSFMaboXUfaLGCPWKBorGWwiEbB6AnkqVcid5K5WApUHowZt6L99g39LaSHmep&partner=xxxx_default_content&version=3",
                            "Definition": "540p",
                            "Size": 23885453,
                            "Width": 1024,
                            "Height": 576
                        },
                        {
                            "VideoUrl": "https://open.toutiao.com/video/url/?param=4f2ZAMdXqYfg6esjQyCkbfx8vjXm7xFaNB48Cg6y4zmbRzWVTdPc61D7U1bxQbZcWXunjL3Pe1o52Fv1gWKfAH1QRWqiuZdJSu9ZE9FVi9F5qx4pNFQr4KHG9AhmjA6hyCmzRd42doLyar9U543gFnnN1tV9cmhtCTqyNqDpvSbYY6BBKdTf8HbwtzVuHsB53vw8b3okDW&partner=xxxx_default_content&version=3",
                            "Definition": "720p",
                            "Size": 26832323,
                            "Width": 1280,
                            "Height": 720
                        },
                        {
                            "VideoUrl": "https://open.toutiao.com/video/url/?param=H9CXsm1PFcRQST1UCD3sDWmDg5AASBMozrohPa3H1cQYSRjp84uF1h7jBKnatwEgVfnWXDLtMjSbUZxKiJkwUJSiN75EorV2i6ZYo1ZBGpCge6AfiirxhQZendZEFZgFYxCx8oWDX9M7KqJjnP91REjWZV5fmBvJiZP7pTB3y9gsgPDkxzeumAoxQQRrHZNzfqw6Dur8myi&partner=xxxx_default_content&version=3",
                            "Definition": "1080p",
                            "Size": 40862897,
                            "Width": 1920,
                            "Height": 1080
                        }
                    ]
                },
                "Interactions": {
                    "ReadCount": 1342,
                    "DiggCount": 11,
                    "ShareCount": 1,
                    "CommentCount": 1,
                    "CommentUrl": "https://open.toutiao.com/a725042906040736xxxx/comment/?biz_log=B3v1W6kLdfnjVfFVNswrwWmud7BvM1MvWYUg3sbrykUmSDWAGe9ZhPwFv8PhJdbXv1xdigorpoB2x85j3USPNEDUiV22AvSLbgD4dH&group_id=725042906040736xxxx&isNews=0&item_id=0&stick_protect=0&sticky=0&utm_source=xxxx_default_content"
                },
                "Tags": {
                    "Categories": [
                        {
                            "Name": "汽车",
                            "SubCategories": []
                        }
                    ],
                    "FinanceCategories": [],
                    "CarCategories": [
                        {
                            "Name": "大众",
                            "SubCategories": [
                                {
                                    "Name": "一汽-大众",
                                    "SubCategories": [
                                        {
                                            "Name": "大众CC",
                                            "SubCategories": []
                                        }
                                    ]
                                }
                            ]
                        },
                        {
                            "Name": "奥迪",
                            "SubCategories": [
                                {
                                    "Name": "一汽-大众奥迪",
                                    "SubCategories": [
                                        {
                                            "Name": "奥迪A6L",
                                            "SubCategories": []
                                        }
                                    ]
                                }
                            ]
                        },
                        {
                            "Name": "宝马",
                            "SubCategories": [
                                {
                                    "Name": "华晨宝马",
                                    "SubCategories": [
                                        {
                                            "Name": "宝马5系",
                                            "SubCategories": []
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                }
            }
        ]
    }
}

错误返回示例

{
    "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": "20230621110520DADF968776080B43FDED",
        "Action": "MGetSyncArticles",
        "Version": "2023-01-01",
        "Service": "volc_torchlight_api",
        "Region": "cn-north-1"
    },
    "Result": {
        "Articles": {
            "725212278880954xxxx": {
                "GroupId": "725212278880954xxxx",
                "Title": "香港中文大学(深圳)教授郑永年:打造共同市场 消除贸易壁垒",
                "ArticleType": "article",
                "PublishTime": 1688516438,
                "CreateTime": 1688524200,
                "ArticleUrl": "https://open.toutiao.com/a725212278880954xxxx/?biz_log=B3v1W6kLdfnjVfFVNt4jrMG8oo8c794U48cfaPg4ChzuoCxpfvxWksYNGMUXTbGsUJ1B4MuL3tbHYAamAv5J47hRWeGWUgGQv4CoCw&group_id=725212278880954xxxx&isNews=0&item_id=0&stick_protect=0&sticky=0&utm_campaign=open&utm_medium=webview&utm_source=xxxx_default_content",
                "CoverImages": [],
                "Author": {
                    "Name": "深圳特区报",
                    "AvatarUrl": "https://p3-open-sign.onewsimg.com/user-avatar/d1abb669a2e17f2df2165d62c95a9878~tplv-obj.jpeg?scene=core&x-expires=1751772316&x-signature=hwVRQOk5c6LBHM786kMX77yLkds%3D"
                },
                "Video": null,
                "Interactions": {
                    "ReadCount": 13,
                    "DiggCount": 0,
                    "ShareCount": 1,
                    "CommentCount": 0,
                    "CommentUrl": "https://open.toutiao.com/a725212278880954xxxx/comment/?biz_log=B3v1W6kLdfnjVfFVNt4jrMG8oo8c794U48cfaPg4ChzuoCxpfvxWksYNGMUXTbGsUJ1B4MuL3tbHYAamAv5J47hRWeGWUgGQv4CoCw&group_id=725212278880954xxxx&isNews=0&item_id=0&stick_protect=0&sticky=0&utm_source=xxxx_default_content"
                },
                "Tags": {
                    "Categories": [
                        {
                            "Name": "财经",
                            "SubCategories": []
                        }
                    ],
                    "FinanceCategories": [
                        {
                            "Name": "财经",
                            "SubCategories": [
                                {
                                    "Name": "宏观",
                                    "SubCategories": [
                                        {
                                            "Name": "国内宏观",
                                            "SubCategories": []
                                        }
                                    ]
                                }
                            ]
                        }
                    ],
                    "CarCategories": []
                }
            }
        },
        "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."
        }
    }
}