- Overview
- 1. YouTube Search
- 2. YouTube Video Search
- 3. YouTube Channel Search
- 4. YouTube Shorts Search
- 5. YouTube Video Details
- 6. YouTube Video Comments
- 7. YouTube Video Reply Comments
- Authentication
- Errors and limits
Other Documentation
Resources
YouTube Data API Documentation
API Base URL
https://api.cognifyapi.comAuthentication header: x-cognifyapi-key
API key: YOUR_COGNIFY_API_KEY
Overview
Search YouTube videos, channels, and Shorts, and retrieve video and comment details.
All requests use HTTPS and require the x-cognifyapi-key header. Replace the placeholder with your key from the CognifyAPI Studio. For interactive examples, visit the interactive YouTube Data API page.
1. YouTube Search
Search YouTube content for a query.
Query parameters
| Parameter | Example value |
|---|---|
query | Mr Beast |
Request example
curl --request GET \
--url 'https://api.cognifyapi.com/youtube-search?query=Mr%20Beast' \
--header 'x-cognifyapi-key: YOUR_COGNIFY_API_KEY'Response Example
{
"status": "success",
"query": "Mr Beast",
"data": {
"channels": [],
"videos": [
{
"videoId": "Af6i6ChAVTw",
"title": "Last To Leave Mansion, Keeps It",
"author": "MrBeast",
"published": "3 months ago",
"duration": "57:51",
"viewCount": "142,280,353 views",
"viewCountSimple": "142 million views",
"url": "https://www.youtube.com/watch?v=Af6i6ChAVTw",
"thumbnail": [
{
"url": "https://i.ytimg.com/vi/Af6i6ChAVTw/hq720_custom_1.jpg?sqp=CITg-tcG-oaymwEcCOgCEMoBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLA9EgvdiUtXIAQrpvIra7-d-zSF7A",
"width": 360,
"height": 202
}
],
"summary": "Participants who criticized MrBeast's challenges compete in a high-stakes mansion challenge. [Shortened]",
"channelAvatar": "https://yt3.ggpht.com/nxYrc_1_2f77DoBadyxMTmv7ZpRZapHR5jbuYe7PlPd5cIRJxtNNEYyOC0ZsxaDyJJzXrnJiuDE=s68-c-k-c0x00ffffff-no-rj",
"isVerified": true
},
{
"videoId": "Qtl8lJwbd4g",
"title": "Escape 100 Cops, Win $500,000",
"author": "MrBeast",
"published": "2 months ago",
"duration": "20:29",
"viewCount": "130,662,740 views",
"viewCountSimple": "130 million views",
"url": "https://www.youtube.com/watch?v=Qtl8lJwbd4g",
"thumbnail": [
{
"url": "https://i.ytimg.com/vi/Qtl8lJwbd4g/hq720_custom_1.jpg?sqp=CITg-tcG-oaymwEcCOgCEMoBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLCyaxgw7yW1YjfH8Lcy-gUL4rfUIQ",
"width": 360,
"height": 202
}
],
"summary": "MrBeast and four friends try to evade a professional police force during a high-stakes chase. [Shortened]",
"channelAvatar": "https://yt3.ggpht.com/nxYrc_1_2f77DoBadyxMTmv7ZpRZapHR5jbuYe7PlPd5cIRJxtNNEYyOC0ZsxaDyJJzXrnJiuDE=s68-c-k-c0x00ffffff-no-rj",
"isVerified": true
}
],
"horizontaVideos": [],
"shortsVideos": [
[
{
"videoId": "sHpEqeSByPI",
"title": "Unboxing The World’s Largest Toy",
"views": "25M views",
"accessibility": "Unboxing The World’s Largest Toy, 25 million views - play Short",
"thumbnail": "https://i.ytimg.com/vi/sHpEqeSByPI/sardefault.jpg?sqp=-oaymwEdCJUDENAFSFWQAgHyq4qpAw4IARUAAIhCcAHAAQY=&rs=AOn4CLB2V7YWBrDdLVa4cnMdEBvQYu00hA",
"url": "https://www.youtube.com/shorts/sHpEqeSByPI"
},
{
"videoId": "kPI9Mc35mOg",
"title": "Trap Door Roulette",
"views": "108M views",
"accessibility": "Trap Door Roulette, 108 million views - play Short",
"thumbnail": "https://i.ytimg.com/vi/kPI9Mc35mOg/sardefault.jpg?sqp=-oaymwEdCJUDENAFSFWQAgHyq4qpAw4IARUAAIhCcAHAAQY=&rs=AOn4CLCFqW_X3pokjvblVc71mCamXfPyhQ",
"url": "https://www.youtube.com/shorts/kPI9Mc35mOg"
}
]
]
}
}2. YouTube Video Search
Search for YouTube videos.
Query parameters
| Parameter | Example value |
|---|---|
query | Mr Beast |
Request example
curl --request GET \
--url 'https://api.cognifyapi.com/youtube-video-search?query=Mr%20Beast' \
--header 'x-cognifyapi-key: YOUR_COGNIFY_API_KEY'Response Example
{
"status": "success",
"query": "Mr Beast",
"data": {
"videos": [
{
"videoId": "Af6i6ChAVTw",
"title": "Last To Leave Mansion, Keeps It",
"author": "MrBeast",
"published": "3 months ago",
"duration": "57:51",
"viewCount": "142,281,032 views",
"viewCountSimple": "142 million views",
"url": "https://www.youtube.com/watch?v=Af6i6ChAVTw",
"thumbnail": [
{
"url": "https://i.ytimg.com/vi/Af6i6ChAVTw/hq720_custom_1.jpg?sqp=CLDi-tcG-oaymwEcCOgCEMoBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLDPHXbj5n0m-ny-5qWgCj7qbfJfkg",
"width": 360,
"height": 202
}
],
"summary": "Participants who criticized MrBeast's challenges compete in a high-stakes mansion challenge. [Shortened]",
"channelAvatar": "https://yt3.ggpht.com/nxYrc_1_2f77DoBadyxMTmv7ZpRZapHR5jbuYe7PlPd5cIRJxtNNEYyOC0ZsxaDyJJzXrnJiuDE=s68-c-k-c0x00ffffff-no-rj",
"isVerified": true
},
{
"videoId": "9kmw3mImC8E",
"title": "I Opened A Theme Park",
"author": "MrBeast 2",
"published": "11 months ago",
"duration": "5:43",
"viewCount": "45,867,584 views",
"viewCountSimple": "45 million views",
"url": "https://www.youtube.com/watch?v=9kmw3mImC8E",
"thumbnail": [
{
"url": "https://i.ytimg.com/vi/9kmw3mImC8E/hq720.jpg?sqp=-oaymwEcCOgCEMoBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLBhuzcKn2mhh-RhXBAirMageCKKXQ",
"width": 360,
"height": 202
}
],
"summary": "MrBeast opens a game-filled theme park based on popular challenges. [Shortened]",
"channelAvatar": "https://yt3.ggpht.com/Jd7IA_TOGrW-oXKgX-m5CBJB0tqMemQ-zhZZYmCJxF4w06dcNREG89dHbR_GGLra1TzSJqoKjFM=s68-c-k-c0x00ffffff-no-rj",
"isVerified": true
}
],
"horizontaVideos": []
}
}3. YouTube Channel Search
Search for YouTube channels.
Query parameters
| Parameter | Example value |
|---|---|
query | Mr Beast |
Request example
curl --request GET \
--url 'https://api.cognifyapi.com/youtube-channel-search?query=Mr%20Beast' \
--header 'x-cognifyapi-key: YOUR_COGNIFY_API_KEY'Response Example
{
"status": "success",
"query": "Mr Beast",
"data": {
"channel": [
{
"channelId": "UCX6OQ3DkcsbYNE6H8uQQuVA",
"title": "MrBeast",
"thumbnail": [
{
"url": "//yt3.ggpht.com/nxYrc_1_2f77DoBadyxMTmv7ZpRZapHR5jbuYe7PlPd5cIRJxtNNEYyOC0ZsxaDyJJzXrnJiuDE=s88-c-k-c0x00ffffff-no-rj-mo",
"width": 88,
"height": 88
}
],
"description": "SUBSCRIBE FOR A COOKIE! New MrBeast or MrBeast Gaming video every single Saturday at noon eastern time!",
"subscribers": "527M subscribers",
"handle": "@MrBeast",
"isVerified": true
}
]
}
}4. YouTube Shorts Search
Search for YouTube Shorts.
Query parameters
| Parameter | Example value |
|---|---|
query | Mr Beast |
Request example
curl --request GET \
--url 'https://api.cognifyapi.com/youtube-shorts-search?query=Mr%20Beast' \
--header 'x-cognifyapi-key: YOUR_COGNIFY_API_KEY'Response Example
{
"status": "success",
"query": "Mr Beast",
"data": {
"shorts": [
[
{
"videoId": "sHpEqeSByPI",
"title": "Unboxing The World’s Largest Toy",
"views": "25M views",
"accessibility": "Unboxing The World’s Largest Toy, 25 million views - play Short",
"thumbnail": "https://i.ytimg.com/vi/sHpEqeSByPI/sardefault.jpg?sqp=-oaymwEdCJUDENAFSFWQAgHyq4qpAwwIARUAAIhCcAHAAQY=&rs=AOn4CLB2V7YWBrDdLVa4cnMdEBvQYu00hA",
"url": "https://www.youtube.com/shorts/sHpEqeSByPI"
},
{
"videoId": "kPI9Mc35mOg",
"title": "Trap Door Roulette",
"views": "108M views",
"accessibility": "Trap Door Roulette, 108 million views - play Short",
"thumbnail": "https://i.ytimg.com/vi/kPI9Mc35mOg/sardefault.jpg?sqp=-oaymwEdCJUDENAFSFWQAgHyq4qpAwwIARUAAIhCcAHAAQY=&rs=AOn4CLCFqW_X3pokjvblVc71mCamXfPyhQ",
"url": "https://www.youtube.com/shorts/kPI9Mc35mOg"
}
]
]
}
}5. YouTube Video Details
Retrieve metadata for a video ID.
Query parameters
| Parameter | Example value |
|---|---|
videoId | Af6i6ChAVTw |
Request example
curl --request GET \
--url 'https://api.cognifyapi.com/youtube-video-details?videoId=Af6i6ChAVTw' \
--header 'x-cognifyapi-key: YOUR_COGNIFY_API_KEY'Response Example
{
"status": "success",
"query": {
"videoId": "Af6i6ChAVTw"
},
"data": {
"id": "Af6i6ChAVTw",
"title": "Last To Leave Mansion, Keeps It",
"author": "MrBeast",
"channelId": "UCX6OQ3DkcsbYNE6H8uQQuVA",
"profileUrl": "http://www.youtube.com/@MrBeast",
"category": "Entertainment",
"description": "MrBeast's mansion challenge video with promotional and channel information. [Shortened]",
"keywords": [],
"canonicalUrl": "https://www.youtube.com/watch?v=Af6i6ChAVTw",
"thumbnail": "https://i.ytimg.com/vi/Af6i6ChAVTw/maxresdefault.jpg",
"embedUrl": "https://www.youtube.com/embed/Af6i6ChAVTw",
"views": "142281032",
"likes": "2508529",
"durationSeconds": "3471",
"publishDate": "2026-08-08T09:00:01-07:00",
"uploadDate": "2026-08-08T09:00:01-07:00"
}
}6. YouTube Video Comments
Retrieve comments for a video ID.
Query parameters
| Parameter | Example value |
|---|---|
videoId | Af6i6ChAVTw |
Request example
curl --request GET \
--url 'https://api.cognifyapi.com/youtube-video-comments?videoId=Af6i6ChAVTw' \
--header 'x-cognifyapi-key: YOUR_COGNIFY_API_KEY'Response Example
{
"status": "success",
"query": {
"videoId": "Af6i6ChAVTw"
},
"result": 20,
"commentData": [
{
"key": "EhpVZ3pDUThLWnAxZVA4QWhnSEdsNEFhQUJBZyAoKAE%3D",
"properties": {
"commentId": "UgzCQ8KZp1eP8AhgHGl4AaABAg",
"likeCount": "69K likes",
"replyCount": "1.1K replies",
"publishedTime": "3 months ago",
"content": {
"content": "what's the first thing you'd do if you won a mansion?"
},
"avatar": {
"image": {
"sources": []
}
}
},
"commentAuthor": {
"channelId": "UCX6OQ3DkcsbYNE6H8uQQuVA",
"displayName": "@MrBeast",
"avatarThumbnailUrl": "https://yt3.ggpht.com/nxYrc_1_2f77DoBadyxMTmv7ZpRZapHR5jbuYe7PlPd5cIRJxtNNEYyOC0ZsxaDyJJzXrnJiuDE=s88-c-k-c0x00ffffff-no-rj",
"isVerified": true,
"isCurrentUser": false,
"isCreator": true,
"isArtist": false
}
},
{
"key": "EhpVZ3p4OWJzaG1qS2lTVU16dndoNEFhQUJBZyAoKAE%3D",
"properties": {
"commentId": "Ugzx9bshmjKiSUMzvwh4AaABAg",
"likeCount": "16K likes",
"replyCount": "27 replies",
"publishedTime": "1 month ago",
"content": {
"content": "in 2 minutes of this video i understand why receiving education is a good thing"
},
"avatar": {
"image": {
"sources": []
}
}
},
"commentAuthor": {
"channelId": "UCPSgY7wJHkNnd_-NkBeeL4Q",
"displayName": "@iamdanteking",
"avatarThumbnailUrl": "https://yt3.ggpht.com/ikT9yIT5kO6cPue8e_Sb6szx84hGyoe0RV6C-ja8w-u148iQGMb49yiiOC00t1BFkATZ2to8=s88-c-k-c0x00ffffff-no-rj",
"isVerified": false,
"isCurrentUser": false,
"isCreator": false,
"isArtist": false
}
}
]
}7. YouTube Video Reply Comments
Retrieve replies for a comment on a video.
Query parameters
| Parameter | Example value |
|---|---|
videoId | Af6i6ChAVTw |
commentKey | EhpVZ3pDUThLWnAxZVA4QWhnSEdsNEFhQUJBZyAoKAE= |
Request example
curl --request GET \
--url 'https://api.cognifyapi.com/youtube-video-reply-comments?videoId=Af6i6ChAVTw&commentKey=EhpVZ3pDUThLWnAxZVA4QWhnSEdsNEFhQUJBZyAoKAE%3D' \
--header 'x-cognifyapi-key: YOUR_COGNIFY_API_KEY'Response Example
{
"status": "success",
"videoId": "Af6i6ChAVTw",
"data": [
{
"key": "EjFVZ3pDUThLWnAxZVA4QWhnSEdsNEFhQUJBZy5BX0ZrN2hpdUNBZkFfRmtQb1hsVjNtICgoAQ%3D%3D",
"properties": {
"commentId": "UgzCQ8KZp1eP8AhgHGl4AaABAg.A_Fk7hiuCAfA_FkPoXlV3m",
"likeCount": "95 likes",
"replyCount": "0 replies",
"publishedTime": "3 months ago",
"content": {
"content": "good job."
},
"avatar": {
"image": {
"sources": []
}
}
},
"commentAuthor": {
"channelId": "UCTG2UUBoUwy-MyC98SOPAcA",
"displayName": "@finnatep",
"avatarThumbnailUrl": "https://yt3.ggpht.com/SCp5RP4kb6V7hCVX8ZfHNOTVdTF89C8Xyh9YzQAhjr8ik3NiPwy6AjRnfUBwgLwISL6V299GPw=s88-c-k-c0x00ffffff-no-rj",
"isVerified": false,
"isCurrentUser": false,
"isCreator": false,
"isArtist": false
}
},
{
"key": "EjFVZ3pDUThLWnAxZVA4QWhnSEdsNEFhQUJBZy5BX0ZrN2hpdUNBZkFfRmtSOXRTWmRPICgoAQ%3D%3D",
"properties": {
"commentId": "UgzCQ8KZp1eP8AhgHGl4AaABAg.A_Fk7hiuCAfA_FkR9tSZdO",
"likeCount": "1.3K likes",
"replyCount": "2 replies",
"publishedTime": "3 months ago (edited)",
"content": {
"content": "Probably eat it"
},
"avatar": {
"image": {
"sources": []
}
}
},
"commentAuthor": {
"channelId": "UCMaPeugVJl1v3lIIVVRrtSA",
"displayName": "@SeanPulera",
"avatarThumbnailUrl": "https://yt3.ggpht.com/i-P2KxeZh557ChG0PFGSRGEUf_BLcQg9ZX-qZNTIYldjCBBljoZ8mxOP_jJoI3BlVvBmDxPzjA=s88-c-k-c0x00ffffff-no-rj",
"isVerified": false,
"isCurrentUser": false,
"isCreator": false,
"isArtist": false
}
}
]
}Authentication
Include your API key in every request using the x-cognifyapi-key request header.
Errors and limits
Check the HTTP status and response body when a request fails. Invalid parameters can return a 400 response; exceeding your plan's rate limit can return 429. Review your plan and usage in CognifyAPI Studio.