post_idstring必填
**Purpose**: Post ID
https://api.sandbase.ai/v1/api/youtube/web-v2/post-detailReturns detailed information for a YouTube community post, including post text, media attachments, and engagement metrics. Filter results by post ID, language, and country.
[
{
"data": {
"channel_metadata": {
"avatar_url": "",
"channel_id": "UCkRfArvrzheW2E7b6SVT7vQ",
"channel_url": "",
"description": "",
"title": "YouTube Creators"
},
"comments_continuation_token": "4qmFsgKzAhIoRkVjb21tZW50X3Bvc3RfZGV0YWlsX3BhZ2Vfd2ViX3RvcF9sZXZlbBqGAkVnVndiM04wYzZvRFd5SkhNQURZQVFIcUFTUlZaMnQ0YVVOVFVtWkVObWMzVTFCc1YwZFFSR0V6ZG1KUU4yRkpjM2wwV0ZKcmRubnlBUmhWUTJ0U1prRnlkbko2YUdWWE1rVTNZalpUVmxRM2RsRkNFR052YlcxbGJuUnpMWE5sWTNScGIyN0NBMW9TR0ZWRGExSm1RWEoyY25wb1pWY3lSVGRpTmxOV1ZEZDJVUm9rVldkcmVHbERVMUptUkRabk4xTlFiRmRIVUVSaE0zWmlVRGRoU1hONWRGaFNhM1o1V2hoVlEydFNaa0Z5ZG5KNmFHVlhNa1UzWWpaVFZsUTNkbEUlM0Q%3D",
"post": {
"attachment": {
"images": [
{
"height": 288,
"url": "https://yt3.ggpht.com/wbxSQ9KLMZWcSCw2Q78wZ1YfvUb9zpWRs6QYRSHt4n277DENaKkLxd9WYZeU4NGCplLEe4E1Ty1TMQ=s288-rw-nd-v1",
"width": 288
},
{
"height": 400,
"url": "https://yt3.ggpht.com/wbxSQ9KLMZWcSCw2Q78wZ1YfvUb9zpWRs6QYRSHt4n277DENaKkLxd9WYZeU4NGCplLEe4E1Ty1TMQ=s400-rw-nd-v1",
"width": 400
},
{
"height": 512,
"url": "https://yt3.ggpht.com/wbxSQ9KLMZWcSCw2Q78wZ1YfvUb9zpWRs6QYRSHt4n277DENaKkLxd9WYZeU4NGCplLEe4E1Ty1TMQ=s512-rw-nd-v1",
"width": 512
},
"… 6 more items in the full response"
],
"type": "image"
},
"author_channel_id": "UCkRfArvrzheW2E7b6SVT7vQ",
"author_name": "YouTube Creators",
"author_thumbnails": [
{
"height": 32,
"url": "//yt3.googleusercontent.com/LZeUOuOM8lzINkYAKi1X3pCQz1xsSD_EndPUR1vOGesaGavUtyM_-bCUq7Gld-LPX_R7uieWsA=s32-c-k-c0x00ffffff-no-rj-mo",
"width": 32
},
{
"height": 48,
"url": "//yt3.googleusercontent.com/LZeUOuOM8lzINkYAKi1X3pCQz1xsSD_EndPUR1vOGesaGavUtyM_-bCUq7Gld-LPX_R7uieWsA=s48-c-k-c0x00ffffff-no-rj-mo",
"width": 48
},
{
"height": 76,
"url": "//yt3.googleusercontent.com/LZeUOuOM8lzINkYAKi1X3pCQz1xsSD_EndPUR1vOGesaGavUtyM_-bCUq7Gld-LPX_R7uieWsA=s76-c-k-c0x00ffffff-no-rj-mo",
"width": 76
}
],
"author_url": "/@youtubecreators",
"comment_count": "",
"content_text": "🎉 Posts are rolling out to more creators than ever before!! 🎉 \n\nWe're so excited to announce that we’re starting to roll out posts access to all eligible channels TODAY and over the coming weeks. While posts will become available to most channels on YouTube, there are some cases where the feature will continue to be turned off as it has been historically:\n\n✅ Channels that are set as Made for Kids\n✅ Folks who access YouTube with a supervised account\n✅ More details can be found in our Help Center: https://yt.be/help/postsGA \n\nOnce you have access, get the post party on your channel started by:…",
"post_id": "UgkxiCSRfD6g7SPlWGPDa3vbP7aIsytXRkvy",
"post_url": "https://www.youtube.com/post/UgkxiCSRfD6g7SPlWGPDa3vbP7aIsytXRkvy",
"published_time": "2年前(修改过)",
"vote_count": "4428"
}
}
}
]选择一个示例,将其输入和结果加载到 playground 中。
Returns one YouTube community post with its text, image attachments, author details, and vote count. The only required input is the post_id of the post.
curl -X POST "https://api.sandbase.ai/v1/api/youtube/web-v2/post-detail" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"post_id": "UgkxiCSRfD6g7SPlWGPDa3vbP7aIsytXRkvy"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
post_id | string | Yes | Purpose: Post ID |
country_code | string | No | Country code, default "US" |
language_code | string | No | Language code, default "zh-CN" |
need_format | boolean | No | Whether to format data, default true |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"channel_metadata": {
"avatar_url": "",
"channel_id": "UCkRfArvrzheW2E7b6SVT7vQ",
"channel_url": "",
"description": "",
"title": "YouTube Creators"
},
"comments_continuation_token": "4qmFsgKz…",
"post": {
"attachment": {
"images": [
{
"height": 288,
"url": "https://yt3.ggpht.com/wbxSQ9KLMZWcSCw2Q78wZ1YfvUb9zpWRs6QYRSHt4n277DENaKkLxd9WYZ…",
"width": 288
}
],
"type": "image"
},
"author_channel_id": "UCkRfArvrzheW2E7b6SVT7vQ",
"author_name": "YouTube Creators",
"author_thumbnails": [
{
"height": 32,
"url": "//yt3.googleusercontent.com/LZeUOuOM8lzINkYAKi1X3pCQz1xsSD_EndPUR1vOGesaGavUtyM_…",
"width": 32
}
],
"author_url": "/@youtubecreators",
"comment_count": "",
"content_text": "🎉 Posts are rolling out to more creators than ever before!! 🎉 \n\nWe're so excited…",
"post_id": "UgkxiCSRfD6g7SPlWGPDa3vbP7aIsytXRkvy",
"post_url": "https://www.youtube.com/post/UgkxiCSRfD6g7SPlWGPDa3vbP7aIsytXRkvy",
"published_time": "2年前(修改过)",
"vote_count": "4409"
}
}
| Field | Meaning |
|---|---|
post.post_id / post.post_url | The ID of the post and its full YouTube link. |
post.content_text | The text of the post. |
post.vote_count | The number of votes on the post, returned as a string such as "4409". |
post.comment_count | The comment count of the post. It is an empty string in this response. |
post.published_time | The publish time as display text in the requested language, for example 2年前(修改过). It is relative text, not a date. |
post.author_name / post.author_channel_id / post.author_url | The name of the posting channel, its channel ID, and its relative channel path. |
post.author_thumbnails[].url | Avatar image URLs for the author at several sizes. Each row has width and height. |
post.attachment.images[].url | Image URLs attached to the post, one per size, with width and height. post.attachment.type is image here. |
channel_metadata.channel_id / channel_metadata.title | The ID and title of the channel that owns the post. |
comments_continuation_token | A token for loading the comments of this post. |
post_id from the post list of a channel. YouTube Channel Community Posts returns posts for a channel.comments_continuation_token with YouTube Community Post Comments to read the comments on this post.language_code defaults to zh-CN, so text such as published_time comes back in Chinese unless you set another value like en-US.channel_metadata.avatar_url, channel_metadata.channel_url, and channel_metadata.description are empty strings. Use post.author_thumbnails and post.author_url for these values.$0.001 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.
开始构建
具备统一身份验证和使用情况跟踪的平台 API 端点。
curl -X POST "https://api.sandbase.ai/v1/api/youtube/web-v2/post-detail" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"post_id": "UgkxiCSRfD6g7SPlWGPDa3vbP7aIsytXRkvy",
"need_format": true,
"country_code": "US",
"language_code": "en-US"
}'将您的 SandBase API 密钥设置到服务器环境中。请求使用 Bearer 身份验证。
export SANDBASE_API_KEY="YOUR_API_KEY"请将密钥保存在服务器端。不要在浏览器代码中暴露它。
post_idstring必填**Purpose**: Post ID
country_codestringCountry code, default `"US"`
默认值:"US"
language_codestringLanguage code, default `"zh-CN"`
默认值:"zh-CN"
need_formatbooleanWhether to format data, default `true`
默认值:true
这是该 API 保存的示例响应;查看时不会发起实时请求。
[
{
"data": {
"channel_metadata": {
"avatar_url": "",
"channel_id": "UCkRfArvrzheW2E7b6SVT7vQ",
"channel_url": "",
"description": "",
"title": "YouTube Creators"
},
"comments_continuation_token": "4qmFsgKzAhIoRkVjb21tZW50X3Bvc3RfZGV0YWlsX3BhZ2Vfd2ViX3RvcF9sZXZlbBqGAkVnVndiM04wYzZvRFd5SkhNQURZQVFIcUFTUlZaMnQ0YVVOVFVtWkVObWMzVTFCc1YwZFFSR0V6ZG1KUU4yRkpjM2wwV0ZKcmRubnlBUmhWUTJ0U1prRnlkbko2YUdWWE1rVTNZalpUVmxRM2RsRkNFR052YlcxbGJuUnpMWE5sWTNScGIyN0NBMW9TR0ZWRGExSm1RWEoyY25wb1pWY3lSVGRpTmxOV1ZEZDJVUm9rVldkcmVHbERVMUptUkRabk4xTlFiRmRIVUVSaE0zWmlVRGRoU1hONWRGaFNhM1o1V2hoVlEydFNaa0Z5ZG5KNmFHVlhNa1UzWWpaVFZsUTNkbEUlM0Q%3D",
"post": {
"attachment": {
"images": [
{
"height": 288,
"url": "https://yt3.ggpht.com/wbxSQ9KLMZWcSCw2Q78wZ1YfvUb9zpWRs6QYRSHt4n277DENaKkLxd9WYZeU4NGCplLEe4E1Ty1TMQ=s288-rw-nd-v1",
"width": 288
},
{
"height": 400,
"url": "https://yt3.ggpht.com/wbxSQ9KLMZWcSCw2Q78wZ1YfvUb9zpWRs6QYRSHt4n277DENaKkLxd9WYZeU4NGCplLEe4E1Ty1TMQ=s400-rw-nd-v1",
"width": 400
},
{
"height": 512,
"url": "https://yt3.ggpht.com/wbxSQ9KLMZWcSCw2Q78wZ1YfvUb9zpWRs6QYRSHt4n277DENaKkLxd9WYZeU4NGCplLEe4E1Ty1TMQ=s512-rw-nd-v1",
"width": 512
},
"… 6 more items in the full response"
],
"type": "image"
},
"author_channel_id": "UCkRfArvrzheW2E7b6SVT7vQ",
"author_name": "YouTube Creators",
"author_thumbnails": [
{
"height": 32,
"url": "//yt3.googleusercontent.com/LZeUOuOM8lzINkYAKi1X3pCQz1xsSD_EndPUR1vOGesaGavUtyM_-bCUq7Gld-LPX_R7uieWsA=s32-c-k-c0x00ffffff-no-rj-mo",
"width": 32
},
{
"height": 48,
"url": "//yt3.googleusercontent.com/LZeUOuOM8lzINkYAKi1X3pCQz1xsSD_EndPUR1vOGesaGavUtyM_-bCUq7Gld-LPX_R7uieWsA=s48-c-k-c0x00ffffff-no-rj-mo",
"width": 48
},
{
"height": 76,
"url": "//yt3.googleusercontent.com/LZeUOuOM8lzINkYAKi1X3pCQz1xsSD_EndPUR1vOGesaGavUtyM_-bCUq7Gld-LPX_R7uieWsA=s76-c-k-c0x00ffffff-no-rj-mo",
"width": 76
}
],
"author_url": "/@youtubecreators",
"comment_count": "",
"content_text": "🎉 Posts are rolling out to more creators than ever before!! 🎉 \n\nWe're so excited to announce that we’re starting to roll out posts access to all eligible channels TODAY and over the coming weeks. While posts will become available to most channels on YouTube, there are some cases where the feature will continue to be turned off as it has been historically:\n\n✅ Channels that are set as Made for Kids\n✅ Folks who access YouTube with a supervised account\n✅ More details can be found in our Help Center: https://yt.be/help/postsGA \n\nOnce you have access, get the post party on your channel started by:…",
"post_id": "UgkxiCSRfD6g7SPlWGPDa3vbP7aIsytXRkvy",
"post_url": "https://www.youtube.com/post/UgkxiCSRfD6g7SPlWGPDa3vbP7aIsytXRkvy",
"published_time": "2年前(修改过)",
"vote_count": "4428"
}
}
}
]探索更多
| API | 价格 | 响应 |
|---|---|---|
YouTube | $0.001 每次调用 | JSON |
YouTube | $0.001 每次调用 | JSON |
YouTube | $0.001 每次调用 | JSON |
YouTube | $0.001 每次调用 | JSON |
YouTube | $0.001 每次调用 | JSON |
YouTube | $0.001 每次调用 | JSON |
问题
向 https://api.sandbase.ai/v1/api/youtube/web-v2/post-detail 发送 POST 请求,在 Authorization 请求头中使用您的 SandBase API key(Bearer),并将参数作为 JSON 请求体传入。您也可以直接在本页的 Playground 中试用,无需编写代码。
每次调用 $0.001,从您的 SandBase 余额中扣费。您只需为实际调用付费;无需订阅。
必填:post_id (string)。 可选:country_code (string), language_code (string) 和 need_format (boolean)。 Parameters 表和本页的 Playground 列出了每个字段。
在同一个 HTTP 请求中返回的 JSON 响应(同步)。 本页的 README 包含一个示例响应。
不需要。YouTube Community Post Details 通过 SandBase 运行,因此一个 SandBase API key 即可覆盖此端点以及目录中的其他所有 API 和模型。您无需单独申请 YouTube API 访问权限。