Search videos
One page of a YouTube search, about 20 videos in the order youtube.com shows them, each with its channel, views, duration, date, badges, chapters and thumbnails.
youtube/videos/search1 credit a callv1.0.1When to use it
You need the videos YouTube finds for some words, as its search shows them to a visitor: their title, channel, views, duration, when they were published, whether they are live, upcoming or shorts, their badges (4K, CC, New), the chapters the result shows (the one matching the words marked), YouTube's AI summary of the video when the result shows one, and their thumbnails. Filter as the search's panel does: by type (videos or shorts), upload date (today to this year), duration and features (live, 4K, HD, subtitles, Creative Commons, 360°, VR180, 3D, HDR, location, purchased); sort by relevance or popularity. Ask in another language and country (language, country) for what YouTube shows there. A result's position is its rank in the search, across pages. Follow next for the following page. For one video whole (its description, likes, tags), use youtube/videos/get; for a channel's own videos, youtube/videos/list; for channels by name, youtube/channels/search.
Try it
The options on the left write the call; the answer on the right is the contract's example. With your API key, the same call returns live data.
curl https://api.lobstr.io/v2/run \ -H "Authorization: Bearer $LOBSTR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "source": "youtube", "operation": "videos/search", "options": { "query": "n8n tutorial", "upload_date": "this_month", "duration": "over_20_minutes" } }'
An example answer. Run it on your own input.
{ "object": "run", "id": "run_4rsl3cx4t6t25g5ngbm5ssccua", "livemode": true, "source": "youtube", "operation": "videos/search", "version": "1.0.1", "schema_url": "https://api.lobstr.io/v2/catalog/youtube/videos/search", "options": { "query": "n8n tutorial", "upload_date": "this_month", "duration": "over_20_minutes" }, "fields": null, "status": "succeeded", "count": 1, "has_more": false, "next": null, "cost": { "credits": 1 }, "results": [ { "object": "video", "position": 1, "id": "n8nTutor1al", "ids": { "video_id": "n8nTutor1al", "channel_id": "UCa1b2c3d4e5f6g7h8i9j0kL" }, "url": "https://www.youtube.com/watch?v=n8nTutor1al", "title": "n8n Tutorial for Beginners: Build Your First Workflow", "description_snippet": "Learn n8n from scratch and build your first automation in under an hour ...", "duration_seconds": 2843, "duration_text": "47:23", "views": 18342, "watching": null, "published_text": "2 weeks ago", "is_live": false, "is_upcoming": false, "scheduled_at": null, "is_short": false, "badges": [ "4K", "CC" ], "channel": { "id": "UCa1b2c3d4e5f6g7h8i9j0kL", "title": "Automation Academy", "handle": "@automationacademy", "url": "https://www.youtube.com/@automationacademy", "is_verified": true, "is_artist": false, "thumbnails": [ { "url": "https://yt3.ggpht.com/automation-academy=s68-c-k-c0x00ffffff-no-rj", "width": 68, "height": 68 } ] }, "collaborators": [], "chapters": [ { "title": "Introduction", "start_seconds": 0, "time_text": "0:00", "is_match": false, "thumbnails": [ { "url": "https://i.ytimg.com/vi/n8nTutor1al/hqdefault_0.jpg", "width": 336, "height": 188 } ] }, { "title": "Your first trigger", "start_seconds": 312, "time_text": "5:12", "is_match": true, "thumbnails": [ { "url": "https://i.ytimg.com/vi/n8nTutor1al/hqdefault_312000.jpg", "width": 336, "height": 188 } ] } ], "ai_summary": null, "thumbnails": [ { "url": "https://i.ytimg.com/vi/n8nTutor1al/hq720.jpg", "width": 360, "height": 202 }, { "url": "https://i.ytimg.com/vi/n8nTutor1al/hq720.jpg", "width": 720, "height": 404 } ], "moving_thumbnail": { "url": "https://i.ytimg.com/an_webp/n8nTutor1al/mqdefault_6s.webp", "width": 320, "height": 180 }, "source_url": "https://www.youtube.com/results?search_query=n8n+tutorial&sp=EgQIBBgC", "observed_at": "2026-12-03T12:00:00Z" } ] }
Options
querystringrequiredtype"all" | "videos" | "shorts"Default allis_short); videos, videos only; shorts, shorts only. Channels are searched with youtube/channels/search.upload_date"any" | "today" | "this_week" | "this_month" | "this_year"Default anyduration"any" | "under_3_minutes" | "3_to_20_minutes" | "over_20_minutes"Default anyfeaturesstring[]sort"relevance" | "popularity"Default relevanceupload_date.languagestringDefault encountrystringDefault UScursorstringnext in an answer, as it is: opaque, and only for the search it was given with (otherwise invalid_cursor).Record
Each record of results, in the envelope every call returns (Run an operation).
objectstringpositionintegeridstringids.video_idstringids.channel_idstringurlstringtitlestringdescription_snippetstringduration_secondsintegerduration_textstringviewsintegerwatching. A short of a shorts search answered as a grid has them rounded ("52K views" is 52000).watchingintegerpublished_textstringlanguage ("11 months ago", "Streamed 2 days ago"); null for a live in progress. A short of a shorts search answered as a grid says it shorter ("19h ago").is_livebooleanis_upcomingbooleanscheduled_atdateis_shortbooleanbadgeslistlanguage: two at most (03/12), so a video filtered by subtitles can show "New" and "4K" without "CC".channel.idstringchannel.titlestringchannel.handlestringchannel.urlstringchannel.is_verifiedbooleanchannel.is_artistbooleanchannel.thumbnailslistcollaboratorslistchapterslistai_summary, not both.ai_summarystringthumbnailslistmoving_thumbnailstringsource_urlstringobserved_atdateErrors
Its own, besides those of every call (Errors). A failed call is free.
| Code | Status | What it means |
|---|---|---|
ip_blocked | 503 | YouTube slowed down the IPs the call tried (429). Retry in a minute; failed calls are free. Retryable. |
invalid_input | 422 | Pass the words to search for, and the filters as the search's panel offers them: a type, an upload date, a duration, features, an order, a language (en) and a country (US). |
site_unavailable | 503 | YouTube did not answer properly; retry later (not charged). Retryable. |
unexpected_answer | 424 | YouTube answered in a shape we do not read yet; we are told and fix it (not charged). |
Price
1 credit a call, one page of about 20 videos. An empty page and a failed call are free. What a credit costs on each plan: Credits and pricing.
Changelog
1.0.12026-12-03type: shorts) gave empty pages when YouTube answered it as a grid of shorts, 25 a page, one of its two layouts that day: the grid's shorts are now the results, each with its title, views (rounded), age, badge and thumbnails, without its channel or duration, which the grid does not show (youtube/videos/get has them).1.0.02026-12-03