Search YouTube
Search for videos or channels with rich metadata.
The Search endpoint runs a query against YouTube and returns either video or channel results in a single JSON envelope. Authenticate with Authorization: Bearer YOUR_API_KEY. Each successful 200 response charges 1 credit; 4xx errors, 5xx errors, and 429 rate-limits never debit. Set type=video for videos with videoId, channelTitle, lengthText, and hasCaptions; set type=channel for channels with channelId, handle, and subscriberCount. Limit is 1–50 per call.
GET/api/v2/youtube/search1 credit
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| qreq | string | — | Search query, 1–200 characters. |
| type | string | video | Either video or channel. |
| limit | integer | 20 | Max results (1–50). |
Example — video search
bash
curl -X GET "https://youtubetranscriptapi.com/api/v2/youtube/search?q=python+tutorial&type=video&limit=10" \
-H "Authorization: Bearer YOUR_API_KEY"json
{
"results": [
{
"type": "video",
"videoId": "dQw4w9WgXcQ",
"title": "Rick Astley - Never Gonna Give You Up",
"channelId": "UCuAXFkgsw1L7xaCfnd5JJOw",
"channelTitle": "Rick Astley",
"channelHandle": "@RickAstley",
"channelVerified": true,
"lengthText": "3:33",
"viewCountText": "1.5B views",
"publishedTimeText": "14 years ago",
"hasCaptions": true,
"thumbnails": [
{ "url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/default.jpg", "width": 120, "height": 90 }
]
}
],
"result_count": 20
}Example — channel search
bash
curl -X GET "https://youtubetranscriptapi.com/api/v2/youtube/search?q=ted+talks&type=channel&limit=5" \
-H "Authorization: Bearer YOUR_API_KEY"json
{
"results": [
{
"type": "channel",
"channelId": "UCAuUUnT6oDeKwE6v1NGQxug",
"title": "TED",
"handle": "@TED",
"url": "https://www.youtube.com/@TED",
"description": "Official channel...",
"subscriberCount": "26M subscribers",
"verified": true,
"rssUrl": "https://www.youtube.com/feeds/videos.xml?channel_id=UCAuUUnT6oDeKwE6v1NGQxug",
"thumbnails": []
}
],
"result_count": 5
}