YouTube Search Scraper - Videos & Shorts by Keyword avatar

YouTube Search Scraper - Videos & Shorts by Keyword

Pricing

from $0.25 / 1,000 video results

Go to Apify Store
YouTube Search Scraper - Videos & Shorts by Keyword

YouTube Search Scraper - Videos & Shorts by Keyword

Search YouTube for videos and Shorts by keyword, list a channel's videos, or load a video by URL. Each row includes title, description, channel, publish time, duration, views, likes when the watch page provides them, thumbnail, and rank.

Pricing

from $0.25 / 1,000 video results

Rating

0.0

(0)

Developer

Kathleen Luo

Kathleen Luo

Maintained by Community

Actor stats

0

Bookmarked

3

Total users

2

Monthly active users

14 days ago

Last modified

Features

Limited permissions

Share

Structured records for YouTube videos and Shorts: keyword search, a channel’s video list, or a specific video URL. Every row is one video, with the same fields, ready for spreadsheets, dashboards, and models.

Use it to see what YouTube returns for a query, pull a channel’s recent uploads, or enrich a list of video ids with title, description, channel, timing, duration, views, and likes.

Modes

ModeYou provideYou receive
searchOne or more keywords, plus type, upload date, duration, and sortVideos in YouTube’s order, up to maxResults per keyword. keyword and rank record which query found the row and where it sat.
videoWatch URL, Shorts URL, youtu.be link, or 11-character video idThe watch-page record: full description, channel, views, likes, calendar publish date, and duration.
channelChannel URL, @handle, or channel id (UC…)The videos tab. A URL that already ends in /shorts or /streams keeps that tab.

Search filters follow the results page:

InputValues
videoTypeany, video, shorts
uploadDateany, hour, today, week, month, year
durationany, under3 (under 3 minutes), min3to20 (3–20 minutes), over20
sortByrelevance, date (recently uploaded), views
countryTwo-letter location code. Default US. Relative times are in English.

enrichDetails opens the watch page for each search or channel row and fills likeCount, publishedAt, and the full description. With it off, search and channel rows still include title, channel, duration, view count, thumbnail, and the description snippet YouTube shows in results. mode: video always loads the watch page.

includeLlmText adds llmText, Markdown assembled from the title, channel, timing, counts, and description.

Fields

FieldTypeWhat it holds
typestringAlways video.
sourcestringsearch, video, or channel.
videoIdstring11-character YouTube id.
urlstringWatch URL, or a Shorts URL when isShort is true.
titlestringVideo title.
descriptionstring or emptyResults snippet, or the full description when the watch page was opened.
channelNamestring or emptyChannel name on the video.
channelIdstring or emptyChannel id (UC…).
channelUrlstring or emptyhttps://www.youtube.com/channel/UC… when the id is known.
publishedAtstring or emptyUTC time when the watch page shows a calendar date (2024-08-20T00:00:00Z).
publishedTextstring or emptyRelative label YouTube showed, such as 2y ago or 19 hours ago.
durationTextstring or emptyLength as displayed, such as 12:00:00 or 1:35.
durationSecondsinteger or emptyLength in seconds.
viewCountinteger or emptyView count. A live row’s “watching” number is left empty and isLive is true.
viewCountTextstring or emptyView label as shown, such as 13,384,635 views or 23M views.
likeCountinteger or emptyLike count from the watch page (mode: video or enrichDetails).
thumbnailUrlstring or emptyThumbnail image URL.
isShortbooleanTrue for a Short.
isLivebooleanTrue for a live or streamed row.
keywordstring or emptySearch keyword for this row. Empty in video and channel modes.
rankintegerPosition among the rows kept for that keyword or channel, starting at 1.
llmTextstring or emptyMarkdown of the title, channel, timing, counts, and description.
scrapedAtstringUTC time the row was written.

The same video can appear once per keyword. Inside one keyword or one channel, a repeated id keeps its first rank.

Input examples

Several keywords, default relevance order:

{
"mode": "search",
"keywords": ["python tutorial", "人工智能"],
"videoType": "any",
"uploadDate": "any",
"duration": "any",
"sortBy": "relevance",
"country": "US",
"maxResults": 50,
"enrichDetails": false,
"includeLlmText": true
}

Shorts for one topic:

{
"mode": "search",
"keywords": ["cooking"],
"videoType": "shorts",
"maxResults": 100
}

A channel’s videos tab:

{
"mode": "channel",
"channelUrls": ["https://www.youtube.com/@NASA"],
"maxResults": 30
}

