Youtube Search Scraper avatar

Youtube Search Scraper

Pricing

$3.99/month + usage

Go to Apify Store
Youtube Search Scraper

Youtube Search Scraper

This YouTube Search Scraper extracts video results based on a dynamic user search query. It collects video title, URL, channel name, views, upload time, duration, thumbnail, and more. Supports result limits and saves structured data in JSON format for analysis and research purposes.

Pricing

$3.99/month + usage

Rating

5.0

(4)

Developer

ScrapeAI

ScrapeAI

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

3 days ago

Last modified

Share

This actor scrapes YouTube search results based on a user-provided search query.


Features

  • Dynamic search query input
  • Automatically constructs YouTube search URL
  • Scrapes video metadata from search results
  • Supports max result limit
  • Infinite scroll to load more results
  • Outputs structured JSON dataset

Input

{
"search_query": "cocomelon",
"max_results": 20,
"debugMode": false
}

Input Fields

FieldTypeRequiredDescription
search_querystring✅ YesKeyword to search on YouTube
max_resultsintegerNo (default: 20)Maximum number of videos to scrape
debugModebooleanNo (default: false)Save debug screenshots and verbose logs

How It Works

  1. Accepts search_query from user input
  2. Constructs search URL: https://www.youtube.com/results?search_query={{search_query}}
  3. Opens YouTube search results page with Puppeteer
  4. Scrolls the page to load more results
  5. Extracts video metadata from all loaded video cards

Note: By default Actor.pushData(data) writes to the default dataset (local path storage/datasets/default/). Opening a named dataset such as the former if you want all results in the default dataset; the latter if you need a dedicated dataset with its own view schema.

Example Record

{
"id": "xxxxxxx",
"title": "Cocomelon - Wheels on the Bus",
"description": "Sing along with JJ and friends...",
"type": "video",
"viewCount": 2100000000,
"duration": "3:30",
"url": "https://www.youtube.com/watch?v=xxxxxxx",
"thumbnail": "https://i.ytimg.com/vi/xxxxxxx/hqdefault.jpg",
"date": "2021-02-26T00:00:00Z",
"channelName": "Cocomelon - Nursery Rhymes",
"channelUrl": "https://www.youtube.com/@Cocomelon",
"channelHandle": "@Cocomelon",
"channelThumbnail": null,
"searchQuery": "cocomelon",
"scrapedAt": "2026-02-26T15:00:00.000Z",
"raw": {
"type": "video",
"videoId": "xxxxxxx",
"title": "Cocomelon - Wheels on the Bus",
"channelTitle": "Cocomelon - Nursery Rhymes",
"channelId": null,
"channelHandle": "@Cocomelon",
"description": "Sing along with JJ and friends...",
"viewCountText": "2.1B views",
"viewCount": "2100000000",
"publishedTimeText": "5 years ago",
"publishDate": null,
"publishedAt": null,
"lengthText": "3:30",
"thumbnail": [
{
"url": "https://i.ytimg.com/vi/xxxxxxx/hqdefault.jpg",
"width": 480,
"height": 360
}
]
}
}

Output Schema

FieldTypeDescription
video_titlestringTitle of the video
video_urlstringFull YouTube video URL
channel_namestringName of the channel
channel_urlstringURL of the channel
viewsstringView count text (e.g. "2.1B views")
uploaded_timestringUpload time text (e.g. "5 years ago")
video_durationstringVideo duration (e.g. "3:30")
thumbnail_urlstringHigh-quality thumbnail image URL
descriptionstringShort description snippet (if available)

Example

Search Query: cocomelon

Generated URL: https://www.youtube.com/results?search_query=cocomelon