# YouTube Videos & Shorts (`datasaurus/youtube-videos`) Actor

A powerful tool for extracting detailed information about YouTube videos, shorts and live broadcasts. Fast and Reliable.

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

## Pricing

from $2.00 / 1,000 result items

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## YouTube Videos Scraper

A powerful tool for extracting detailed information about YouTube videos, shorts and live broadcasts.

Supply keywords, channel handles, URLs or IDs and receive structured JSON data including titles, descriptions, views, likes, comment counts, duration and channel details.

Checkout our other YouTube Scrapers: [YouTube Comments](https://apify.com/datasaurus/youtube-comments) | [YouTube Channels](https://apify.com/datasaurus/youtube-channels)

n8n node: [n8n](https://www.npmjs.com/package/n8n-nodes-youtube-videos-rental)

### 🎯 Features

**Flexible search options:**

- Keyword search: `minecraft tutorials`
- Channel handle: `@SailingLaVagabonde`
- Channel URL: `https://www.youtube.com/@SailingLaVagabonde`
- Channel ID URL: `https://www.youtube.com/channel/UCZdQjaSoLjIzFnWsDQOv4ww`
- Channel ID: `UCZdQjaSoLjIzFnWsDQOv4ww`
- Video URL: `https://www.youtube.com/watch?v=YwRjEruEsm4`
- Video ID: `3VdiAJvpAuA` — a video, Short or live-broadcast ID

**Detailed video data:**

- Title, description, publication date and thumbnail URLs
- View, like and comment counts
- Duration, definition and caption availability
- License, privacy status and embedding settings
- Tags, topic categories and category ID
- Channel ID, title and handle
- Default language and audio language where available
- Live-broadcast status

### Use cases

- **Video research** — collect descriptions, tags and topics for selected videos.
- **Content discovery** — find videos using keywords or channel inputs.
- **Engagement analysis** — compare views, likes and comment counts.
- **Channel content analysis** — examine a channel's videos and available metadata.
- **Video monitoring** — compare engagement statistics across runs.

### 🚀 Getting started

1. Create or sign in to your Apify account.
2. Enter keywords, channel handles, URLs or IDs, or individual video URLs or IDs.
3. Run the Actor and collect your data.

**Apify Free Trial users are limited to 10 results per channel.**

### 📥 Input parameters

```json
{
  "channel_or_video": ["@SailingLaVagabonde"],
  "max_results": 100
}
```

See the **Input** tab for all configuration options and result-limit behaviour.

### 📤 Output fields

Video data is returned as structured JSON. Example:

```json
{
  "videoId": "ZcIFmDp2WYU",
  "title": "Big Changes Ahead: Our Plans for the New Year!",
  "description": "A massive thanks to all the creators who've kindly supported this episode with their content, obtained under fair use.",
  "publishedAt": "2025-01-22T22:00:37Z",
  "thumbnail": "https://i.ytimg.com/vi/ZcIFmDp2WYU/sddefault.jpg",
  "viewCount": 515050,
  "likeCount": 21012,
  "commentCount": 1413,
  "favoriteCount": 0,
  "duration": "PT43M27S",
  "definition": "hd",
  "caption": "false",
  "licensedContent": true,
  "liveBroadcastContent": "none",
  "projection": "rectangular",
  "uploadStatus": "processed",
  "privacyStatus": "public",
  "license": "youtube",
  "embeddable": true,
  "publicStatsViewable": true,
  "topicCategories": [
    "https://en.wikipedia.org/wiki/Lifestyle_(sociology)",
    "https://en.wikipedia.org/wiki/Tourism"
  ],
  "tags": [
    "sailing",
    "2025",
    "new year",
    "ocean",
    "family",
    "goals",
    "la vagabonde",
    "japan",
    "vlog",
    "australia",
    "q&a",
    "family vlog",
    "routine",
    "healthy",
    "fit",
    "sailboat",
    "sail",
    "sea",
    "Micronesia",
    "solomon islands",
    "spa",
    "funny"
  ],
  "categoryId": "19",
  "channelId": "UCZdQjaSoLjIzFnWsDQOv4ww",
  "channelTitle": "Sailing La Vagabonde",
  "channelHandle": "@sailinglavagabonde",
  "defaultLanguage": "en",
  "defaultAudioLanguage": "en"
}
```

Statistics are sample values. Actual results contain the information available when the Actor runs.

### 💡 Usage tips

1. Use keywords for discovery, channel inputs for channel-based collection, or video URLs and IDs for specific videos.
2. Use `max_results` to limit the number of videos fetched; free-trial limits still apply.
3. Channel identifiers and names are included with each video.
4. The example timestamp ends in `Z`, indicating UTC. Duration uses ISO 8601 format: `PT43M27S` means 43 minutes and 27 seconds.

### AI agents and integrations

Connect chat clients such as **Claude and ChatGPT** to Apify through the [Apify MCP server](https://docs.apify.com/integrations/mcp) to discover and run eligible Actors.

Structured records let agents work directly with video IDs, descriptions, engagement counts and channel details.

Example requests for an agent configured to use this Actor:

> Collect video titles, publication dates and engagement counts from this YouTube channel.

> Return descriptions, durations and topic categories for these video IDs.

For agent frameworks and API-based integrations, see Apify's [AI integration guides](https://docs.apify.com/integrations/ai). MCP availability depends on the Actor's pricing and permissions.

### ✏️ API access

Access through Apify's API and automation features:

- REST API
- SDK integration
- Webhooks
- Automated workflows

For setup and reference documentation, see the [Apify API documentation](https://docs.apify.com/api/v2).

For workflow automation, see the [n8n integration guide](https://docs.apify.com/integrations/n8n).
n8n node: [n8n](https://www.npmjs.com/package/n8n-nodes-youtube-videos-rental)

For bugs, additional fields or supported input requests, use the Actor's **Issues** tab.

[Browse all Datasaurus scrapers](https://apify.com/datasaurus).

# Actor input Schema

## `channel_or_video` (type: `array`):

Enter a channel handle (@username), channel ID, channel URL, video ID, video URL

## `max_results` (type: `integer`):

Maximum number of videos to fetch

## Actor input object example

```json
{
  "channel_or_video": [
    "@YouTube",
    "UCZdQjaSoLjIzFnWsDQOv4ww",
    "https://www.youtube.com/c/YouTube"
  ],
  "max_results": 50
}
```

# Actor output Schema

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

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "channel_or_video": [
        "@YouTube",
        "UCZdQjaSoLjIzFnWsDQOv4ww",
        "https://www.youtube.com/c/YouTube"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("datasaurus/youtube-videos").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 = { "channel_or_video": [
        "@YouTube",
        "UCZdQjaSoLjIzFnWsDQOv4ww",
        "https://www.youtube.com/c/YouTube",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("datasaurus/youtube-videos").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 '{
  "channel_or_video": [
    "@YouTube",
    "UCZdQjaSoLjIzFnWsDQOv4ww",
    "https://www.youtube.com/c/YouTube"
  ]
}' |
apify call datasaurus/youtube-videos --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,datasaurus/youtube-videos"
        }
    }
}
```

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/P1xPwEXwe3OlrNl2y/builds/q3q2VCv1EV2XpW39Y/openapi.json
