# YouTube Scraper (`lergassy/youtube-scraper`) Actor

\[$1.50/1K videos] Scrape YouTube by search, video URL or channel: exact views, likes, comments, publish date, duration, description, hashtags and the channel with subscribers. Date and duration filters free. No API key, no run fee.

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

## Pricing

from $1.05 / 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** searches YouTube, reads video URLs or lists a channel's newest videos, and returns one row per video with the exact numbers: **views, likes, comment count, publish date, duration, title, full description, hashtags, and the channel with its subscriber count**.

**$0.0015 per video** — $1.50 per 1,000, exact numbers included. No API key, no YouTube quota, no login, no start fee. Videos removed by your filters and inputs that fail are free.

### What is YouTube Scraper?

The YouTube Data API needs a key, has a daily quota and charges quota points for every search. This Actor reads the same pages and JSON the YouTube website shows to any visitor and turns them into clean rows — for market research, competitor tracking, influencer discovery, content planning, or feeding video data to an AI agent.

Three kinds of input, mixed freely in one run:

- **Search queries** — with YouTube's own filters: upload date, duration, popularity, Shorts only.
- **Video URLs** — watch links, youtu.be, Shorts or bare ids.
- **Channels** — handle, URL or id; the newest videos.

### What is in every row

| Field | Meaning |
|---|---|
| `title`, `url`, `videoId`, `thumbnailUrl`, `duration` | The video |
| `views`, `likes`, `comments` | Exact counters |
| `publishedAt`, `dateText`, `publishedText` | Publish date (and "3 days ago" as shown in search) |
| `description`, `hashtags` | Full description and its hashtags |
| `channelName`, `channelHandle`, `channelId`, `channelSubscribers`, `channelVerified` | The channel |
| `source`, `sourceValue`, `position` | Which search, channel or URL the row came from |

### How much does it cost?

| Event | Price |
|---|---|
| Video | **$0.0015** |

- Exact numbers are included in the price; the date filter is free.
- Videos below **Minimum views**: **$0**.
- Searches, channels or URLs that fail: **$0** (an error row says why).

#### Bulk export: what 50,000 rows actually cost

This Actor is built for bulk jobs — hundreds of inputs in one run, or a daily schedule. There is **no
fee per run, no fee per page and no proxy charge**: you pay for the rows you keep.

| Job | This Actor | Most-used Actor in this category |
|---|---|---|
| 50,000 videos across 100 runs | **$75** | $200 |
| 50,000 videos with a date filter | **$75** | $265 |

Checked on the Apify Store on 23 September 2026 against the Actor with the most monthly users in this category
($0.004 per result, plus $0.0013 per result when a date filter is used). Some Actors here ask less per row — this table compares against the one buyers actually use most.

### How to use it in three steps

1. Type **search queries**, paste **video URLs** or **channels** — one per line.
2. Set the filters: **Upload date**, **Duration**, **Sort**, **Minimum views**.
3. Press **Start**, then download JSON, CSV or Excel — or call the run from the API, n8n, Make, Zapier or an AI agent.

### ⬇️ Input

```json
{
  "searchQueries": ["bali villa tour", "n8n tutorial"],
  "maxResultsPerQuery": 100,
  "uploadDate": "month",
  "sortBy": "popularity",
  "videoUrls": ["https://www.youtube.com/watch?v=gER89wMfzvg"]
}
```

### ⬆️ Output

