# YouTube Videos Scraper: Search, Channels, Playlists, Shorts (`tamnt67/youtube-scraper`) Actor

YouTube videos scraper: title, video ID, channel, view count, publish time, duration and Shorts flag; full details add likes, comment count and description. Takes search keywords or YouTube channel, playlist and video URLs, no API key. Use it to research YouTube search results and channel videos.

- **URL**: https://apify.com/tamnt67/youtube-scraper.md
- **Developed by:** [Tam Ng.](https://apify.com/tamnt67) (community)
- **Categories:** Videos, Social media
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## YouTube Videos Scraper: Search, Channels, Playlists, Shorts

Scrape YouTube search results, channel videos, Shorts, playlists and single videos to JSON, CSV or Excel with no login, no API key and no quota, for $2 per 1,000 results on the Free plan, down to $1 on higher plans.

### What you can do with it

- **Market and product research:** search "wireless earbuds review" or any product keyword, sort by view count, and see which videos and channels lead the topic.
- **Competitor and channel monitoring:** scrape a competitor's channel URL with newest videos first, run it daily, and compare `videoId` sets to spot new uploads.
- **Influencer discovery:** search with result type "Channels only" to get channel names, handles, subscriber counts and descriptions for outreach lists.
- **Trend tracking:** combine the upload date filter (last hour, today, this week) with "Upload date" sorting to follow what is being published right now.
- **Playlist and course exports:** export every video in a playlist with its position, title, duration and views.
- **AI and analytics pipelines:** feed titles, descriptions and engagement numbers into a spreadsheet or an LLM workflow.

### What it can scrape

| Input | What you get |
|-------|--------------|
| **Search keywords** | Videos (and optionally Shorts, channels, playlists) with filters: sort by relevance, upload date, view count or rating; upload date (last hour to this year); duration (under 4 minutes, 4 to 20 minutes, over 20 minutes); result type |
| **Channel URL** (`youtube.com/@mkbhd`, `/channel/UC...`, `/c/...`, `/user/...`) | All videos of the channel, newest, most popular or oldest first, plus channel name, handle, subscriber count and video count on every record. Add `/shorts` or `/streams` to the URL to get Shorts or live streams instead |
| **Playlist URL** (`youtube.com/playlist?list=...`) | Every video in the playlist with its position |
| **Video URL** (`youtube.com/watch?v=...`, `youtu.be/...`, `/shorts/...`) | Full details of that video |
| **Search results URL** (`youtube.com/results?search_query=...`) | Same as keywords; filters from the URL (`sp` parameter) are kept |

### Output fields

Every video record:

| Field | Example |
|-------|---------|
| `type` | video |
| `videoId` / `url` | `tUhLcDnXdwg` / `https://www.youtube.com/watch?v=tUhLcDnXdwg` |
| `title` | We Tested the Best Wireless Earbuds for 2026 | Top Picks For Every Budget |
| `channelName` / `channelId` / `channelUrl` / `channelVerified` | Tom's Guide / UCik8xvfR6s8GQ74QNEGNzwg / https://www.youtube.com/@TomsGuideUS / true |
| `viewCount` / `viewCountText` | 422920 / 422,920 views |
| `publishedTimeText` | 7 months ago |
| `duration` / `durationSeconds` | 9:04 / 544 |
| `isShort` / `isLive` | false / false |
| `badges` | \["4K"] |
| `descriptionSnippet`, `thumbnail` | search snippet, best thumbnail URL |
| `position`, `page`, `query`, `scrapedAt` | 2 / 1 / wireless earbuds review / 2026-11-05T13:07:28.645Z |

These fields come only from the video page. They are on records from a **video URL**, and on search, channel and playlist records only when **Fetch full video details** is on. Without it, search, channel and playlist records do not have them:

| Field | Example |
|-------|---------|
| `likeCount` / `commentCount` | 2300 / 255 |
| `description` | full video description |
| `publishDate` / `dateText` | 2026-03-16 / Mar 16, 2026 |
| `channelSubscriberCount` / `channelSubscriberCountText` | 166000 / 166K subscribers |
| `playabilityStatus` | LOGIN_REQUIRED or UNPLAYABLE are common (see Limitations) |
| `hasCaptions`, `keywords`, `uploadDate`, `category`, `lengthSeconds`, `isFamilySafe`, `isLiveContent` | filled only when YouTube returns full player data; otherwise null (unknown). `hasCaptions` is known only when `playabilityStatus` is OK, so it is often null |
| `hashtags` | \["#AI", "#Python"] (from the description and the hashtag line above the title) |
| `descriptionLinks` | full link targets from the description, e.g. \["https://amzn.to/4ifoukW"] |
| `commentsTurnedOff` | true when the video page says comments are off, false when it has comments, null if unknown |
| `channelVerified` / `channelAvatarUrl` | true / channel avatar URL |
| `isAgeRestricted` | false when the video plays, true when YouTube shows its age gate, null (unknown) otherwise |

Every video record from search or a channel also has `isMembersOnly` (true for members-only videos).

Channel records (search type "Channels only" or "Any"): `channelId`, `url`, `title`, `handle`, `subscriberCount`, `subscriberCountText`, `description`, `verified`, `thumbnail`.

Playlist records (search type "Playlists only" or "Any"): `playlistId`, `url`, `title`, `channelName`, `videoCount`, `thumbnail`.

Records from a channel URL also carry `channelHandle`, `channelSubscriberCount`, `channelSubscriberCountText` and `channelVideoCount`, plus the channel's About data: `channelVerified`, `channelDescription`, `channelDescriptionLinks` (title and URL), `channelCountry`, `channelJoinedDate` (YYYY-MM-DD), `channelTotalViews`, `channelAvatarUrl` and `channelBannerUrl`. Records from a playlist URL carry `playlistId` and `playlistIndex`.

### Example output

One real record from a cloud test run (search "wireless earbuds review" with video details on). The long description and snippet are trimmed.

```json
{
  "type": "video",
  "videoId": "tUhLcDnXdwg",
  "url": "https://www.youtube.com/watch?v=tUhLcDnXdwg",
  "title": "We Tested the Best Wireless Earbuds for 2026 | Top Picks For Every Budget",
  "channelName": "Tom’s Guide",
  "channelId": "UCik8xvfR6s8GQ74QNEGNzwg",
  "channelUrl": "https://www.youtube.com/@TomsGuideUS",
  "channelVerified": true,
  "viewCount": 422920,
  "viewCountText": "422,920 views",
  "publishedTimeText": "7 months ago",
  "duration": "9:04",
  "durationSeconds": 544,
  "isLive": false,
  "isShort": false,
  "descriptionSnippet": "Get the best earbuds right here ...",
  "badges": ["4K"],
  "thumbnail": "https://i.ytimg.com/vi/tUhLcDnXdwg/hq720.jpg?sqp=-oaymwEcCNAFEJQDSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLDjI1ApVMwqEKER0-qKXguIWi2Fag",
  "description": "Get the best earbuds right here ...",
  "likeCount": 2300,
  "commentCount": 255,
  "publishDate": "2026-03-16",
  "dateText": "Mar 16, 2026",
  "channelSubscriberCountText": "166K subscribers",
  "channelSubscriberCount": 166000,
  "playabilityStatus": "LOGIN_REQUIRED",
  "position": 2,
  "page": 1,
  "query": "wireless earbuds review",
  "scrapedAt": "2026-11-05T13:07:28.645Z"
}
```

### How to use

1. Open the Actor and add **Search queries** (one keyword per line), **YouTube URLs** (channels, playlists, videos or search result pages), or both.
2. Set **Max results per query or URL**, pick filters such as sort order and upload date, and turn on **Fetch full video details** if you need likes, comments and full descriptions.
3. Click **Start**, then download the dataset as JSON, CSV, Excel or HTML, or read it through the API.

Example input:

```json
{
  "searchQueries": ["wireless earbuds review", "best budget laptop 2026"],
  "startUrls": [
    { "url": "https://www.youtube.com/@mkbhd" },
    { "url": "https://www.youtube.com/playlist?list=PLrAXtmErZgOeiKm4sgNOknGvNjby9efdf" }
  ],
  "maxResultsPerQuery": 100,
  "searchType": "video",
  "searchSortBy": "view_count",
  "uploadDate": "month",
  "videoDuration": "any",
  "includeShorts": true,
  "channelVideosSort": "newest",
  "maxShortsPerChannel": 0,
  "maxStreamsPerChannel": 0,
  "searchFeatures": [],
  "publishedAfter": "",
  "videoDetails": true,
  "language": "en",
  "country": "US"
}
```

Tips:

- YouTube returns about 20 search results or 30 channel videos per page, so large limits take more pages.
- Set `language` and `country` (for example `de` and `DE`) to get localized results and texts.
- For a daily feed of new videos, search with `uploadDate: "today"` and `searchSortBy: "upload_date"`, or scrape the channel URL with `channelVideosSort: "newest"` and compare `videoId` sets.
- An API call that sends only `startUrls` scrapes only those URLs; no example search is added. A run with neither queries nor URLs uses the example query `wireless earbuds review` and says so in the log.
- **Search features filter** (`searchFeatures`) is the "Features" part of YouTube's filter menu: `live`, `4k`, `hd`, `subtitles`, `creative_commons`, `360`, `vr180`, `3d`, `hdr`, `purchased`. Result type "Movies only" (`searchType: "movie"`) returns full-length movies.
- **Only videos published after** (`publishedAfter`) takes a date (`2026-01-31`) or a period (`7 days`, `2 weeks`, `3 months`) and works for search, channel and playlist results.
- For a channel URL, `maxShortsPerChannel` and `maxStreamsPerChannel` also save that many Shorts and live streams from the channel, next to its videos.
- Datacenter proxy (the default) is enough. If YouTube ever starts refusing requests, switch the proxy to residential.

### Pricing and cost examples

You pay per result record in the dataset (one video, channel or playlist). Platform usage and proxy traffic are included. Fetching full details costs the same per record; it only makes the run slower.

| Apify plan tier | Price per 1,000 results |
|-----------------|-------------------------|
| Free | $2.00 |
| Bronze | $1.50 |
| Silver | $1.20 |
| Gold, Platinum, Diamond | $1.00 |

Cost examples on the Free plan:

- 100 results ≈ $0.20
- 1,000 results ≈ $2
- 10,000 results ≈ $20 (about $10 on Gold and higher tiers)

There is also a one-time start fee of $0.00005 per run. The Apify Free plan gives you $5 of platform credit every month, which is enough for about 2,500 results at the Free price.

A search query or URL that fails or returns nothing adds no records, so it adds no result charges. You can also set a maximum total charge per run in the run options; the Actor stops when it is reached.

### Use it via API, on a schedule, or from an AI agent

Replace `YOUR_API_TOKEN` with your Apify API token.

**JavaScript** (`npm install apify-client`):

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });

