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

Scrape public YouTube videos, Shorts and live streams from search, channels, playlists and video links: exact views, likes, publish time, full description, tags and channel details, without an API key.

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

## Pricing

from $0.70 / 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, Channels, Shorts & Search

YouTube Scraper collects public YouTube videos from search results, channels, playlists and single video links,
without logging in and without a YouTube API key. Each video comes back as one clean row: title, views, likes,
duration, exact publish time, full description, hashtags, tags, category, thumbnail and its channel. Each channel also
gets one free row with its subscriber count, total views, video count, join date, country, links and verified badge.
Regular videos, Shorts and live streams are told apart, and you pay only for the videos you keep.

### What does YouTube Scraper do?

- **Search:** the videos YouTube shows for a word or phrase, with YouTube's own filters: regular videos or Shorts
  only, sort by relevance, upload date or views, and upload date (last hour, today, this week, this month, this year).
- **Channels:** the latest videos, Shorts and live streams of any public channel, by `@handle`, channel address or
  channel ID, plus a free row with the channel details from its About page.
- **Playlists:** every video of a public playlist, in playlist order.
- **Single videos:** full details of any video address (`watch`, `youtu.be`, `shorts`, `live` and `embed` links).
- **Video data:** title, video ID and address, type (`video`, `short` or `live`), views, likes, duration in seconds,
  publish time (ISO 8601), full description, hashtags, tags, category, thumbnail, family-safe flag, channel name,
  channel ID and channel address.
- **Channel data:** handle, subscribers, verified badge, description, country, total views, number of videos, join
  date, links shown on the channel and profile picture.
- **One row per video per run:** a video found by two searches or a search and a channel is saved and charged once.
- **Free rows that explain:** a search with no videos, a channel or video that does not exist, or a line that is not
  usable gets a free row saying why.

### Why use YouTube Scraper?

- **Content research:** see which videos of a channel, a rival brand or a topic get the most views and likes, and how
  often a channel posts.
- **Influencer and creator discovery:** search a topic, add channel details, and get subscribers, country and links
  of every creator found.
- **Trend tracking:** run a search sorted by upload date every day with **Published after** set to yesterday.
- **AI and data projects:** feed titles, descriptions and tags to an AI model or a spreadsheet, through the Apify API
  or MCP.
- **A YouTube Data API alternative:** no API key, no daily quota, results as JSON, CSV or Excel.
- **Low, simple price:** $1.00 per 1,000 videos on the Free plan, less on paid plans, no start fee, channel rows free.

### Common problems with YouTube scrapers, and how this one handles them

| Problem | What YouTube Scraper does |
|---|---|
| Shorts mixed into a "videos only" search | Search results of the other type are dropped and not charged; every video has a `contentType` column |
| View counts rounded to "1.2M" | Exact view and like counts from the video page |
| "2 weeks ago" instead of a date | Exact publish time in ISO 8601 |
| Cut-off descriptions | The full description, plus hashtags and tags as lists |
| Paying for old videos you filter out | **Published after** leaves them out before they are charged; channels stop reading once videos are older |
| Paying for runs that return nothing | No start fee; sources without videos get a free row that says why |

### How to use YouTube Scraper

1. Click **Try for free**.
2. Add **Search terms**, **Channels, playlists and videos**, or both.
3. Optionally set **Maximum videos per source**, **Channel video types**, **Published after** and the search options.
4. Click **Start**. A run with a few sources and 50 videos each usually finishes in under a minute.
5. Download the results as JSON, CSV or Excel, or use them through the API.

### Input

```json
{
  "searchQueries": ["lofi hip hop"],
  "urls": ["https://www.youtube.com/@NASA"],
  "maxVideosPerSource": 10
}
```

Daily trend check: this week's most viewed regular videos on a topic, with the creators' channel details.

```json
{
  "searchQueries": ["iphone review"],
  "searchType": "videos",
  "searchSort": "views",
  "searchUploadDate": "week",
  "maxVideosPerSource": 50,
  "includeChannelDetails": true
}
```

Several channels: every video, Short and live stream of the last 30 days.