```json
{
  "source": "search",
  "sourceValue": "bali villa tour",
  "position": 2,
  "videoId": "gER89wMfzvg",
  "url": "https://www.youtube.com/watch?v=gER89wMfzvg",
  "title": "Our Bali Villa Tour - Building a Villa in Bali",
  "viewsText": "88,051 views",
  "views": 88052,
  "publishedText": "3y ago",
  "duration": "9:03",
  "isLive": false,
  "descriptionSnippet": "Get your copy of the Bali villa guide here! https://www.roryandcasey.com/balivillaguide Want to book your stay at Villa Raava?",
  "channelName": "Rory and Casey",
  "channelId": "UCG8XR8g6apQEp72U9papo6w",
  "channelUrl": "https://www.youtube.com/@RoryandCasey",
  "channelVerified": false,
  "badges": [
    "4K"
  ],
  "thumbnailUrl": "https://i.ytimg.com/vi/gER89wMfzvg/hqdefault.jpg",
  "type": "video",
  "likes": 1649,
  "commentsText": "165",
  "comments": 165,
  "dateText": "Sep 3, 2023",
  "publishedAt": "2023-09-03",
  "description": "Get your copy of the Bali villa guide here! https://www.roryandcasey.com/balivill...\n\nWant to book your stay at Villa Raava? Click Here https://www.airbnb.com.au/rooms/96439...\n\nIf you've been followi…",
  "channelHandle": "@RoryandCasey",
  "channelSubscribersText": "5.59K subscribers",
  "channelSubscribers": 5590,
  "hashtags": [],
  "scrapedAt": "2026-09-23T12:41:12.989Z"
}
```

### Use cases

#### Market and trend research

What gets views on a topic this month — sort by popularity, filter by upload date.

#### Competitor tracking

Competitors' newest videos with exact likes and comments every week.

#### Influencer discovery

Every row carries the channel and its subscribers — find creators whose videos beat their size.

#### Data for AI

Titles, descriptions and hashtags as clean rows through the Apify MCP server or API.

### Integrations

Every run is available through the Apify API, and the Actor works out of the box with n8n, Make, Zapier, Google Sheets, LangChain and the Apify MCP server.

### FAQ

**Do I need a YouTube API key?** No. There is no quota either.

**Why is `duration` empty for some URL rows?** YouTube shows the length on search and channel lists; for a bare URL the Actor reads the video's data panel, which has no length. Search and channel rows always have it.

**Can I sort by upload date?** YouTube's search offers only Relevance and Popularity now. Use **Upload date** (today, this week, this month) to get the newest videos.

**Can I get transcripts or download videos?** No — this Actor returns data, not media. See our YouTube Transcripts Actor for text.

**Is this legal?** The Actor reads public pages that anyone can open without logging in. Use the data in line with YouTube's terms and your local law.

# Actor input Schema

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

Anything you would type into YouTube search, one per line.

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

Video or Shorts links (watch?v=, youtu.be, /shorts/) or bare video ids — exact stats for each.

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

Handles, channel URLs or ids — the newest videos of each channel with exact stats.

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

How many videos to take from each search.

## `maxVideosPerChannel` (type: `integer`):

Newest first.

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

YouTube's own ordering — the same two options the site offers.

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

Only videos uploaded in this window. Use it to get the newest videos.

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

YouTube's duration filter.

## `videoType` (type: `string`):

Regular videos (Shorts may appear too) or Shorts only.

## `includeDetails` (type: `boolean`):

Opens every video for exact views, likes, comment count, publish date, full description, hashtags and channel subscribers. Same price — switch off only for a faster run.

## `minViews` (type: `integer`):

Skip videos with fewer views. Skipped videos are not charged.

## `concurrency` (type: `integer`):

How many channels or searches to read at the same time.

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

Requests go to YouTube directly first; a refused request is retried on a fresh Apify datacenter address. Residential is never switched on by itself.

## Actor input object example

```json
{
  "searchQueries": [
    "bali villa tour"
  ],
  "maxResultsPerQuery": 20,
  "maxVideosPerChannel": 20,
  "sortBy": "relevance",
  "uploadDate": "any",
  "duration": "any",
  "videoType": "video",
  "includeDetails": true,
  "minViews": 0,
  "concurrency": 4,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

One row per YouTube video: views, likes, comments, date, duration, channel.

# 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": [
        "bali villa tour"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("lergassy/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": ["bali villa tour"],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("lergassy/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": [
    "bali villa tour"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call lergassy/youtube-scraper --silent --output-dataset

```

## MCP server setup

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