# YouTube Video Scraper — Views, Likes & Metadata (`dottti/youtube-video-scraper`) Actor

Scrape any YouTube video: title, channel, view count, like count, duration, publish date, category, keywords and thumbnail. No API key, no quota.

- **URL**: https://apify.com/dottti/youtube-video-scraper.md
- **Developed by:** [Mohanad Alshaka](https://apify.com/dottti) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 video scrapeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## YouTube Video Scraper — Views, Likes & Metadata

Scrape any YouTube video without an API key, a quota, or a login: title, channel, view count, **like count**, duration, publish date, category, keywords and thumbnail.

Paste watch URLs, `youtu.be` links, Shorts, embeds or bare video IDs. All forms work and can be mixed in one run.

### Output

```json
{
  "videoId": "dQw4w9WgXcQ",
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
  "channelName": "Rick Astley",
  "channelId": "UCuAXFkgsw1L7xaCfnd5JJOw",
  "channelUrl": "https://www.youtube.com/channel/UCuAXFkgsw1L7xaCfnd5JJOw",
  "viewCount": 1815622496,
  "likeCount": 19390234,
  "lengthSeconds": 213,
  "publishDate": "2009-10-24T23:57:33-07:00",
  "category": "Music",
  "keywords": ["rick astley", "nggyu"],
  "isLive": false,
  "unavailable": false,
  "availableCaptionLanguages": ["es-419", "de-DE", "en"],
  "thumbnail": "https://i.ytimg.com/...",
  "description": "..."
}
```

### Three things this gets right

**Like counts still work.** Likes left the YouTube watch page during 2026 — they are in neither embedded blob. Scrapers that never noticed now return `null` or a stale guess. This Actor reads them from YouTube's own internal endpoint, verified live: 19,390,234 on the video above.

Because that costs a second request per video, `includeLikes` is a switch. Turn it off and each video costs one request instead of two.

**An unavailable video is an answer, not a failure.** Private, deleted and region-blocked videos are reported with `unavailable` carrying YouTube's own reason, and the run continues. The row keeps the same field set as every other row, so exports stay rectangular.

**The parser reports its own breakage.** Required fields are checked after extraction. If YouTube changes the page and a title or view count stops arriving, the run logs it and `RUN_SUMMARY` counts it, instead of quietly emitting a dataset full of nulls. A live stream with no view count is explicitly not treated as breakage.

### Input

| Field | What it does |
| --- | --- |
| `videos` | URLs or 11-character IDs. Watch, youtu.be, Shorts, embed and live all accepted. |
| `includeLikes` | Fetch like counts. Costs one extra request per video. On by default. |
| `includeDescription` | Turn off for a compact dataset. |
| `language` / `country` | Two-letter codes. Country affects availability and regional blocking. |
| `maxItems` | Hard cap on videos processed, and therefore on cost. |

#### Example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://youtu.be/9bZkp7q19f0",
    "jNQXAC9IVRw"
  ],
  "includeLikes": true
}
```

### Proxies and reliability

YouTube intermittently answers datacenter IPs with **"Sign in to confirm you're not a bot"**. Measured on Apify infrastructure on 14 September 2026: some videos returned normally, others were refused, with and without datacenter proxy. Routing through residential IPs returned every video successfully.

Two things follow, and both are handled rather than hidden:

**A blocked video is never charged.** A bot check means this Actor's IP was refused. The row is still written to the dataset, flagged `blocked: true` with `error: "blocked_by_youtube"`, so you can see exactly what happened, but no event fires for it. You pay for videos you actually receive.

**A blocked video is not confused with a deleted one.** A private, removed or region-blocked video is a real answer and is reported through `unavailable` with YouTube's own wording. Only the bot check sets `blocked`.

To collect every video reliably, set `proxyConfiguration` to Apify Proxy with `RESIDENTIAL` groups. Note that residential bandwidth is billed at $8/GB and a watch page plus the likes call is roughly 2.4 MB per video, so residential runs carry a real cost. For metadata-only runs, switch `includeLikes` off to roughly halve the bandwidth.

### Notes and limits

- Public video data only. No login, no cookies, no Google account.
- **Transcripts are not included.** Caption *languages* are reported, but the caption tracks themselves now require a proof-of-origin token and return empty without one. Rather than ship a transcript feature that silently returns nothing, it is left out.
- Comment counts are not returned for the same reason: they are no longer on the page. Comments are a separate job needing continuation pagination.
- YouTube throttles bursts with HTTP 429. Requests are spaced and retried with exponential backoff, honouring `Retry-After`.

### Development

```bash
npm install
npm test
node src/main.js
```

# Actor input Schema

## `videos` (type: `array`):

YouTube video URLs or bare 11-character IDs. Watch, youtu.be, Shorts, embed and live URLs all work and can be mixed.

## `includeLikes` (type: `boolean`):

Like counts left the watch page in 2026 and now need a second request per video to YouTube's internal API. Turn this off to halve the requests when you only need views and metadata.

## `includeDescription` (type: `boolean`):

Descriptions can be long. Turn off for a compact dataset.

## `language` (type: `string`):

Two-letter language code used for titles and metadata.

## `country` (type: `string`):

Two-letter country code. Affects availability and regional blocking.

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

Hard cap on videos processed, and therefore on cost.

## `requestDelayMs` (type: `integer`):

YouTube throttles bursts with HTTP 429. Raise this if the log shows throttling.

## `maxRetries` (type: `integer`):

Retries with exponential backoff on 429 and 5xx, honouring Retry-After when present.

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

YouTube refuses its internal endpoint from many datacenter IPs, so like counts need a proxy on most infrastructure. Video metadata works without one. Enable Apify Proxy here to collect likes reliably.

## Actor input object example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "includeLikes": true,
  "includeDescription": true,
  "language": "en",
  "country": "US",
  "maxItems": 1000,
  "requestDelayMs": 400,
  "maxRetries": 4,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

Video ID and URL, title, description, channel name/ID/URL, view count, like count, duration in seconds, live flag, publish and upload dates, category, family-safe and unlisted flags, keywords, thumbnail, and the caption languages the video offers.

## `runSummary` (type: `string`):

Videos requested, delivered, unavailable, and any that parsed incompletely.

# 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 = {
    "videos": [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("dottti/youtube-video-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 = { "videos": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"] }

# Run the Actor and wait for it to finish
run = client.actor("dottti/youtube-video-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 '{
  "videos": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ]
}' |
apify call dottti/youtube-video-scraper --silent --output-dataset

```

## MCP server setup

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