YouTube API
Community Post
Get details for a YouTube community post.
POST
$0.01/call/v1/youtube/postUsage
const res = await fetch('https://api.yepapi.com/v1/youtube/post', {
method: 'POST',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({ id: 'UgkxMy8D54...' }),
});
const { data } = await res.json();
console.log(data.contentText, data.likeCount);curl -X POST https://api.yepapi.com/v1/youtube/post \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"id": "UgkxMy8D54..."}'Request Body
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
id | string | Yes | YouTube post ID | — |
Response
{
"ok": true,
"data": {
"postId": "UgkxMy8D54...",
"channelTitle": "Creator",
"channelId": "UCxyz...",
"contentText": "What video should I make next?",
"likeCount": 5432,
"replyCount": 890,
"publishedTimeText": "2 days ago",
"thumbnail": [
{ "url": "https://yt3.ggpht.com/...", "width": 48, "height": 48 }
]
}
}Response Fields
| Field | Type | Description |
|---|---|---|
ok | boolean | Whether the request succeeded |
data.postId | string | Unique community post identifier |
data.channelTitle | string | Name of the channel that created the post |
data.channelId | string | Unique identifier for the channel |
data.contentText | string | Text content of the community post |
data.likeCount | number | Number of likes on the post |
data.replyCount | number | Number of replies/comments on the post |
data.publishedTimeText | string | Relative publish time (e.g. 2 days ago) |
data.thumbnail | object[] | Post image or attachment thumbnails |