# Youtube Scraper - Cheapest (`socialdataapi/youtube-scraper`) Actor

Youtube Scraper collects video, Shorts and livestream data from YouTube search terms or URLs: title, views, likes, channel, subscribers, publish date and optional subtitles. Many filters. No API key or login. Export as JSON, CSV or Excel, or use the API.

- **URL**: https://apify.com/socialdataapi/youtube-scraper.md
- **Developed by:** [Social Data API](https://apify.com/socialdataapi) (community)
- **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 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 — Views, Likes, Channel Data and Transcripts

YouTube Scraper pulls video, Shorts and livestream data from YouTube search results or a direct URL, with no official Data API or API key involved. Each row returns the title, view count, likes, channel name and subscriber count, publish date, and an optional transcript. **No YouTube account or login is needed.** Every response is structured JSON, ready to pass directly to an LLM, index into a vector store, or feed a content-research pipeline. Start with one search term, then point it at a whole channel.

***

### What data can I extract with YouTube Scraper?

Using this YouTube video data API, you will be able to extract the following YouTube video data:

| 🎬 Title and video type | 👁️ View count | 👍 Like count | 💬 Comment count |
| --- | --- | --- | --- |
| 📅 Publish date | ⏱️ Duration | 📺 Channel name and subscriber count | 🆔 Channel and video IDs |
| 🏷️ Hashtags and description links | 💬 Available caption languages | 📝 Full transcript (if requested) | ⚖️ Creative Commons flag |

***

### How to use YouTube Scraper

Anyone who needs a youtube search results scraper that also pulls direct URLs points this Actor at a keyword or a link and reads typed JSON back.

**Copy to your AI assistant:**

```text
YouTube Scraper (Apify Actor ID: socialdataapi/youtube-scraper, https://apify.com/socialdataapi/youtube-scraper) returns YouTube video, Shorts, and livestream data as structured JSON: title, view count, like count, comment count, channel name, subscriber count, publish date, duration, and an optional transcript. Use it whenever someone needs YouTube video metadata without cookies, a login, or the official Data API - researching which video angles perform well for a keyword, tracking a channel's upload cadence and growth, or feeding transcripts into a RAG pipeline. Inputs: searchTerms (array, keywords to search), startUrls (array, a video, Shorts, channel, playlist, or results-page URL per entry), maxVideos/maxShorts/maxStreams (integers, per-entry caps, 0 skips that content type, default 10/0/0; free plan: up to 20 items per run across all search terms/URLs and content types combined, and 200 per month), downloadSubtitles (boolean, default false), subtitlesLanguage (default "en"), subtitlesFormat ("srt", "text", or "timestamp", default "srt"), fetchMetadata (boolean, default true, turn off for a faster listing-only run), maxPagesPerQuery (integer safety cap, default 50), plus date/type/length filters and a set of live-detected feature filters (HD, 4K, HDR, 360°, 3D, VR180, captions, location, Creative Commons, purchased). Every row is billed under the same row_result event. A channel or playlist URL in startUrls auto-expands to its member videos, each enriched with the same full field set as a search result.
```

#### YouTube Scraper MCP Server: use these Actors from ChatGPT, Claude or Cursor

Connect your AI assistant to Apify's MCP server and it can find and call this Actor on its own — no glue code, no scraping logic in your prompts.

```bash
claude mcp add --transport http apify "https://mcp.apify.com?tools=socialdataapi/youtube-scraper"
```

#### Step by step

1. [Create a free Apify account](https://console.apify.com/sign-up).
2. Open [**YouTube Scraper**](https://apify.com/socialdataapi/youtube-scraper) in the Apify Store.
3. Add one or more search keywords, or paste a video, Shorts, channel, playlist, or results-page URL. To scrape YouTube channel videos directly, paste the channel URL into Direct URLs.
4. Click **Start** (or send your API request).
5. Download or stream your results in JSON, CSV, Excel, or XML.

#### How to scale YouTube Scraper to bulk

Add more entries to the search-term or direct-URL list — each one runs independently in the same call. As a youtube playlist video scraper, a single playlist or channel URL in that list expands automatically to its member videos, up to your video and Shorts caps, so bulk channel or playlist extraction never needs a separate run per channel. For a recurring content-tracking job, schedule the run on Apify's built-in scheduler so the same list re-scrapes on its own.

***

### ✨ Features

YouTube Scraper fetches clean, structured video, Shorts, and livestream data from YouTube. It's ideal for content research, channel-growth tracking, and feeding transcripts into an AI pipeline. Used as a youtube scraper without api limits, it returns the same field set whether the request came from a search term or a direct URL.

It extracts, per item:

- **Title and type** – whether the row is a regular video or a Short
- **View, like and comment counts** – the engagement numbers for the item
- **Channel name, ID and subscriber count** – who published it and how big the channel is
- **Duration and publish date** – how long the video runs and when it went up
- **Hashtags and description links** – metadata pulled straight from the description
- **Transcript** – full caption text, in SRT, plain text, or timestamped JSON, when requested

⚡ A channel or playlist URL expands to its member videos automatically, each one enriched with the same fields as a search result.

***

### Use cases 💡

- **Content strategist** — compare view and like counts across a keyword to spot what already performs.
- **Channel-growth analyst** — track subscriber count and upload date over repeated runs.
- **Competitive researcher** — read hashtags and description links to see how rivals structure metadata.
- **Accessibility team** — run it as a youtube video transcript extractor to audit caption coverage across a channel.
- **AI agent builder** — index transcripts into a vector store for a YouTube research assistant.

Building an AI agent? [Connect YouTube Scraper over MCP](#mcp-integration-for-ai-agents) and let it call the actor on its own.

***

### Why choose this actor?

1. **One Actor, three content types.** A youtube views likes subscribers scraper at heart, it collects videos, Shorts and livestreams in the same run, each capped independently by its own per-entry limit.
2. **Four ways into the same pipeline.** A direct URL can be a video, a channel, a playlist, or a results page — all four resolve to the exact same enriched row shape as a search result, so there's no thinner discovery-only output to work around.
3. **No API key, ever.** This youtube video data scraper runs with no Google Cloud project, no OAuth, and no API key — scale it up without touching a quota dashboard.

***

### ⬇️ Input

YouTube Scraper accepts search keywords, direct URLs, or both; nothing is strictly required — leaving everything empty falls back to a built-in example search.

| Parameter | Required | Type | Description | Example value |
| --- | --- | --- | --- | --- |
| `searchTerms` | No | array | YouTube search keywords; the Actor runs a full scrape for each term. | `["Crawlee"]` |
| `maxVideos` | No | integer | Max regular (non-Shorts, non-live) videos per search term. `0` skips long-form videos. Default `10`. | `10` |
| `maxShorts` | No | integer | Used as a youtube shorts data scraper setting, caps how many Shorts to collect per keyword. `0` skips Shorts. Default `0`. | `5` |
| `maxStreams` | No | integer | Max live/upcoming streams per search term. `0` ignores live content. Default `0`. | `0` |
| `startUrls` | No | array | Direct video/Shorts, channel, playlist, or results-page URLs; channels/playlists expand to member videos. | `["https://www.youtube.com/@Crawlee"]` |
| `downloadSubtitles` | No | boolean | Download subtitles/transcripts when available. Default `false`. | `true` |
| `saveSubtitlesToKvs` | No | boolean | Also store each transcript in the key-value store. Default `false`. | `false` |
| `subtitlesLanguage` | No | string | Preferred caption/transcript language code. Default `"en"`. | `"en"` |
| `preferAutoGenerated` | No | boolean | Prefer auto-generated captions over manually uploaded ones. Default `false`. | `false` |
| `subtitlesFormat` | No | string | Transcript output format: `srt`, `text`, or `timestamp`. Default `"srt"`. | `"srt"` |
| `sortingOrder` | No | string | Sort the final dataset by `relevance`, `date`, `viewCount`, or `rating` (post-processing). | `"viewCount"` |
| `dateFilter` | No | string | YouTube's "Upload date" filter: `hour`, `today`, `week`, `month`, `year`. | `"month"` |
| `videoTypeFilter` | No | string | `video` restricts search results to standard long-form videos only. | `""` |
| `lengthFilter` | No | string | YouTube's length preset: `short` (under 4 min), `medium` (4–20 min), `long` (over 20 min). | `"medium"` |
| `isHD` / `is4K` / `isHDR` / `isLive` / `is360` / `is3D` / `isVR180` / `hasCC` / `isCreativeCommons` / `isPurchased` / `hasLocation` | No | boolean | Live-detected feature filters. Each defaults to `false`. | `true` |
| `publishedAfter` | No | string | Only include videos published after this date (`YYYY-MM-DD`). | `"2025-01-01"` |
| `sortBy` | No | string | Post-processing sort field: `date`, `viewCount`, or `likes`. | `"viewCount"` |
| `fetchMetadata` | No | boolean | When on (default), opens each video's page for likes, comments, subscriber count, and other enrichment fields. | `true` |
| `maxPagesPerQuery` | No | integer | Safety limit on search-result pages paginated per search term. Default `50`. | `50` |
| `proxyConfiguration` | No | object | Apify Proxy settings. By default every request uses the residential group from the first attempt. | `{"useApifyProxy": false}` |

#### Free plan limits

Free plan: up to 20 items per run (all search terms, URLs, videos, Shorts and streams together) and 200 per month; paid plans have no limit.

#### Example input

```json
{
  "searchTerms": ["Crawlee", "web scraping tutorial"],
  "maxVideos": 15,
  "maxShorts": 5,
  "maxStreams": 0,
  "startUrls": ["https://www.youtube.com/@Crawlee"],
  "downloadSubtitles": true,
  "saveSubtitlesToKvs": false,
  "subtitlesLanguage": "en",
  "preferAutoGenerated": false,
  "subtitlesFormat": "srt",
  "sortingOrder": "viewCount",
  "dateFilter": "month",
  "lengthFilter": "medium",
  "isHD": true,
  "publishedAfter": "2025-01-01",
  "sortBy": "viewCount",
  "fetchMetadata": true,
  "maxPagesPerQuery": 50,
  "proxyConfiguration": { "useApifyProxy": false }
}
```

***

### ⬆️ Output

Every video, Short, or stream becomes one typed, normalized JSON row with the same core field set on every run — this youtube video metadata extractor adds the three transcript fields only when a transcript was actually downloaded. Results export as JSON, CSV, Excel, or XML, and every row is billed under the same charged event.

#### Example output

```json
{
  "title": "Crawlee Tutorial: Build Your First Web Scraper in Node.js",
  "type": "video",
  "id": "aBcDeFgHiJk",
  "url": "https://www.youtube.com/watch?v=aBcDeFgHiJk",
  "thumbnailUrl": "https://i.ytimg.com/vi/aBcDeFgHiJk/hq720.jpg",
  "viewCount": 48213,
  "date": "2025-03-14T09:00:00.000Z",
  "likes": 1872,
  "location": null,
  "channelName": "Crawlee",
  "channelUrl": "https://www.youtube.com/channel/UCRK2h2WV5NgHmoO2HXsxSww",
  "channelUsername": "Crawlee",
  "channelId": "UCRK2h2WV5NgHmoO2HXsxSww",
  "numberOfSubscribers": 12400,
  "duration": "00:14:22",
  "commentsCount": 96,
  "commentsTurnedOff": false,
  "text": "Learn how to build your first web scraper with Crawlee in this step-by-step tutorial...",
  "descriptionLinks": [{ "url": "https://crawlee.dev", "text": "https://crawlee.dev" }],
  "subtitles": ["en", "es"],
  "order": 0,
  "fromYTUrl": "https://www.youtube.com/results?search_query=Crawlee",
  "hashtags": ["#webscraping", "#nodejs"],
  "isCreativeCommons": false,
  "isPurchased": false,
  "transcript": "1\n00:00:00,000 --> 00:00:03,500\nWelcome back to another tutorial...",
  "transcriptLanguage": "en",
  "transcriptFormat": "srt"
}
```

***

### How does it work?

YouTube Scraper sends plain HTTP requests that mimic real browser traffic instead of calling the official Data API or opening a real browser — this is a youtube scraper no api key setup needs at all. It reads the same public search, channel, playlist and watch pages any logged-out visitor can open, and paginates through results the same way a browser does when you scroll for more. Every request goes through Apify's residential proxy group from the first attempt, with retries on a fresh session if YouTube blocks it, falling back to a direct connection only when residential proxy access itself is unavailable on the account. If a video page loads but YouTube serves a degraded response missing the view count or duration, the Actor retries that one video over a fresh residential connection rather than shipping zeros. Parsing failures are isolated per item, so one bad result never drops a whole page of videos already collected.

***

### How do you integrate YouTube Scraper into your stack?

YouTube Scraper works with what you already use: a REST API from any language, MCP for AI agents, and no-code automation tools.

#### MCP integration for AI agents

Connect your AI assistant to Apify's MCP server and it can find and call YouTube Scraper directly, once it's in your account, with no scraping logic written into your prompts.

```bash
claude mcp add --transport http apify "https://mcp.apify.com?tools=socialdataapi/youtube-scraper"
```

This registers Apify's MCP server as a tool your agent can call directly, and the agent finds this Actor itself through the server's search and call-actor tools. Works the same way in Claude Code, Cursor, and Windsurf.

#### No-code tools (n8n, Make, LangChain)

In n8n, use the Apify node's "Run an Actor" operation, or the HTTP Request node pointed at the Actor's run-sync endpoint with your Apify token. In Make, use the Apify app's "Run an Actor" module followed by "Get Dataset Items" to pull the rows into your scenario. In LangChain, install `langchain-apify` and call `ApifyActorsTool()` once the Actor is in your account — no ID needs to be hardcoded.

***

### Is it legal to scrape YouTube videos?

Scraping publicly available YouTube video and channel metadata is generally legal — it's the same data any logged-out visitor can view on youtube.com. YouTube Scraper returns only publicly visible data: no private videos, no sign-in-only content, and no individual comment text or commenter identities. A channel name or handle can still identify an individual creator, so GDPR-style rules apply once you store that data in bulk. Consult legal counsel if your use case involves bulk storage of personal data.

***

### Frequently asked questions

#### What fields does YouTube Scraper return?

The top fields are title, view count, like count, channel name, and subscriber count, among 25-plus fields per video. See [the data fields section](#what-data-can-i-extract-with-youtube-scraper) for the full list.

#### Does YouTube Scraper require a YouTube account or login?

No. Only public video and channel data is extracted. No credentials are needed — the only token you use is your own Apify token.

#### What happens if a video is private, deleted, or age-restricted?

The Actor skips it rather than fabricating data. If the video page can't be fetched at all, that URL is logged as failed and produces no row; if the page loads but YouTube's own player data is thin or missing, the row falls back to whatever partial metadata is available and unavailable fields are left null.

#### Can I scrape multiple YouTube videos, channels, or playlists at once?

Yes. Search terms and direct URLs are both arrays — mix keyword searches with video, channel, playlist, and results-page URLs in the same run.

#### Does YouTube Scraper work with Claude, ChatGPT, and other AI agent tools?

Yes — it is available through Apify's MCP server. Run `claude mcp add --transport http apify "https://mcp.apify.com?tools=socialdataapi/youtube-scraper"` to register it in Claude Code, Cursor, or Windsurf. Any agent that can call an HTTP endpoint can also use the REST API directly.

#### How does YouTube Scraper compare to the official YouTube Data API?

The official YouTube Data API v3 needs a registered Google Cloud project, an API key, and runs against a daily unit quota; YouTube Scraper needs none of that and returns view count, likes, comments, and channel info together in one row instead of separate API calls. Both approaches return structured data — choose the official API when you need access strictly under Google's own terms and already have quota to spare.

#### Does YouTube Scraper return data in a format LLMs can use directly?

Yes. Typed, normalized JSON with consistent field names and no HTML parsing or selectors involved — pass it straight to an LLM, index it into a vector store, or feed it to an agent tool with no transformation step.

#### What happens when YouTube changes its layout or anti-bot system?

This Actor's maintainers update it when YouTube's pages change — your calls keep returning the same JSON schema with no changes on your end.

#### Can I use YouTube Scraper without managing proxies or browser infrastructure?

Yes. Proxy rotation runs on the Actor's side, and there is no browser to configure in the first place — it reads pages with plain HTTP requests. You send one request and get structured JSON back, with no proxy accounts or infrastructure to maintain.

#### Which fields work best for AI training data and RAG indexing?

For RAG, index the transcript and the full description as retrievable content, with title, channel name, and publish date as metadata for citations and filtering. For training or analytics data, view count, likes, comment count, and duration are typed numeric fields with consistent structure across every record.

***

### Your feedback

Found a bug or missing a field in YouTube Scraper? Open an issue from the Actor's page in Apify Console — reports that include the search term or URL and the run's log output are the quickest to reproduce and fix.

# Actor input Schema

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

Enter one or more YouTube search keywords (for example "Crawlee", "fitness workout"). The actor will run a full scrape for each term and collect matching videos, shorts, and streams.

## `maxVideos` (type: `integer`):

Set how many regular (non‑Shorts, non‑live) videos to scrape for each search term. Use 0 to skip long‑form videos completely and focus only on Shorts or streams. Free plan: up to 20 items per run (all search terms, URLs, videos, Shorts and streams together) and 200 per month; paid plans have no limit.

## `maxShorts` (type: `integer`):

Control how many YouTube Shorts (vertical clips) to collect per keyword. Use 0 if you do not want to include Shorts in your dataset. Free plan: up to 20 items per run (all search terms, URLs, videos, Shorts and streams together) and 200 per month; paid plans have no limit.

## `maxStreams` (type: `integer`):

Limit how many live or upcoming streams are scraped for each search term. Use 0 to ignore live content entirely. Free plan: up to 20 items per run (all search terms, URLs, videos, Shorts and streams together) and 200 per month; paid plans have no limit.

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

Provide direct YouTube video/Shorts URLs (single video), channel URLs (e.g. youtube.com/@handle, /channel/UC..., /c/name, /user/name — expands to up to maxVideos videos + maxShorts Shorts from that channel), playlist URLs (?list=... — expands to up to maxVideos+maxShorts member videos), or a youtube.com/results?search_query=... URL (runs the same search flow as a searchTerms entry). Every discovered video gets the same full metadata as a search result.

## `downloadSubtitles` (type: `boolean`):

Download video subtitles/transcripts when available. When enabled, the actor will try to fetch caption tracks and optionally full transcripts for each scraped video.

## `saveSubtitlesToKvs` (type: `boolean`):

When enabled, every downloaded transcript is stored in the default Apify key‑value store under its own key (e.g. "transcript-VIDEO_ID") so you can download large subtitle files separately from the main dataset.

## `subtitlesLanguage` (type: `string`):

Choose the primary language for subtitles/transcripts (e.g. en, es, fr, de). The actor will look for this language first and fall back to available tracks where possible.

## `preferAutoGenerated` (type: `boolean`):

If turned on, the actor will prefer auto‑generated subtitles over manually uploaded caption tracks. This can increase coverage for less localized videos at the cost of some accuracy.

## `subtitlesFormat` (type: `string`):

Decide how transcripts should look in the output: classic SRT (with timestamps), simple plain text, or structured timestamped JSON that is easy to post‑process programmatically.

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

Sort the final dataset by relevance (original order), upload date, view count, or rating. Applied as post-processing for reliable results.

## `dateFilter` (type: `string`):

Apply YouTube’s built‑in "Upload date" filter: last hour, today, this week, this month, or this year — just like clicking the filter in the YouTube interface.

## `videoTypeFilter` (type: `string`):

Filter search results to only standard long-form videos (excludes Shorts and live streams from the search-term flow). This filters the SEARCH results; to scrape a channel or playlist directly, add its URL under Direct URLs instead.

## `lengthFilter` (type: `string`):

Use YouTube’s length presets to keep only short clips, medium‑length videos, or long‑form content over 20 minutes.

## `isHD` (type: `boolean`):

Only include HD videos (720p or higher). The actor inspects YouTube's streaming formats to verify resolution before including the video.

## `hasCC` (type: `boolean`):

Only include videos that have at least one proper closed‑caption track (not just auto‑generated). Great for accessibility‑critical workflows.

## `isCreativeCommons` (type: `boolean`):

Filter for videos marked by YouTube as Creative Commons licensed. This can help discover content that is more remix‑friendly (always check final license conditions yourself).

## `is3D` (type: `boolean`):

Keep only stereoscopic 3D videos that YouTube flags as special 3D content.

## `isLive` (type: `boolean`):

Restrict results to live or live‑style content. Combine this with maxStreams to build focused dashboards of live events or streams.

## `isPurchased` (type: `boolean`):

Best-effort filter for purchased/paid content. YouTube rarely exposes this in scraped data, so results may be limited. Use for niche use cases only.

## `is4K` (type: `boolean`):

Keep only videos that offer at least one 2160p (4K) stream in their available formats.

## `is360` (type: `boolean`):

Filter results down to immersive 360° videos (spherical / equirectangular projection) that can be explored in all directions.

## `hasLocation` (type: `boolean`):

Only keep videos where YouTube exposes explicit location metadata in the player response (for example city/country information).

## `isHDR` (type: `boolean`):

Limit the dataset to High Dynamic Range (HDR) videos, detected from color information and HDR‑specific flags in the available formats.

## `isVR180` (type: `boolean`):

Filter for VR180 immersive content suitable for VR headsets when YouTube marks the video as VR180.

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

Only include videos published after this date. Pick a date in the calendar (absolute format YYYY-MM-DD). Leave empty to include all dates.

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

After scraping, optionally sort the final dataset by a chosen field (date, viewCount, or likes) so that the default dataset view is ordered exactly how you like it.

## `fetchMetadata` (type: `boolean`):

When enabled (default), the actor opens each video's page to fill in likes, comments, subscriber count, full description, and other enrichment fields. Turn this off for a faster, lighter run that returns only the fields available directly from the search results (title, URL, thumbnail, view count, channel name).

## `maxPagesPerQuery` (type: `integer`):

Safety limit on how many search-result pages the actor will paginate through for a single search term before stopping, even if `maxVideos`/`maxShorts`/`maxStreams` have not been reached yet.

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

Select the proxy setup for this actor. By default every request uses Apify's residential proxy group from the first attempt, with up to 3 retries on a fresh session if YouTube blocks the request; it only falls back to a direct connection if residential proxy access itself is unavailable on the account. Supplying your own proxy here overrides this and is used as-is.

## Actor input object example

```json
{
  "searchTerms": [
    "Crawlee"
  ],
  "maxVideos": 10,
  "maxShorts": 0,
  "maxStreams": 0,
  "startUrls": [],
  "downloadSubtitles": false,
  "saveSubtitlesToKvs": false,
  "subtitlesLanguage": "en",
  "preferAutoGenerated": false,
  "subtitlesFormat": "srt",
  "sortingOrder": "",
  "dateFilter": "",
  "videoTypeFilter": "",
  "lengthFilter": "",
  "isHD": false,
  "hasCC": false,
  "isCreativeCommons": false,
  "is3D": false,
  "isLive": false,
  "isPurchased": false,
  "is4K": false,
  "is360": false,
  "hasLocation": false,
  "isHDR": false,
  "isVR180": false,
  "publishedAfter": "",
  "sortBy": "",
  "fetchMetadata": true,
  "maxPagesPerQuery": 50,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

One row per scraped video/Short/stream with title, URL, view/like/comment counts, channel info, duration, publish date, description, hashtags, and detected feature flags (HD, 4K, HDR, etc.).

## `transcripts` (type: `string`):

Transcript text for each video, saved only when 'Download subtitles' and 'Save subtitles to key-value store' are both enabled. One key-value store record per video, named transcript-<videoId>.

# 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": [
        "Crawlee"
    ],
    "startUrls": [],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("socialdataapi/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": ["Crawlee"],
    "startUrls": [],
    "proxyConfiguration": { "useApifyProxy": False },
}

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

```

## MCP server setup

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