```json
{
  "urls": ["@NASA", "https://www.youtube.com/@SpaceX", "https://www.youtube.com/channel/UCLA_DiR1FfKNvjuUpBHmylQ"],
  "channelTabs": ["videos", "shorts", "streams"],
  "publishedAfter": "30 days",
  "maxVideosPerSource": 500
}
```

| Field | What it does |
|---|---|
| `searchQueries` | Words or phrases to search on YouTube, one per line. |
| `urls` | Channels (`@NASA`, `https://www.youtube.com/@NASA`, `/channel/UC…`, `/c/…`, `/user/…`), playlists (`https://www.youtube.com/playlist?list=…`) and videos (`watch`, `youtu.be`, `shorts`, `live` links). |
| `maxVideosPerSource` | At most this many videos per search term, per channel video type and per playlist (1-10,000, default 50). |
| `channelTabs` | Which channel videos to read: `videos`, `shorts`, `streams` (default `videos`). |
| `publishedAfter` | Keep only videos published on or after this date (`2026-01-31`) or within this period (`7 days`, `3 months`). |
| `searchType` | Search results: `any`, `videos` (regular videos and live streams, no Shorts) or `shorts`. |
| `searchSort` | Search order: `relevance`, `date` or `views`. |
| `searchUploadDate` | Search results uploaded within: `any`, `hour`, `today`, `week`, `month`, `year`. |
| `includeChannelDetails` | Add subscribers, country, links and the other channel details to search, playlist and single-video results (each channel is read once per run, free). |
| `proxyConfiguration` | Connection used to open YouTube. The default Apify Proxy works for most runs; switch to residential if YouTube stops answering. |

Add at least one search term or one address.

### Output

One row per video (`type: "video"`), one row per channel read from **Channels** (`type: "channel"`), and free rows
that explain lines without videos. Example video row:

```json
{
  "type": "video",
  "source": "channel",
  "query": "https://www.youtube.com/@NASA",
  "videoId": "K8DG7LUTbaM",
  "url": "https://www.youtube.com/watch?v=K8DG7LUTbaM",
  "title": "Who Can Be a NASA Astronaut? Myth or Fact",
  "contentType": "video",
  "viewCount": 73531,
  "likeCount": 1587,
  "durationSeconds": 64,
  "publishedAt": "2026-11-16T19:05:29.000Z",
  "description": "Who can be a NASA astronaut? The answer may be different than you think. …",
  "hashtags": [],
  "keywords": [],
  "category": "Science & Technology",
  "thumbnailUrl": "https://i.ytimg.com/vi/K8DG7LUTbaM/maxresdefault.jpg",
  "isFamilySafe": true,
  "channelId": "UCLA_DiR1FfKNvjuUpBHmylQ",
  "channelName": "NASA",
  "channelUrl": "https://www.youtube.com/channel/UCLA_DiR1FfKNvjuUpBHmylQ",
  "channelHandle": "@NASA",
  "channelSubscribers": 15100000,
  "channelVerified": true,
  "channelDescription": "NASA's mission is to pioneer the future in space exploration, …",
  "channelCountry": null,
  "channelTotalViews": 1136489313,
  "channelVideoCount": 6203,
  "channelJoinedAt": "2008-06-03",
  "channelLinks": ["https://nasa.gov", "https://x.com/nasa", "https://instagram.com/nasa"],
  "channelAvatarUrl": "https://yt3.googleusercontent.com/…",
  "message": null,
  "scrapedAt": "2026-11-19T10:04:03.260Z"
}
```

Every row has the same columns; columns that do not apply are `null` (or an empty list). Channel rows carry the
channel columns and no video columns. Free rows have `type` `no_results`, `not_found`, `blocked`, `invalid` or
`skipped`, and `message` says what happened and what to do. Subscriber, total view and video counts are the rounded
numbers YouTube shows (for example 15.1M becomes 15100000); view and like counts of videos are exact.

The **Videos** view of the dataset shows the main video columns, the **Channels** view the channel columns. The
`OUTPUT` record of the run summarizes rows by type, videos left out by date and the number of requests.

### How much does YouTube Scraper cost?

You pay per saved video. There is no start fee, and channel rows and explanation rows are free.

