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

YouTube Scraper SD - YouTube Scraper is a powerful tool that extracts video titles, channels, views, durations, upload times and URLs from YouTube search results by keyword, filters, channel, playlist or video URL - YouTube search and video data extractor for research.

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

## Pricing

from $1.19 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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 - search results, channel videos and video data from YouTube

The YouTube Scraper collects public YouTube data and returns it as a clean dataset you can download as JSON, CSV or Excel, or read through the Apify API. No login, no cookies and no code: give the YouTube Scraper your input, start it and get structured YouTube data for research, monitoring, analytics or lead generation. You pay only for the results you receive.

> ⭐ **Featured by Neuro Scraper: [Facebook Reels Scraper](https://apify.com/neuro-scraper/facebook-reels-scraper)** - scrape Facebook Reels from any page, profile or reel link with exact views and plays, every reaction type (Like, Love, Care, Haha, Wow, Sad, Angry), comments, shares, captions, music and video links. No login and no cookies. [Try the Facebook Reels Scraper →](https://apify.com/neuro-scraper/facebook-reels-scraper)

The YouTube Scraper collects YouTube videos the way you find them: by keyword search with YouTube's own filters, or from channel, playlist, video and search URLs. Each video becomes one clean row.

You get the title, URL, channel, view count, duration, upload time, thumbnail and description snippet. Switch on full details and the YouTube Scraper adds likes, exact views, full description, publish date, category, tags and chapters.

No login, no Google account and no YouTube Data API key or quota. The YouTube Scraper reads what any logged-out visitor sees.

#### What the YouTube Scraper does

Type the words you would type into the YouTube search box. The YouTube Scraper opens the results page, applies the filters you chose and then pages through the results until it has as many videos as you asked for.

Filters are YouTube's own: result type (Videos or Shorts), upload date, duration, features such as Live, 4K, HD or Subtitles, and the Relevance or Popularity order.

Add start URLs to mix in other sources. A channel URL gives the channel's videos, a playlist URL its videos, a video URL one detailed row, and a search URL is scraped as it is.

#### Who uses the YouTube Scraper

Marketers and SEO teams who track which videos rank for their keywords, and how many views the top results have.

Agencies and brands who research competitors, find creators in a niche, or monitor new uploads about a product.

Researchers and data scientists who need video datasets with titles, channels and view counts for analysis.

Developers who feed YouTube search data into dashboards, alerts or AI pipelines through the Apify API.

### Input fields for the YouTube Scraper

Give `searchTerms`, `startUrls`, or both. Everything else has a default, so the YouTube Scraper runs on its first click with the prefilled search.

| Field | Type | Default | Meaning |
|---|---|---|---|
| `searchTerms` | array | `lofi music` | Search terms, one per line |
| `startUrls` | array | empty | Video, channel, playlist or search-results URLs |
| `maxResults` | integer | `20` | Videos per search term and per channel, playlist or search URL |
| `maxItems` | integer | empty | Optional cap for the whole run |
| `searchType` | select | `videos` | `videos`, `shorts`, or `all` (no type filter) |
| `uploadDate` | select | `any` | `today`, `week`, `month`, `year` |
| `duration` | select | `any` | `short` (under 3 min), `medium` (3-20 min), `long` (over 20 min) |
| `features` | multi-select | none | Live, 4K, HD, Subtitles/CC, Creative Commons, 360, VR180, 3D, HDR, Location, Purchased |
| `sortingOrder` | select | `relevance` | `relevance` or `popularity` |
| `scrapeVideoDetails` | boolean | `false` | Open each video's page for full details |
| `proxyConfiguration` | object | Apify RESIDENTIAL, US | Proxy used for every request |

The filters apply to search terms. A search URL keeps the filters that are already in it.

### Output of the YouTube Scraper

Every video row of the YouTube Scraper carries these fields. With `scrapeVideoDetails` on, the detail fields are added to each row.

| Field | Meaning |
|---|---|
| `videoId`, `url` | Video id and link (`/shorts/` link for Shorts) |
| `title` | Video title |
| `channelName`, `channelId`, `channelUrl` | Uploader channel |
| `viewCount`, `viewCountText` | Views as a number and as YouTube shows them |
| `duration`, `durationSeconds` | Length as text and in seconds |
| `publishedTimeText` | Relative upload time, e.g. "2y ago" |
| `descriptionSnippet` | Text snippet YouTube shows under the result |
| `thumbnailUrl` | Largest thumbnail |
| `badges` | Labels such as "New", "4K", "CC" |
| `isLive`, `isShort` | Live stream / Short flags |
| `rank` | Position in the results of that search or URL |
| `searchTerm`, `sourceType`, `sourceUrl` | What produced the row |
| `scrapedAt` | ISO timestamp |
| Detail fields | `description`, `likes`, `commentCountText`, `publishDate`, `uploadDate`, `category`, `keywords`, `hashtags`, `channelHandle`, `channelSubscribers`, `chapters`, `captionLanguages` ... |

Shorts found through the Shorts filter come with id, URL, title, view label and thumbnail only, because that is what YouTube lists for them. Turn on details to add channel, duration, likes and dates.

Export the YouTube Scraper dataset as CSV, JSON, Excel, XML or HTML, or read it through the Apify API.

#### Example row

```json
{"videoId": "lTRiuFIWV54", "url": "https://www.youtube.com/watch?v=lTRiuFIWV54", "title": "1 A.M Study Session [lofi hip hop]", "channelName": "Lofi Girl", "viewCount": 136670672, "viewCountText": "136,670,672 views", "duration": "1:01:14", "durationSeconds": 3674, "publishedTimeText": "6y ago", "isShort": false, "rank": 1, "searchTerm": "lofi music", "sourceType": "search"}
```

### How to run the scraper

Open the YouTube Scraper, type your search terms, set `maxResults`, pick filters if you need them, and press Start. Results appear in the dataset as the run pages through YouTube.

For a list of known sources, leave the search empty and paste channel, playlist or video URLs into `startUrls`.

Turn on `scrapeVideoDetails` when you need likes, publish dates or full descriptions. It opens one extra page per video, so it is slower.

#### Measured speed of the scraper

All numbers below come from local test runs of the YouTube Scraper on a home connection:

- 20 videos for "lofi music" in 3-4 seconds, from 2 result pages.
- 60 videos for "pubg mobile" with three filters (Videos, This week, Popularity) in 6-7 seconds, from 4 pages.
- 50 Shorts for "street food" with the Shorts filter in 3-4 seconds, from 3 pages.
- 13 rows from a channel, a playlist, a video and a search URL, all with full details, in 15 seconds.

The first results page of a Videos search held 21 videos in our test. Without a type filter, YouTube mixes regular videos with Shorts shelves on the same page.

### How the scraper works

The YouTube Scraper follows YouTube's own public web flow. It loads the results page and reads the page configuration from it: client version, visitor data, language and region.

Each filter is applied by following the link that the results page itself publishes for it. The YouTube Scraper never types a filter code into its source.

Nothing is hardcoded, so a YouTube release does not silently break the YouTube Scraper. If a value cannot be read, the log names it and the run moves on to the next source.

### The scraper limits, stated plainly

The YouTube Scraper sees what a logged-out visitor sees. Private videos, members-only videos and age-gated content that needs a login are out of reach.

YouTube decides how many results a search has. When it stops returning new pages, the YouTube Scraper stops too and logs why.

View counts on channel and playlist pages are YouTube's short labels ("2.7M"), converted to numbers. Search results usually show exact counts; full details always give the exact count.

Upload times in lists are relative ("2y ago"). For an exact date, switch on `scrapeVideoDetails`, which adds `publishDate`.

YouTube localises results to the country of the IP address; our local test runs were served as region BD. On the Apify platform the YouTube Scraper's default proxy is residential in the United States, so you get US results unless you pick another proxy country.

### The scraper pricing

The YouTube Scraper uses pay-per-event pricing: you pay per dataset row (event "result"), plus the Apify platform usage of your run. The run stops at your `maxItems` or at the charge limit you set.

Free-plan users get up to 30 rows per run, which is enough to test the YouTube Scraper on real data. The current price per 1,000 results is on the Pricing tab.

### Using the scraper in a workflow

Schedule the YouTube Scraper to run daily for your keywords and you get a ranking history of the top videos for each term.

Send the dataset to Google Sheets, Slack or your database with the Apify integrations, or through Make, Zapier and n8n. A webhook can start your own automation when a run finishes.

Developers run the YouTube Scraper from Python or JavaScript with the Apify API client:

```python
from apify_client import ApifyClient
client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("neuro-scraper/youtube-scraper").call(run_input={"searchTerms": ["electric cars"], "maxResults": 50, "uploadDate": "month"})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["rank"], item["viewCount"], item["title"])
```

The schema of a row does not change between runs, so an integration built today keeps working.

#### Keyword research with the scraper

Run the YouTube Scraper for twenty related keywords with `maxResults: 20`, export to Excel, and sort by `viewCount` to see which topics pull the biggest audiences.

Group by `channelName` to find the creators who own a niche, then pass their channel URLs to the channel scraper below for their full profile.

#### Competitor monitoring with the scraper

Put your competitors' channel URLs into `startUrls` with `maxResults: 10`. Each scheduled run of the YouTube Scraper returns their ten newest uploads with views and upload time.

Compare two runs a week apart and you see which new videos took off. The `videoId` field is stable, so joining runs in a spreadsheet or a database is a one-line match.

#### Mixing searches and URLs in one run

One run of the YouTube Scraper can hold many search terms and many URLs at once. Every row says where it came from in `sourceType`, `searchTerm` and `sourceUrl`.

A video that appears in two of your sources is stored once, the first time it is found, so the dataset has no duplicate videos.

### Leave a review

If the YouTube Scraper saved you time, please leave a star rating and a short review on the Actor page. It helps other users choose and tells me what to improve.

Found a problem? Open an issue with the run link and it will be fixed.

### Frequently asked questions

#### Does the scraper need a YouTube API key?

No. The YouTube Scraper does not use the YouTube Data API, so there is no API key and no daily quota.

#### How many results can the scraper return for one search?

As many as YouTube serves for that search, page by page, up to your `maxResults`. In tests the YouTube Scraper collected 60 filtered results from 4 pages in 7 seconds.

#### Can the scraper scrape YouTube Shorts?

Yes. Set `searchType` to `shorts` to use YouTube's Shorts filter, or `all` to keep Shorts shelves mixed with videos. Turn on full details to add likes and dates to each Short.

#### Can I scrape a whole channel with the scraper?

Yes. Paste the channel URL into `startUrls` and set `maxResults`. For the channel's profile fields (country, joined date, total views, links) use the YouTube Channel Scraper.

#### Does the scraper get likes and exact upload dates?

Yes, with `scrapeVideoDetails` on. It opens each video page and adds likes, exact views, publish date, category, tags, hashtags and chapters.

#### Which search filters does the scraper support?

YouTube's own: Videos or Shorts, upload date, duration, features such as Live, 4K, HD and Subtitles, and Relevance or Popularity order. Each filter is read from the results page at run time.

#### Why do some view counts look rounded?

On channel and playlist lists YouTube shows short labels such as "2.7M". The YouTube Scraper converts them to numbers and keeps the label in `viewCountText`. Full details give the exact count.

#### Can I export YouTube search results to Excel or Google Sheets?

Yes. Export the dataset as Excel or CSV from the console, or connect Google Sheets through the Apify integrations so every run lands in a sheet.

#### What happens when a URL is wrong or a channel does not exist?

The YouTube Scraper logs a clear error for that source, for example "channel not found (HTTP 404)" or "playlist not found or private", and continues with the next one. One bad source never fails the run.

#### Do I need my own proxy for the scraper?

No. The YouTube Scraper uses Apify's residential proxy by default. You can choose another proxy in the input.

### Why use the scraper

The YouTube Scraper is a YouTube scraper and YouTube data extractor for anyone who needs public YouTube data as clean data. The YouTube Scraper handles web scraping, proxy rotation and retries for you, so you get a ready dataset instead of raw pages. Use the YouTube Scraper for market research, competitor analysis, lead generation, analytics or monitoring, and export the results to JSON, CSV, Excel or Google Sheets.

- No login and no code: the YouTube Scraper runs on Apify with one click or one API call.
- Pay per result: the YouTube Scraper charges only for rows delivered - no monthly YouTube API fee.
- Complete fields: the YouTube Scraper returns every public field, with a stable schema for automation.
- Integrations: connect the YouTube Scraper to Zapier, Make, n8n, Google Sheets, a webhook or your CRM.

### The scraper use cases

- Market research: the YouTube Scraper collects YouTube data at scale, so you can compare trends across weeks and niches.
- Competitor analysis: run the YouTube Scraper on a schedule and export the dataset to Google Sheets or Excel to watch what competitors publish.
- Lead generation and B2B prospecting: the YouTube Scraper gives a sales or agency team a clean list to load into a CRM.
- Content and social media monitoring: the YouTube Scraper keeps a fresh copy of YouTube data through an Apify schedule and a webhook.
- Analytics and dashboards: send the YouTube Scraper output as JSON through the Apify API into Python, Node.js or a BI tool.
- Academic and data science projects: the YouTube Scraper returns a consistent schema, ready for pandas, R or a notebook.
- Price, product and brand tracking: the YouTube Scraper turns public YouTube data into a dataset you can diff run by run.
- Automation workflows: connect the YouTube Scraper to Zapier, Make or n8n so every new row starts your next step.

### How to run it with the API, Python and Node.js

Start the YouTube Scraper from the Apify Console, or call it from code. The YouTube Scraper returns its dataset as JSON, CSV or Excel. With the Apify API you can run the YouTube Scraper from Python or Node.js, wait for it to finish and read the rows, which makes the YouTube Scraper easy to plug into an automation, a data pipeline or a scheduled export.

1. Open the YouTube Scraper on Apify and fill in the input (or send the same input as JSON to the API).
2. Start the YouTube Scraper. Follow the run log while the YouTube Scraper collects public YouTube data.
3. Download the dataset as CSV, JSON, Excel or XLSX, or let a webhook send it on.
4. Schedule the YouTube Scraper to keep your YouTube data fresh for monitoring and analytics.

### Tips for better results

- Start small: run the YouTube Scraper with a low maximum first, check the fields, then scale up the same input.
- Split big jobs: several smaller YouTube Scraper runs (by keyword, URL list or date) finish faster and are easier to resume.
- Keep a history: name a dataset or use a schedule so each YouTube Scraper run adds to your YouTube data over time.
- Filter early: use the input filters of the YouTube Scraper so you only pay for the YouTube data you really need.
- Automate the hand-off: a webhook or the Zapier and Make integrations can move every YouTube Scraper result straight to Google Sheets, a CRM or a database.
- Watch the run log: the YouTube Scraper writes what it is doing and why an item was skipped, so a surprising result is easy to explain.

### The scraper FAQ

### More scrapers from Neuro Scraper

| Actor | What it extracts |
|---|---|
| ⭐ **[Facebook Reels Scraper](https://apify.com/neuro-scraper/facebook-reels-scraper)** | Facebook Reels with exact views, plays, every reaction type, comments and shares |
| [YouTube Playlist Scraper](https://apify.com/neuro-scraper/youtube-playlist-scraper) | YouTube playlist data with all public fields, exported to JSON, CSV or Excel |
| [YouTube Channel Scraper](https://apify.com/neuro-scraper/youtube-channel-scraper) | YouTube channel data with all public fields, exported to JSON, CSV or Excel |
| [YouTube Comments Scraper](https://apify.com/neuro-scraper/youtube-comments-scraper) | YouTube comments with all public fields, exported to JSON, CSV or Excel |
| [YouTube Shorts Scraper](https://apify.com/neuro-scraper/youtube-shorts-scraper) | YouTube shorts with all public fields, exported to JSON, CSV or Excel |
| [YouTube Transcript Scraper](https://apify.com/neuro-scraper/youtube-transcript-scraper) | YouTube transcript data with all public fields, exported to JSON, CSV or Excel |
| [YouTube Video Details Scraper](https://apify.com/neuro-scraper/youtube-video-details-scraper) | YouTube video details with all public fields, exported to JSON, CSV or Excel |
| [YouTube Video Downloader](https://apify.com/neuro-scraper/youtube-video-downloader) | YouTube video data with all public fields, exported to JSON, CSV or Excel |
| [Snapchat Profile Scraper](https://apify.com/neuro-scraper/snapchat-profile-scraper) | Snapchat profile data with all public fields, exported to JSON, CSV or Excel |
| [Amazon Scraper](https://apify.com/neuro-scraper/amazon-scraper) | Amazon data with all public fields, exported to JSON, CSV or Excel |
| [Instagram Reels Scraper](https://apify.com/neuro-scraper/instagram-reels-scraper) | Instagram reels with all public fields, exported to JSON, CSV or Excel |
| [Facebook Video Details Scraper](https://apify.com/neuro-scraper/facebook-video-details-scraper) | Facebook video details with all public fields, exported to JSON, CSV or Excel |
| [Facebook Reels Scraper Advanced](https://apify.com/neuro-scraper/facebook-reels-scraper-advanced) | Facebook reels  advanced data with all public fields, exported to JSON, CSV or Excel |

# Actor input Schema

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

What you would type into the YouTube search box, one term per line. Example: lofi music

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

Optional. YouTube video URLs (one detailed row each), channel URLs (the channel's videos), playlist URLs (the playlist's videos) or search result URLs (youtube.com/results?search_query=...).

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

How many videos to collect for each search term and each channel, playlist or search URL. The Actor pages through the results until it has this many or YouTube has no more.

## `maxItems` (type: `integer`):

Optional cap on the whole run. Leave empty for no total cap.

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

Search terms only. 'Videos' applies YouTube's Videos filter, 'Shorts' its Shorts filter, 'Videos and Shorts' uses no type filter (YouTube mixes videos and Shorts shelves).

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

Search terms only. YouTube's upload-date filter.

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

Search terms only. YouTube's duration filter: under 3 minutes, 3 - 20 minutes, over 20 minutes.

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

Search terms only. Optional YouTube feature filters (Live, 4K, HD, Subtitles/CC, Creative Commons ...).

## `sortingOrder` (type: `string`):

Search terms only. YouTube's own order options: Relevance (default) or Popularity.

## `scrapeVideoDetails` (type: `boolean`):

Open every video's page and add likes, exact views, full description, publish date, category, tags, hashtags, chapters and subscriber count. One extra page per video - slower.

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

Apify Proxy, RESIDENTIAL group in the United States, is used by default. You can pick another country or group; the run then follows YouTube's answers for that location.

## Actor input object example

```json
{
  "searchTerms": [
    "lofi music"
  ],
  "startUrls": [],
  "maxResults": 20,
  "searchType": "videos",
  "uploadDate": "any",
  "duration": "any",
  "sortingOrder": "relevance",
  "scrapeVideoDetails": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}
```

# 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": [
        "lofi music"
    ],
    "startUrls": [],
    "maxResults": 20,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "US"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("neuro-scraper/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": ["lofi music"],
    "startUrls": [],
    "maxResults": 20,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "US",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("neuro-scraper/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": [
    "lofi music"
  ],
  "startUrls": [],
  "maxResults": 20,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}' |
apify call neuro-scraper/youtube-scraper --silent --output-dataset

```

## MCP server setup

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