# YouTube Scraper (Videos, Shorts, Channels & Comments) (`locaihost/youtube-scraper`) Actor

Scrape YouTube videos, Shorts, channels, playlists and search results. Get title, views, likes, comment count, subscribers, length, exact upload time, tags and description, channel joined date and country, plus comments with replies. Search filters, new-only mode. No login. $0.50 per 1,000 videos.

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

## Pricing

from $0.28 / 1,000 videos

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 Scraper (Videos, Shorts, Channels & Comments)

Get public YouTube data as clean JSON, CSV or Excel rows: videos and Shorts with views, exact likes, comment count, length, exact upload time, tags and description; channels with subscribers, total views, joined date, country and links; and comments with replies, pinned and hearted flags. Search with YouTube's own filters, or paste channels, playlists and video links. No login, no API key, no daily quota.

- **Competitor and creator research:** every new video from a list of channels, with views, likes and comments, newest or most popular first.
- **Content and keyword research:** what YouTube ranks for a search term this week, filtered by length, Shorts or live, with tags and hashtags.
- **Influencer shortlists:** search for channels by topic and get subscribers, total views, video count, country and their links in one row each.
- **Audience and sentiment analysis:** the top or newest comments on any video, with replies, likes and the creator's pinned and hearted picks.
- **Monitoring on a schedule:** turn on **Only new videos and comments** and pay only for what appeared since the last run.

### Quick start

Paste this into the **JSON** tab of the input and click **Start**:

```json
{"searchTerms": ["cold brew coffee"], "maxResults": 10}
```

You get the top 10 videos YouTube shows for "cold brew coffee", each opened for its full details: 10 rows, usually in under 15 seconds.

More examples:

```json
{"channels": ["@MrBeast", "https://www.youtube.com/@mkbhd"], "channelTabs": ["videos", "shorts"], "maxResults": 50}
```

```json
{"videoUrls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"], "includeComments": true, "maxComments": 500, "includeReplies": true}
```

```json
{"searchTerms": ["iphone 17 review"], "uploadDate": "week", "duration": "3to20", "sortBy": "popularity", "maxResults": 100}
```

```json
{"searchTerms": ["specialty coffee"], "searchType": "channels", "maxResults": 50}
```

Any YouTube link works in any list: a channel link pasted under video links is still read as a channel.

### What data can I get?

Four kinds of row, set by the `type` field: **video**, **channel**, **comment** and **unavailable** (a free row for a missing video, comments turned off, a missing channel tab or an unusable entry, saying why).

| Row | Fields |
|---|---|
| Video | `id`, `url`, `title`, `channelName`, `channelId`, `channelHandle`, `channelUrl`, `channelVerified`, `subscriberCount`, `viewCount`, `likeCount`, `commentCount`, `commentsTurnedOff`, `durationSeconds`, `duration`, `publishedAt` (exact time, UTC), `publishDate`, `publishedText`, `description`, `tags`, `hashtags`, `category`, `thumbnail`, `isShort`, `isLive`, `watchingNow`, `wasLive`, `isUpcoming`, `details`, `rank` |
| Channel | `id`, `url`, `handle`, `name`, `description`, `subscriberCount`, `subscriberCountText`, `videoCount`, `viewCount` (all videos), `joinedDate`, `country`, `links` (title and link), `keywords`, `avatar`, `banner`, `verified` |
| Comment | `videoId`, `videoUrl`, `commentId`, `parentId` (for replies), `isReply`, `text`, `likeCount`, `replyCount`, `publishedText`, `isEdited`, `authorHandle`, `authorChannelUrl`, `authorIsCreator`, `authorIsVerified`, `isPinned`, `isHeartedByCreator`, `sortedBy` |
| Every row | `type`, `source` (search, channel, playlist or url), `input` (what you typed), `scrapedAt` |

A real video row and comment from a run on 2026-11-01 (description and tags shortened):