| Apify plan | Price per 1,000 videos |
|---|---|
| Free | $1.00 |
| Bronze | $0.90 |
| Silver | $0.80 |
| Gold and higher | $0.70 |

Example: 5 channels with their last 100 videos each are 500 videos, which cost $0.50 on the Free plan. Videos left
out by **Published after** or by the search type are not charged. Set a **maximum cost per run** in the run options to
cap what a run can spend: when it is reached, the run stops cleanly and sources it could not pay for come back as free
`skipped` rows.

### Tips

- For a daily check of new videos, use **Published after** `1 day` (or `2 days` to be safe): channels stop reading as
  soon as their videos are older, so the run stays short and cheap.
- To read only the newest search results, set **Search sort order** to **Upload date**.
- Large runs: a run reads several sources at the same time, so many sources finish faster than one very long one. For
  more than about 5,000 videos, set **Timeout** in the run options to 2 hours (7,200 seconds) or more. If a run reaches
  its timeout it stops cleanly, keeps every video already saved, and lists the sources it could not read as free
  `skipped` rows.
- A video found by several sources is saved once, under the first source that found it.
- Comment counts and the comments themselves are not included.
- If many rows come back as `blocked`, run again later or set the proxy to residential.

### Is it legal to scrape YouTube?

The Actor collects only data YouTube shows publicly to visitors who are not logged in, and never private or
age-restricted content. Channel names, handles, descriptions and links can be **personal data** when a channel
belongs to a person. If you store or process them, you need a lawful basis under the data protection laws that apply
to you (for example the GDPR in the EU or the UK GDPR), and you must respect the rights of the people in the data. Do
not use the data for spam or harassment, and respect the copyright of the videos and thumbnails. You are responsible
for how you use the results; when in doubt, ask a lawyer.

### Questions and feedback

Open an issue on the **Issues** tab; we answer within 2 working days.

# Actor input Schema

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

Words to search on YouTube, one per line, for example lofi hip hop or iphone 17 review. Each search term returns the videos YouTube shows for it, up to the maximum below.

## `urls` (type: `array`):

One per line: a channel (@NASA, https://www.youtube.com/@NASA or a /channel/ address), a playlist address, or a video or Shorts address. A channel returns its details and its latest videos; a playlist returns its videos in order.

## `maxVideosPerSource` (type: `integer`):

The run saves at most this many videos for each search term, channel and playlist. For a channel the limit counts each video type separately (Videos, Shorts, Live).

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

Which lists to read from each channel, newest first: regular videos, Shorts, or past and current live streams.

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

Keep only videos published on or after this date, or within this period (for example 7 days). Channels stop reading once their videos are older. Videos left out are not charged.

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

Every kind of video, regular videos only, or Shorts only.

## `searchSort` (type: `string`):

Order of search results: most relevant, newest first, or most viewed.

## `searchUploadDate` (type: `string`):

Only search results uploaded within this period.

## `includeChannelDetails` (type: `boolean`):

Adds each channel's subscribers, verified badge, country, total views and links to videos found by search terms, playlists and video addresses. Channel sources always include them. Makes the run a little slower; no extra charge.

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

Apify Proxy settings. The default works for most runs; switch to residential proxies if YouTube stops answering.

## Actor input object example

```json
{
  "searchQueries": [
    "lofi hip hop"
  ],
  "urls": [
    "https://www.youtube.com/@NASA"
  ],
  "maxVideosPerSource": 10,
  "channelTabs": [
    "videos"
  ],
  "searchType": "any",
  "searchSort": "relevance",
  "searchUploadDate": "any",
  "includeChannelDetails": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

No description

# 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": [
        "lofi hip hop"
    ],
    "urls": [
        "https://www.youtube.com/@NASA"
    ],
    "maxVideosPerSource": 10,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("earlytern/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": ["lofi hip hop"],
    "urls": ["https://www.youtube.com/@NASA"],
    "maxVideosPerSource": 10,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("earlytern/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": [
    "lofi hip hop"
  ],
  "urls": [
    "https://www.youtube.com/@NASA"
  ],
  "maxVideosPerSource": 10,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call earlytern/youtube-scraper --silent --output-dataset

```

## MCP server setup

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