YouTube Search API
Search YouTube programmatically and get structured, ranked results.
GET request to /v1/youtube/search that responds with clean JSON and costs 2 credits. Pass cache=true for a free 24h cache hit; default is always fresh. Start with 100 free credits — no credit card.What is the YouTube Search API?
The YouTube Search API lets you search and return matching results for YouTube search with a single REST call. No OAuth, no infrastructure to maintain, and no platform SDKs — send the request, get clean structured JSON back. Pass cache=true to serve from the 24h shared cache (0 credits on hit); default is always fresh.
What you get
- Ranked, structured result list
- Title, URL, author, and thumbnail per result when available
- Engagement metrics where the platform exposes them
- Configurable result limit
Try it
Fill in the parameters below and copy a ready-to-run request, or open the live Playground to run it against your account (no API key paste).
Parameters
curl "https://api.captapi.com/v1/youtube/search?q=space" \
-H "Authorization: Bearer capt_live_..."
# or: -H "x-api-key: capt_live_..."Edit the parameters and the code updates instantly. Switch languages and hit copy.
Example response
{
"success": true,
"data": {
"query": "space",
"totalReturned": 5,
"results": [
{
"url": "https://www.youtube.com/watch?v=KvrxcrlG6Mo",
"title": "SpaceX set to attempt starship rocket launch in South Texas",
"publishedAt": "5 days ago",
"viewCount": 41084,
"durationSeconds": 35,
"thumbnailUrl": "https://i.ytimg.com/vi/KvrxcrlG6Mo/hqdefault.jpg?sqp=-oaymwEcCOADEI4CSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLBvGaxl9zxxMlI9UvgXerbpjUI0pg",
"channelName": "WFAA"
},
{
"url": "https://www.youtube.com/watch?v=kBHfGJ76GlY",
"title": "SpaceX is learning as much as it can about rocket updates in test launch: Former SpaceX engineer",
"publishedAt": "5 days ago",
"viewCount": 17838,
"durationSeconds": 210,
"thumbnailUrl": "https://i.ytimg.com/vi/kBHfGJ76GlY/hq720.jpg?sqp=-oaymwEcCNAFEJQDSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLC1mzXfCTVM5XmdCSHQnrpdqEbbFA",
"channelName": "CNBC Television"
},
{
"url": "https://www.youtube.com/watch?v=gYCmoZCSqkI",
"title": "The Most Disturbing Events in Space",
"publishedAt": "5 months ago",
"viewCount": 1891769,
"durationSeconds": 1254,
"thumbnailUrl": "https://i.ytimg.com/vi/gYCmoZCSqkI/hq720.jpg?sqp=-oaymwEcCNAFEJQDSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLAeIltRB8k6SADrQC5wKX6UQSOiPg",
"channelName": "The Paint Explainer"
},
{
"url": "https://www.youtube.com/watch?v=SvwfkTmyHFU",
"title": "Why Space Is Genuinely Terrifying",
"publishedAt": "6 months ago",
"viewCount": 3019696,
"durationSeconds": 2298,
"thumbnailUrl": "https://i.ytimg.com/vi/SvwfkTmyHFU/hq720.jpg?sqp=-oaymwEcCNAFEJQDSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLDlvwzdnNDl-ZwXafY3GMI18oDXWA",
"channelName": "Joe Bart Philosophy"
},
{
"url": "https://www.youtube.com/watch?v=UiZRQBOs4Sk",
"title": "Undeniable proof that humans walked on the moon (six times) #space #astronomy #science #nasa",
"publishedAt": "8 days ago",
"viewCount": 283980,
"durationSeconds": 94,
"thumbnailUrl": "https://i.ytimg.com/vi/UiZRQBOs4Sk/hq720.jpg?sqp=-oaymwE2CNAFEJQDSFXyq4qpAygIARUAAIhCGABwAcABBvABAfgBtgiAAoAPigIMCAAQARhjIGMoYzAP&rs=AOn4CLBl05WqCDjAc9UuFJnRaEs94ADrRw",
"channelName": "ASTRO ALEXANDRA"
}
]
}
}Billing metadata is returned in response headers: X-Captapi-Credits (credits charged), X-Captapi-Cache (hit or miss), and X-Captapi-Source. Failed requests (4xx/5xx) are never charged. See the full list of error codes in the error reference.
Response structure
A successful call returns success, cached, creditsUsed, and a data object with the following fields:
Top-level fields
queryThe search query you sent.totalReturnedNumber of items returned in this response.
Results
Each item in results contains:
urlCanonical URL of the item.titleTitle of the item.publishedAtPublish date (ISO 8601).viewCountView count.durationSecondsLength in seconds.thumbnailUrlThumbnail image URL.channelNameName of the channel.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| q | string | Yes | Search query or keywords (min 2 characters). |
| limit | integer | No | Max items to return (default 20, max 200). Billed per result. |
| cache | boolean | No | Set true to serve from the 24h response cache. Default false — always fetch fresh data. |
Authentication: send your key as Authorization: Bearer capt_live_.... A typical call costs 2 credits. Pass cache=true for a free 24h cache hit; default is always fresh.
How it works
- 1. Sign up — get 100 free credits, no card required.
- 2. Create a key from your dashboard.
- 3. Send one request to
/v1/youtube/searchand parse the JSON response.
Use cases
Trend Discovery
Find trending content by keyword or hashtag.
Content Sourcing
Build feeds and playlists programmatically.
Monitoring
Track topics, brands, and competitors.
Research
Sample large sets of content for analysis.
Frequently asked questions
What does the YouTube Search API do?+
The YouTube Search API lets you search and return matching results from a public YouTube query using one GET request to /v1/youtube/search. It returns clean JSON — no OAuth or infrastructure setup required.
How many credits does the YouTube Search API cost?+
Each successful call costs 2 credits. Pass cache=true to serve from the 24h shared cache (0 credits on hit); default is always fresh. Failed or empty results are never charged.
Do I need a YouTube API key or OAuth?+
No. A single Captapi key works across every platform Captapi supports — YouTube, TikTok, Instagram, Facebook, Twitter/X, Reddit, Threads, Bluesky, Pinterest, LinkedIn, Rumble, Spotify, Kwai, and more. We handle proxies, rate limits, retries, and authentication for you.
Is the YouTube Search API suitable for production use?+
Yes. It is a stable REST endpoint with predictable JSON and automatic retries. Pass cache=true to serve from the 24h shared cache (0 credits on hit); default is always fresh. Use it for analytics, monitoring, and content automation.
More YouTube APIs
Ready to use the YouTube Search API?
Sign up, grab your key, and make your first call in 60 seconds.