const run = await client.actor('tamnt67/youtube-scraper').call({
    searchQueries: ['wireless earbuds review'],
    maxResultsPerQuery: 50,
    videoDetails: true,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

**Python** (`pip install apify-client`):

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")

run = client.actor("tamnt67/youtube-scraper").call(run_input={
    "searchQueries": ["wireless earbuds review"],
    "maxResultsPerQuery": 50,
    "videoDetails": True,
})

items = client.dataset(run["defaultDatasetId"]).list_items().items
print(items)
```

**cURL** (runs the Actor and returns the dataset items in one call):

```bash
curl -X POST "https://api.apify.com/v2/acts/tamnt67~youtube-scraper/run-sync-get-dataset-items?token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"searchQueries": ["wireless earbuds review"], "maxResultsPerQuery": 50}'
```

**Schedules:** create a task with your input and add it to Apify Schedules to run it every hour, day or week; each run saves a new dataset.

**AI agents:** the Apify MCP server at https://mcp.apify.com lets AI assistants such as Claude or Cursor run this Actor and read its results.

### FAQ

**How much does the YouTube Scraper cost?**
The YouTube Scraper costs $2 per 1,000 results on the Apify Free plan and goes down to $1 per 1,000 on Gold and higher tiers. 100 results cost about $0.20. Platform usage and proxy traffic are included, and the Free plan's $5 monthly credit covers about 2,500 results.

**How many results can I get?**
The YouTube Scraper returns up to 5,000 results for each search query or URL, set with **Max results per query or URL**. The real number can be lower when YouTube runs out of results for a search or when a channel or playlist has fewer videos.

**How do I get more results?**
With the YouTube Scraper, raise **Max results per query or URL**, add more search queries (each is scraped separately), or split a broad topic into narrower keywords and upload date filters.

**Can I run it through the API or on a schedule?**
Yes. The YouTube Scraper can be started from the Apify API with the JavaScript or Python client or a single cURL call, and saved as a task in Apify Schedules for daily or hourly runs. AI assistants can run it through the Apify MCP server.

**How fresh is the data?**
The YouTube Scraper reads YouTube live during each run, so the numbers are what YouTube showed at that moment. Every record has a `scrapedAt` timestamp.

**Is it legal to scrape YouTube?**
The YouTube Scraper collects only publicly visible data and does not log in. You are responsible for how you use the data, including YouTube's terms of service and data protection laws such as GDPR when records contain personal data such as channel or creator names. This is not legal advice; ask a lawyer if you are unsure about your use case.

### Limitations

- Comments and transcripts are not included (separate Actors cover them).
- View counts in list results are rounded by YouTube ("1.2M views"). Turn on video details for exact numbers.
- Age-restricted or private videos return limited data.
- When YouTube answers the details request with `playabilityStatus: "LOGIN_REQUIRED"` (common on cloud runs, as in the example record), `keywords`, `category`, `uploadDate`, `lengthSeconds`, `isFamilySafe` and `hasCaptions` are null (unknown). `publishDate` is then taken from the date shown on the video page (`dateText`). Likes, comment count, description and subscriber count still come through. The Actor never signs in to YouTube.
- If the details request for a video fails, the video is still saved with its list data only.
- Shorts found in search results come without channel, publish time or duration in the list data; video details can fill in some of these.
- `publishedAfter` uses the exact publish date when **Fetch full video details** is on; otherwise it reads YouTube's relative text ("3 weeks ago"), which is approximate (a month counts as 30 days) and English only. Shorts and other items without a date are kept unless video details are on. On newest-first lists (channel URLs, search sorted by upload date) the Actor stops reading pages once most of a page is older.
- `commentsTurnedOff`, `isAgeRestricted` and `channelVerified` from the video page are null when YouTube does not show the information. `isMembersOnly` depends on the badge YouTube shows in the list.
- Transcripts, subtitles, AI summaries and the video location are not included.
- Search filters (sort, upload date, duration, result type, features) apply to search queries only; channel order applies to channel URLs only.
- Each query or URL stops at 5,000 results, and the Actor reads at most 500 pages per query or URL.
- Unsupported URLs (for example a YouTube home page or a non-YouTube link) are skipped and logged.

### Changelog

- 1.0 update (2026-11-23): new search filters (features such as Live, 4K, HD, Subtitles, Creative Commons, 360°, HDR; result type "Movies only"), a "published after" filter for search, channel and playlist results, optional Shorts and live streams for channel URLs, channel About data on channel-URL records (description, links, country, joined date, total views, avatar, banner, verified), and new video fields `hashtags`, `descriptionLinks`, `commentsTurnedOff`, `channelAvatarUrl`, `isAgeRestricted` and `isMembersOnly`. Existing inputs and fields work as before.
- 1.0 update (2026-11-19): the field list now says clearly that likes, full description, publish date, subscriber count, playability status and captions come only from video URLs or with **Fetch full video details** on, and that `hasCaptions` is often null. `publishDate` is always a plain date (YYYY-MM-DD); it was sometimes a full timestamp.
- 1.0 (2026-11-19): `publishDate` now comes from the date shown on the video page, and `hasCaptions` and `keywords` are null (unknown) instead of false or empty when YouTube answers with `LOGIN_REQUIRED`; an API call with only `startUrls` no longer also runs the example search.

### Integrations

Works with every Apify integration: API, webhooks, Zapier, Make, Google Sheets, Slack, n8n, LangChain and the Apify MCP server.

### Support

Found a problem or missing field? Report it in the Issues tab of this Actor.

# Actor input Schema

## `searchQueries` (type: `array`):

Keywords to search on YouTube, one per line. Each query is scraped separately.

## `startUrls` (type: `array`):

Optional. Channel URLs (https://www.youtube.com/@mkbhd, also /@mkbhd/shorts or /@mkbhd/streams), playlist URLs (youtube.com/playlist?list=...), video URLs (youtube.com/watch?v=... or youtu.be/...) and search result URLs (youtube.com/results?search_query=...).

## `maxResultsPerQuery` (type: `integer`):

Stop after this many videos, channels or playlists for each query or URL. YouTube returns about 20 search results or 30 channel videos per page.

## `videoDetails` (type: `boolean`):

For every video also fetch the exact view count, likes, comment count, publish date, category, keywords, full description, length in seconds and channel subscribers. Two extra requests per video, so runs take longer. Single video URLs always get full details.

## `searchType` (type: `string`):

Applies to search queries only.

## `searchSortBy` (type: `string`):

Applies to search queries only.

## `uploadDate` (type: `string`):

Applies to search queries only.

## `videoDuration` (type: `string`):

Applies to search queries only.

## `searchFeatures` (type: `array`):

Applies to search queries only. Same as the "Features" part of YouTube's search filter menu: only videos that have all selected features. Leave empty for no feature filter.

## `includeShorts` (type: `boolean`):

YouTube mixes Shorts into search results. They are flagged with isShort: true.

## `publishedAfter` (type: `string`):

Optional. A date (2026-01-31) or a period back from today ("7 days", "2 weeks", "3 months", "1 year"). Applies to search, channel and playlist results. Without full video details the date comes from YouTube's relative text ("3 days ago"), so it is approximate; Shorts and items with no date are kept. Channel newest-first lists and search sorted by upload date stop at the first older video.

## `channelVideosSort` (type: `string`):

Applies to channel URLs only.

## `maxShortsPerChannel` (type: `integer`):

Channel URLs only. Besides the videos, also save up to this many Shorts from the channel's Shorts tab (isShort: true). 0 = no Shorts (the default). Not used for /shorts or /streams URLs.

## `maxStreamsPerChannel` (type: `integer`):

Channel URLs only. Besides the videos, also save up to this many past or current live streams from the channel's Live tab. 0 = no streams (the default). Not used for /shorts or /streams URLs.

## `language` (type: `string`):

Two-letter language code for localized text such as "3 days ago" (en, de, fr, es, pt, ja, vi...).

## `country` (type: `string`):

Two-letter country code YouTube uses to localize search results (US, GB, DE, IN, BR...).

## `proxyConfiguration` (type: `object`):

Apify datacenter proxy works for YouTube. Switch to residential only if runs start failing.

## Actor input object example

```json
{
  "searchQueries": [
    "wireless earbuds review"
  ],
  "startUrls": [],
  "maxResultsPerQuery": 50,
  "videoDetails": false,
  "searchType": "video",
  "searchSortBy": "relevance",
  "uploadDate": "any",
  "videoDuration": "any",
  "includeShorts": true,
  "channelVideosSort": "newest",
  "language": "en",
  "country": "US",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset with one record per video, channel or playlist: id, URL, title, channel, views, published time, duration, thumbnail and optional full details (likes, comments, publish date, category, keywords, description).

## `resultsCsv` (type: `string`):

The same dataset exported as CSV.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "searchQueries": [
        "wireless earbuds review"
    ],
    "maxResultsPerQuery": 50,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("tamnt67/youtube-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "searchQueries": ["wireless earbuds review"],
    "maxResultsPerQuery": 50,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("tamnt67/youtube-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "searchQueries": [
    "wireless earbuds review"
  ],
  "maxResultsPerQuery": 50,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call tamnt67/youtube-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,tamnt67/youtube-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/QOoRrGHf0eKHcRReP/builds/zOPpMMb6DH5qJuvh8/openapi.json