Specific videos, including a Short:

{
"mode": "video",
"videoUrls": [
"https://www.youtube.com/watch?v=ix9cRaBkVe0",
"https://www.youtube.com/shorts/WqNMhSTCBGE"
]
}

maxResults applies per keyword, per channel, or to the video list. The form default is 20. Further samples are in examples/.

Output example

Search row for python tutorial (description snippet, likes filled only after a watch-page read):

{
"type": "video",
"source": "search",
"videoId": "ix9cRaBkVe0",
"url": "https://www.youtube.com/watch?v=ix9cRaBkVe0",
"title": "Python Full Course for free 🐍",
"description": "python #tutorial #beginners Python tutorial for beginners' full course 2024 *Learn Python in 1 HOUR* ...",
"channelName": "Bro Code",
"channelId": "UC4SVo0Ue36XCfOyb5Lh1viQ",
"channelUrl": "https://www.youtube.com/channel/UC4SVo0Ue36XCfOyb5Lh1viQ",
"publishedAt": null,
"publishedText": "2y ago",
"durationText": "12:00:00",
"durationSeconds": 43200,
"viewCount": 13384635,
"viewCountText": "13,384,635 views",
"likeCount": null,
"thumbnailUrl": "https://i.ytimg.com/vi/ix9cRaBkVe0/hq720.jpg",
"isShort": false,
"isLive": false,
"keyword": "python tutorial",
"rank": 1,
"llmText": "# Python Full Course for free 🐍\n\nURL: https://www.youtube.com/watch?v=ix9cRaBkVe0\nChannel: Bro Code (id UC4SVo0Ue36XCfOyb5Lh1viQ)\nPublished: 2y ago\nDuration: 12:00:00\nKeyword: python tutorial\nRank: 1\nStats: 13,384,635 views · n/a likes\n\n## Description\n\npython #tutorial #beginners Python tutorial for beginners' full course 2024 *Learn Python in 1 HOUR* ...\n",
"scrapedAt": "2026-11-08T18:00:00Z"
}

The same video opened in mode: video adds the calendar date, the like count, and the full description:

{
"source": "video",
"videoId": "ix9cRaBkVe0",
"publishedAt": "2024-08-20T00:00:00Z",
"publishedText": "2y ago",
"viewCount": 13384635,
"likeCount": 377158,
"durationText": "12:00:00",
"durationSeconds": 43200,
"description": "#python #tutorial #beginners\nPython tutorial for beginners' full course 2024\n…"
}

A Shorts search row uses a Shorts URL and isShort: true. A channel row sets source to channel and leaves keyword empty. Dataset views in the console are Overview, Stats, and LLM text.

Use cases

  • SEO and content research. Capture the videos YouTube ranks for a keyword, with title, channel, views, duration, and rank.
  • Trend monitoring. Repeat the same keywords and compare rank, viewCount, and publishedText over time.
  • Influencer discovery. Group rows by channelId to see which channels publish on a topic, including Shorts (isShort).
  • AI datasets. Keep llmText and description as document fields for classification, clustering, or retrieval.

Scheduling and integration

Save the input as a task and schedule it daily or weekly. A fixed maxResults keeps each run to a known number of rows per keyword or channel.

Start a run with the same JSON as the examples, through the Apify API, an Apify client, or an integration step. When the run succeeds, read the default dataset. The Actor output videos points at that dataset’s items. Export JSON, CSV, Excel, or XML from the dataset, or attach a webhook to the task so the next system picks up new rows.

For a model pipeline, map llmText to the document body and keep videoId, url, keyword, and rank as metadata. Join later runs on videoId plus keyword to track how a result moves.

中文简介

按关键词搜索 YouTube 视频和 Shorts,列出频道视频,或按视频链接读取详情。每条结果字段相同:视频 id、链接、标题、简介、频道名、频道 id、频道链接、发布时间、时长、播放量、点赞(打开视频页时)、封面、是否 Short、关键词和排名。可选 llmText 为标题、频道、数据和简介组成的 Markdown。

适合选题研究、趋势跟踪、按主题找频道,以及整理给模型使用的视频数据。输入示例见上文 JSON。

Run locally

pip install -r requirements.txt
python -m src

With no input file, the run searches python tutorial and writes up to 20 videos to storage/datasets/default/. To pass input, write storage/key_value_stores/default/INPUT.json using a file from examples/.

Field notes for developers are in DEVELOPMENT.md.