```json
{
  "type": "video",
  "id": "BxWQVe5CaS4",
  "url": "https://www.youtube.com/watch?v=BxWQVe5CaS4",
  "title": "Perfect Cold Brew Coffee at Home Without Fancy Gear",
  "channelName": "Dero_De_Barista",
  "channelId": "UCu_LkXCi9-rZYYvkWvuStxA",
  "channelHandle": "@Derothebarista",
  "channelUrl": "https://www.youtube.com/@Derothebarista",
  "subscriberCount": 81000,
  "viewCount": 4225,
  "likeCount": 136,
  "commentCount": 27,
  "commentsTurnedOff": false,
  "durationSeconds": 852,
  "duration": "14:12",
  "publishedAt": "2026-07-22T15:49:22.000Z",
  "publishDate": "2026-07-22",
  "publishedText": "3 months ago",
  "description": "Is your cold brew tasting watery, weak, bitter, or too strong? The problem might not be your coffee beans…",
  "tags": ["cold brew coffee recipe", "coffee recipe", "cold brew", "how to make cold brew"],
  "hashtags": ["#ColdBrew", "#ColdBrewCoffee", "#CoffeeRecipe", "#HomeBarista"],
  "category": "Education",
  "thumbnail": "https://i.ytimg.com/vi/BxWQVe5CaS4/hqdefault.jpg",
  "isShort": false,
  "isLive": false,
  "wasLive": false,
  "details": "full",
  "source": "search",
  "input": "cold brew coffee",
  "rank": 1,
  "scrapedAt": "2026-11-01T14:44:40.059Z"
}
```

```json
{
  "type": "comment",
  "videoId": "BxWQVe5CaS4",
  "commentId": "UgykObWp7kAcTbbMRAB4AaABAg",
  "parentId": null,
  "isReply": false,
  "text": "Yes you can use dark only challenge is that it tends to have bitterness for the roast",
  "likeCount": 2,
  "replyCount": 1,
  "publishedText": "3 months ago",
  "authorHandle": "@Derothebarista",
  "authorIsCreator": true,
  "isPinned": false,
  "isHeartedByCreator": false,
  "sortedBy": "top"
}
```

**Full video details** is on by default: each video is opened on its own, for exact likes, the exact upload time, the full description, tags, category, the comment count and the channel's subscribers. Turn it off for faster runs that return what the search, channel tab or playlist shows (title, views, length, relative date, channel); the price is the same.

### How much does it cost?

You pay per row, nothing for the run itself (apart from a one-time $0.00005 start fee):

| Row | Free and Starter plans | Scale | Business |
|---|---|---|---|
| Video or Short | $0.50 per 1,000 | $0.375 per 1,000 | $0.275 per 1,000 |
| Channel | $0.50 per 1,000 | $0.375 per 1,000 | $0.275 per 1,000 |
| Comment or reply | $0.25 per 1,000 | $0.1875 per 1,000 | $0.1375 per 1,000 |

**Free rows, never charged:** missing or removed videos, videos with comments turned off, channels without the tab you asked for, searches with no results, unusable input, and anything skipped by **Only new videos and comments**.

Apify's free $5 monthly credit covers about 10,000 videos or 20,000 comments. On the Free plan a run stops at 1,000 rows; any paid Apify plan removes that cap. Set a **Max cost per run** in the run options and the run stops cleanly at that amount.

### Limits

- Public data only, read the way a signed-out visitor sees it. Private, members-only and some age-restricted videos (YouTube asks for a signed-in account) return a free "not found" row. We never sign in.
- Subscriber counts and comment likes are rounded by YouTube itself above 1,000 (4.55M, 72K). Video likes and views are exact. Comment counts are exact when comments are collected, otherwise rounded the same way.
- Search sorts by Relevance or Popularity, the two orders YouTube's own Filters panel offers. For recent videos, add an upload date such as Today or This week.
- Live chat, transcripts, video downloads and the channel's business email (which YouTube shows only after a sign-in and CAPTCHA) are not included. For transcripts, see YouTube Transcript Scraper below.
- Email addresses and phone numbers are removed from comments, descriptions and channel About text, and replaced with `[email removed]` or `[phone removed]`. Commenters appear only as the public @handle and channel link YouTube shows.

