Search
YouTube Search API
Search YouTube and get structured results with view counts, durations, and thumbnails, filtered exactly how you need them.
Send a query and get back structured results for videos, Shorts, channels, playlists, and movies. Each result includes the title, author, view count as an integer, publish date in ISO 8601, duration in seconds, and thumbnails at two sizes.
Filter by type, duration, upload date, and sort order. Feature filters cover 4K, HDR, subtitles, live streams, and Creative Commons. Results page with continuation tokens, and top video hits are pre-warmed in cache.
Endpoint
POST https://api.stophy.dev/v1/search
1curl -X POST https://api.stophy.dev/v1/search \2 -H "Authorization: Bearer $STOPHY_API_KEY" \3 -H "Content-Type: application/json" \4 -d '{"q":"typescript tutorial","type":"video","sortBy":"popularity"}'1{2 "query": { "q": "typescript tutorial", "type": "video", "sortBy": "popularity" },3 "items": [4 {5 "type": "video",6 "id": "YkOSUVzOAA4",7 "videoUrl": "https://youtube.com/watch?v=YkOSUVzOAA4",8 "title": "T3 Stack Tutorial - FROM 0 TO PROD FOR $0",9 "author": "Theo - t3.gg",10 "viewCount": 537700,11 "viewCountText": "537.7K views",12 "duration": "2:59:03",13 "durationSec": 10743,14 "publishedAt": "2022-11-04T00:00:00Z",15 "publishedAtText": "3 years ago",16 "isLive": false17 }18 ],19 "continuationToken": "EpgD..."20}What you can do
Filters that cover everything
Type, sort order, upload date, duration, and feature filters including 4K, HDR, subtitles, Creative Commons, and live, all in one request.
Structured results
View count as an integer, ISO 8601 publish date, duration in seconds, and thumbnails at two sizes on every result.
Deep pagination
Continuation tokens let you go well past the first page for broad sweeps across a topic.
Common use cases
- Find relevant videos before fetching their transcripts or comments
- Discover Creative Commons content your agent can freely reference
- Monitor a keyword for new uploads over time
- Build a ranked list of the most-viewed videos on any subject
Frequently asked questions
- What filters does the search endpoint support?
- Type (video, short, channel, playlist, movie), sort order (relevance, popularity, date, rating), upload date (today, week, month, year), duration (short, medium, long), and feature flags: live, 4K, HD, subtitles, Creative Commons, 360, VR180, 3D, HDR, and location.
- Does it return Shorts separately from regular videos?
- Yes. Set type to short to return only YouTube Shorts. Set it to video for long-form content only. Both types share the same result shape.
- How do I get more than one page of results?
- Pass the continuationToken from each response back in the next request with the same query to keep fetching results.