YouTube Posts Results API
When a YouTube search shows a shelf of community posts, SerpApi renders it under the posts_results array with each shelf including its position_on_page.
The individual posts contain a post_id, link, author, text, published_date, votes, comments_count and, when the post carries an image or a video, an attachment. They have the same shape as the posts_results of the YouTube Channel API.
The API endpoint is https://serpapi.com/search?engine=youtube
Head to the playground for a live and interactive demo.
API examples
Posts results overview
{
...
"posts_results": [
{
"position_on_page": 5,
"posts": [
{
"position": 1,
"post_id": "Ugkxz0MaIdj0_ZUSaUhmz3H7poPNbCHK7_yY",
"link": "https://www.youtube.com/post/Ugkxz0MaIdj0_ZUSaUhmz3H7poPNbCHK7_yY",
"author": {
"name": "Veritasium",
"link": "https://www.youtube.com/@veritasium",
"thumbnail": "https://yt3.googleusercontent.com/7vCbvtCqtjQ3YLgsJt7Y952MQV1sBvhllSCSxHP8_sVZdcPCBrITfhkN2RdyCuwPnsByq-1GoA=s76-c-k-c0x00ffffff-no-rj-mo"
},
"text": "Exciting announcement.... Elements of Truth is now available on YouTube Playables! https://www.youtube.com/playables/Ugk...\n\nAre you confident about what you know? Play the digital version of our upcoming table top game at the link above.\n\nLet us know your score in the comments!",
"published_date": "1 day ago",
"votes": "761",
"extracted_votes": 761,
"comments_count": "97",
"extracted_comments_count": 97,
"attachment": {
"type": "image",
"thumbnail": "https://yt3.ggpht.com/FWom-9rv0BZidcGxR7anHlatqF4UiX1LX5JcAb8qCrqz9tydydeSMvyLf6YtTbcVIWQ2BEjTTBFZTQ=s2160-c-fcrop64=1,00000000ffffffff-rw-nd-v1"
}
},
{
"position": 2,
"post_id": "UgkxHz--7OUi8suwPWRCv34Bhsbv8EY4_q3Q",
"link": "https://www.youtube.com/post/UgkxHz--7OUi8suwPWRCv34Bhsbv8EY4_q3Q",
"author": {
"name": "Veritasium",
"link": "https://www.youtube.com/@veritasium",
"thumbnail": "https://yt3.googleusercontent.com/7vCbvtCqtjQ3YLgsJt7Y952MQV1sBvhllSCSxHP8_sVZdcPCBrITfhkN2RdyCuwPnsByq-1GoA=s76-c-k-c0x00ffffff-no-rj-mo"
},
"text": "Which of these methods have been used by researchers to make thin glass fibers? https://youtu.be/NiCgcUTL9_Q?si=WdAMu...",
"published_date": "9 days ago",
"votes": "921",
"extracted_votes": 921,
"comments_count": "78",
"extracted_comments_count": 78
}
]
}
],
...
}