### Only new videos and comments, and scheduling

Turn on **Only new videos and comments** and schedule the run (daily or weekly) in Apify Console. Each run returns only the videos and comments this same input hasn't returned before; the rest are skipped and not charged. It works as a window: "of the latest 50 videos, only the new ones", so a run never digs further back just to fill the number. With comments on, already-seen videos are still checked for new comments. Channel rows are always returned, so their counts stay current.

### Integrations

- **API:** start a run and fetch the dataset with Apify's REST API or the JavaScript and Python clients; every row is JSON.
- **n8n and Make:** use the Apify node or module, pick this Actor, paste the input JSON.
- **AI agents (MCP):** the Actor works as a tool through Apify's MCP server, so an AI assistant can search YouTube or read a video's comments for you.
- **Exports:** JSON, CSV, Excel, XML or HTML from the dataset tab, or straight to Google Sheets with Apify's integration.

### FAQ

**What does a typical run cost?** 100 videos with full details cost $0.05. The same 100 videos with 100 comments each cost $0.05 + 10,000 comments × $0.25 / 1,000 = $2.55.

**Can I use it from code?** Yes. Call the Actor through the Apify API with the same JSON input as in the examples above, then read the dataset.

**Does it work with AI agents?** Yes, through Apify's MCP server and any agent framework that can call Apify Actors.

**Is it legal to scrape YouTube?** This Actor reads only public pages, the way a signed-out visitor sees them, with no account and no cookies. Videos, descriptions and comments belong to their creators and commenters: use the data for analysis and research, respect copyright, and follow the laws on personal data that apply to you (GDPR, CCPA). If in doubt, ask a lawyer.

**Why are some fields empty?** A list-only row (Full video details off) has no likes, tags or exact date. Live streams have no view count while they are live (`watchingNow` instead). Some channels list no country or links. Comment counts are empty when comments are turned off.

**What if YouTube changes its pages?** The Actor runs a daily self-test, and we fix breakage the same day.

### More from locaihost data

