# YouTube Video Scraper (`happy_b/youtube-video-scraper`) Actor

Get complete metadata for any YouTube video with exact view counts, ISO timestamps, tags, and 37 fields.

- **URL**: https://apify.com/happy\_b/youtube-video-scraper.md
- **Developed by:** [Happy B](https://apify.com/happy_b) (community)
- **Categories:** Social media, Videos
- **Stats:** 4 total users, 3 monthly users, 85.7% runs succeeded, 2 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

### What is YouTube Video Scraper?

YouTube Video Scraper extracts complete metadata from any public YouTube video with **exact numbers, ISO 8601 timestamps, and 37 fields per video** — ready for spreadsheets, dashboards, and analysis pipelines.

Give us video URLs, get 37 fields per video. Every number is an exact integer. Every date is ISO 8601. No "1.2M" guesses, no "10 months ago" approximations.

#### Data points extracted per video

| Field | Description | Example |
|-------|-------------|---------|
| `videoId` | YouTube video ID | `dQw4w9WgXcQ` |
| `title` | Video title | `Rick Astley - Never Gonna Give You Up` |
| `publishedAt` | ISO 8601 upload timestamp | `2009-10-25T06:57:33Z` |
| `viewCount` | Exact view count | `1600000000` |
| `likeCount` | Exact like count | `18000000` |
| `commentCount` | Exact comment count | `3200000` |
| `duration` | ISO 8601 duration | `PT3M33S` |
| `durationSeconds` | Duration in seconds | `213` |
| `tags` | Video tags | `rick astley,never gonna give you up,music` |
| `categoryId` | YouTube category ID | `10` |
| `categoryName` | Human-readable category | `Music` |
| `definition` | Video quality | `hd` |
| `type` | Video type | `video` / `shorts` |
| `channelName` | Channel display name | `Rick Astley` |
| `channelSubscriberCount` | Exact subscriber count | `15200000` |
| `channelIsVerified` | Verification badge | `true` |


**37 fields per video. Every number exact. Every date ISO 8601.**

### Why use this scraper?

#### Our Actor vs Top YouTube Video Actors

| Field | Us | Streamers |
|-------|:--:|:---------:|
| `publishedAt` ISO 8601 exact | ✅ | ❌ relative |
| `likeCount` exact integer | ✅ | ❌ |
| `commentCount` exact integer | ✅ | ❌ |
| `subscriberCount` exact integer | ✅ | ❌ abbreviated |
| `tags` | ✅ | ❌ |
| `categoryId` + `categoryName` | ✅ | ❌ |
| `topicDetails` | ✅ | ❌ |
| `definition` (HD/SD) | ✅ | ❌ |
| `hasCaptions` | ✅ | ❌ |
| `isAgeRestricted` | ✅ | ❌ |
| `durationSeconds` integer | ✅ | ❌ |
| Bulk videos | ✅ | ✅ |
| Channel metadata per video | ✅ | ❌ |
| **Price per 1,000 videos** | **$0.50** | **$4.00** |

- **8x cheaper than Streamers** — $0.50 vs $4.00 per 1,000 videos. Volume discounts down to $0.25 on Business plan.
- **One row, full picture** — 37 fields per video, flat CSV. No second API call, no post-processing to parse "1.2K" into a number. Download, open in Excel, done.
- **Incremental delivery** — Results appear in your dataset within seconds. Export anytime, don't wait for the run to finish.
- **Any URL format** — Paste youtube.com/watch, youtu.be, /shorts/, /embed/, /live/ links, or bare 11-character video IDs. We handle them all.

### Use cases

- **Video analysis** — Get exact view counts, like counts, and engagement ratios for any set of videos. Compare performance across videos, channels, or categories.
- **Content research** — Analyze tags, categories, durations, and descriptions to understand what makes top-performing videos succeed.
- **ML training data** — Structured JSON with 37 fields per video, ready for recommendation systems, trend analysis, or content classification.
- **Competitive intel** — Track competitor videos: when they posted, what tags they used, how many views they got. Run on a schedule for ongoing monitoring.
- **Ad placement** — Filter videos by monetization status, content category, and audience size for ad targeting decisions.
- **Fact-checking and journalism** — Get exact publish dates, view counts, and engagement numbers for citation in articles and reports.

### How much does it cost?

Each video counts as one item.

| Plan | Price per 1,000 items |
|------|----------------------|
| Free | $0.50 |
| Starter | $0.45 |
| Scale | $0.40 |
| Business | $0.25 |

| Scenario | Items | Cost |
|----------|-------|------|
| 10 videos | 10 | $0.005 |
| 100 videos | 100 | $0.05 |
| 1,000 videos | 1,000 | $0.50 |
| 10,000 videos | 10,000 | $5.00 |

Apify also charges a small compute cost (CU) for the actor's runtime — typically under $0.01 for most runs.

### Input

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `videoUrls` | string[] | *required* | YouTube video URLs or bare video IDs. Supports youtube.com/watch?v=, youtu.be/, /shorts/, /embed/, /live/ formats, or 11-character IDs like `dQw4w9WgXcQ`. Duplicates are automatically removed. |
| `includeChannelInfo` | boolean | `true` | Attach channel metadata (subscribers, description, country) to each video row. Disable to reduce output size. |

### Output example

Each item in the dataset is a single video:

```json
{
  "videoId": "dQw4w9WgXcQ",
  "title": "Rick Astley - Never Gonna Give You Up (Official Music Video)",
  "description": "The official video for 'Never Gonna Give You Up' by Rick Astley...",
  "descriptionLinks": "https://RickAstley.lnk.to/NeverGonnaGiveYouUpID",
  "thumbnailUrl": "https://i.ytimg.com/vi/dQw4w9WgXcQ/maxresdefault.jpg",
  "publishedAt": "2009-10-25T06:57:33Z",
  "duration": "PT3M33S",
  "durationSeconds": 213,
  "viewCount": 1600000000,
  "likeCount": 18000000,
  "commentCount": 3200000,
  "tags": "rick astley,never gonna give you up,music video,80s",
  "categoryId": 10,
  "categoryName": "Music",
  "topicDetails": "https://en.wikipedia.org/wiki/Lifestyle_(sociology)",
  "definition": "hd",
  "hasCaptions": true,
  "isAgeRestricted": false,
  "privacyStatus": "public",
  "commentsTurnedOff": false,
  "hashtags": "",
  "type": "video",
  "order": 0,
  "channelId": "UCuAXFkgsw1L7xaCfnd5JJOw",
  "channelName": "Rick Astley",
  "channelUsername": "@RickAstleyYT",
  "channelUrl": "https://www.youtube.com/channel/UCuAXFkgsw1L7xaCfnd5JJOw",
  "channelDescription": "Official YouTube channel for Rick Astley...",
  "channelCountry": "GB",
  "channelJoinedAt": "2006-10-07T14:15:41Z",
  "channelSubscriberCount": 15200000,
  "channelTotalViews": 3500000000,
  "channelTotalVideos": 186,
  "channelAvatarUrl": "https://yt3.ggpht.com/...",
  "channelBannerUrl": "https://yt3.googleusercontent.com/...",
  "channelIsVerified": true,
  "scrapeTimestamp": "2026-04-02T12:00:00Z"
}
````

Download your results as **JSON**, **CSV**, **Excel**, **XML**, or **HTML** from the dataset tab, or access them via the [Apify API](https://docs.apify.com/api/v2#/reference/datasets).

### Good to know

**Subscriber counts are exact integers.** Other scrapers return abbreviated text like "1.2M" that you have to parse. We return `1200000` — ready for calculations, sorting, and filtering.

**Channel info is repeated on every row.** This makes every CSV row self-contained. If you're analyzing videos from multiple channels, the channel data is already there. Disable `includeChannelInfo` to reduce output size if you don't need it.

**Duplicates are removed automatically.** If you paste the same video URL twice (or the same video in different URL formats), we deduplicate before processing so you're never charged twice.

**Videos are batched automatically.** If you provide more than 50 videos, they're processed in batches of 50. Results stream into the dataset as each batch completes.

### Integrations

Connect this actor to your workflow with [Apify integrations](https://docs.apify.com/platform/integrations):

- **Make (Integromat)** — trigger workflows when new data is available
- **Zapier** — push videos to Google Sheets, Slack, or databases
- **GitHub** — store results in repositories
- **Google Drive** — export directly to spreadsheets
- **Webhooks** — notify your API when the run completes
- **Apify API** — programmatic access for custom pipelines

### Legal and personal data

This actor extracts publicly available data from YouTube. You should ensure your use of the extracted data complies with YouTube's [Terms of Service](https://www.youtube.com/t/terms), applicable data protection laws (GDPR, CCPA), and your jurisdiction's regulations regarding web scraping and data processing.

Video and channel information is public content visible to anyone on YouTube.

### Support

Found a bug or have a feature request? Open an issue on the [Issues tab](https://apify.com/happy_b/youtube-video-scraper/issues/open) or contact us through Apify messaging.

# Actor input Schema

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

YouTube video URLs or video IDs. Supports youtube.com/watch?v=, youtu.be/, /shorts/, /embed/, /live/ formats, or bare 11-character video IDs.

## `includeChannelInfo` (type: `boolean`):

Attach full channel metadata (subscribers, description, country, etc.) to each video row. Disable to reduce output size.

## Actor input object example

```json
{
  "videoUrls": [
    "dQw4w9WgXcQ"
  ],
  "includeChannelInfo": true
}
```

# Actor output Schema

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

No description

## `metadata` (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 = {
    "videoUrls": [
        "dQw4w9WgXcQ"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("happy_b/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 = { "videoUrls": ["dQw4w9WgXcQ"] }

# Run the Actor and wait for it to finish
run = client.actor("happy_b/youtube-video-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "videoUrls": [
    "dQw4w9WgXcQ"
  ]
}' |
apify call happy_b/youtube-video-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=happy_b/youtube-video-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "YouTube Video Scraper",
        "description": "Get complete metadata for any YouTube video with exact view counts, ISO timestamps, tags, and 37 fields.",
        "version": "0.1",
        "x-build-id": "slNBmVUdUFb9es8kZ"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/happy_b~youtube-video-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-happy_b-youtube-video-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/happy_b~youtube-video-scraper/runs": {
            "post": {
                "operationId": "runs-sync-happy_b-youtube-video-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/happy_b~youtube-video-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-happy_b-youtube-video-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "videoUrls"
                ],
                "properties": {
                    "videoUrls": {
                        "title": "Video URLs",
                        "type": "array",
                        "description": "YouTube video URLs or video IDs. Supports youtube.com/watch?v=, youtu.be/, /shorts/, /embed/, /live/ formats, or bare 11-character video IDs.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "includeChannelInfo": {
                        "title": "Include Channel Info",
                        "type": "boolean",
                        "description": "Attach full channel metadata (subscribers, description, country, etc.) to each video row. Disable to reduce output size.",
                        "default": true
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