- [YouTube Transcript Scraper](https://apify.com/locaihost/youtube-transcripts): transcripts and subtitles of videos, channels, playlists and searches.
- [Instagram Scraper](https://apify.com/locaihost/instagram-scraper): public profiles, posts and reels, no login.
- [TikTok Profile Scraper](https://apify.com/locaihost/tiktok-creators): creator profiles with engagement rate and brand deals.
- [Google Trends Scraper](https://apify.com/locaihost/google-trends): interest over time and related queries.

Did it help? A short rating on the Store helps other people find it.

Questions or a field you need? Open an issue on the **Issues** tab: we answer issues within 24 hours.

*locaihost data*

# Changelog

This Actor's version history is a separate document: https://apify.com/locaihost/youtube-scraper/changelog.md

# Actor input Schema

## `searchTerms` (type: `array`):

What you would type into YouTube's search box (or a youtube.com/results link). Each term returns up to Max results videos (or channels, see Search type), with the filters below.

## `channels` (type: `array`):

Channel @handles, links or UC… ids (@MrBeast, https://www.youtube.com/@mkbhd, UCX6OQ3DkcsbYNE6H8uQQuVA). Each returns a channel row (subscribers, videos, total views, joined date, country, links) and its latest videos from the tabs chosen below.

## `videoUrls` (type: `array`):

Links to single videos or Shorts (watch?v=, youtu.be/, /shorts/, /live/) or bare video ids. Add comments below to get each video's comments.

## `playlistUrls` (type: `array`):

Playlist links (youtube.com/playlist?list=…) or ids. Each returns up to Max results of its videos, in playlist order.

## `maxResults` (type: `integer`):

Most videos (or channels) per search term, per channel tab and per playlist. 0 with channels returns the channel row only.

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

Open every video for exact likes, exact upload time, full description, tags, category, comment count and channel subscribers. Same price either way; off is faster and returns only what the search, channel tab or playlist shows (title, views, length, relative date). Always on for video links and when comments are on.

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

What a search returns. Channels returns channel rows (charged as channels).

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

Only videos uploaded within this time (YouTube's own Upload date filter).

## `duration` (type: `string`):

Only videos of this length (YouTube's own Duration filter).

## `sortBy` (type: `string`):

YouTube's own two orders. For the newest, combine Relevance with an upload date such as Today or This week.

## `features` (type: `array`):

Only videos that have all of these.

## `channelTabs` (type: `array`):

Which of each channel's tabs to read, Max results videos from each. A channel without a tab (no Live tab, say) gets a free row saying so.

## `channelSort` (type: `string`):

Order of each channel tab's videos, as the tab's own Latest / Popular / Oldest buttons sort them.

## `includeChannelInfo` (type: `boolean`):

One row per channel with subscribers, number of videos, total views, joined date, country, description and links. Charged as a channel.

## `includeComments` (type: `boolean`):

Return each video's comments too, charged per comment. Each row carries the text, likes, reply count, date, the commenter's public @handle, and whether it is pinned or hearted by the creator. Videos with comments turned off get a free row saying so.

## `maxComments` (type: `integer`):

Most comment rows per video, replies included.

## `commentsSort` (type: `string`):

Top comments (YouTube's default order) or newest first.

## `includeReplies` (type: `boolean`):

Also return replies, each right after the comment it answers, with parentId set. They count toward Comments per video.

## `onlyNew` (type: `boolean`):

Of the latest videos and comments (Max results / Comments per video), return only those this input hasn't returned in an earlier run. For daily or weekly schedules. Skipped rows are not charged. Channel rows are always returned (their counts change).

## Actor input object example

```json
{
  "searchTerms": [
    "cold brew coffee",
    "iphone 17 review"
  ],
  "channels": [
    "@MrBeast",
    "https://www.youtube.com/@mkbhd"
  ],
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://www.youtube.com/shorts/41UzbuW6wJs"
  ],
  "playlistUrls": [
    "https://www.youtube.com/playlist?list=PLFgquLnL59alCl_2TQvOiD5Vgm1hCaGSI"
  ],
  "maxResults": 10,
  "videoDetails": true,
  "searchType": "videos",
  "uploadDate": "any",
  "duration": "any",
  "sortBy": "relevance",
  "features": [],
  "channelTabs": [
    "videos"
  ],
  "channelSort": "newest",
  "includeChannelInfo": true,
  "includeComments": false,
  "maxComments": 20,
  "commentsSort": "top",
  "includeReplies": false,
  "onlyNew": false
}
```

# Actor output Schema

## `videos` (type: `string`):

One row per video or Short: title, channel, views, likes, comments, length, date.

## `channels` (type: `string`):

One row per channel: subscribers, videos, total views, joined date, country, links.

## `comments` (type: `string`):

One row per comment or reply: text, author handle, likes, replies, pinned, hearted.

## `full` (type: `string`):

Every field of every row, including free rows.

## `summary` (type: `string`):

Counts, free rows by reason, anything that failed, access stats and cost.

# 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 = {
    "searchTerms": [
        "cold brew coffee"
    ],
    "maxResults": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("locaihost/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 = {
    "searchTerms": ["cold brew coffee"],
    "maxResults": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("locaihost/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 '{
  "searchTerms": [
    "cold brew coffee"
  ],
  "maxResults": 10
}' |
apify call locaihost/youtube-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,locaihost/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/JesYo4qfMrifHteai/builds/Sa3GYSMB48WRM7Xpx/openapi.json
