# YouTube Shorts Video Scraper (`scraperforge/youtube-shorts-scraper`) Actor

- **URL**: https://apify.com/scraperforge/youtube-shorts-scraper.md
- **Developed by:** [ScraperForge](https://apify.com/scraperforge) (community)
- **Categories:** Automation, Lead generation, Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.99 / 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.

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

## 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

## YouTube Shorts Scraper

A powerful Apify Actor for scraping YouTube Shorts videos from channels, usernames, or by keyword search. Extract comprehensive video metadata including views, likes, comments, channel information, and more.

### Why Choose Us?

- **Comprehensive Data Extraction**: Get detailed information about each Shorts video including title, views, likes, comments, channel details, and more
- **Flexible Input Support**: Works with channel URLs, usernames (with or without @), and keywords for searching Shorts
- **Smart Proxy Management**: Automatic proxy fallback system (no proxy → datacenter → residential) with retry logic
- **Bulk Processing**: Process multiple channels/keywords in a single run
- **Sorting Options**: Sort results by newest, oldest, most viewed, or most liked
- **Production Ready**: Built with Apify SDK for reliable cloud execution

### Key Features

- **Multiple Input Types**: 
  - Channel URLs (e.g., `https://www.youtube.com/@MrBeast/shorts`)
  - Usernames (e.g., `@MrBeast` or `MrBeast`)
  - Keywords (searches YouTube Shorts by keyword)
- **Proxy Fallback System**: Automatically switches between proxy types if requests are blocked
- **Comprehensive Metadata**: Extracts title, views, likes, comments, channel info, subscribers, duration, and more
- **Sorting**: Sort results by date (newest/oldest) or engagement (most viewed/most liked)
- **Bulk Processing**: Process multiple inputs in a single actor run
- **Error Handling**: Robust error handling with detailed logging

### Input

#### Input Schema

```json
{
  "startUrls": [
    { "url": "mrbeast" },
    { "url": "@MrBeast" },
    { "url": "https://www.youtube.com/@MrBeast/shorts" },
    { "url": "funny shorts" }
  ],
  "maxResults": 50,
  "sortOrder": "newest",
  "maxComments": 0,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
````

#### Input Fields

- **startUrls** (required): Array of channel URLs, usernames, or keywords to scrape
  - Channel URLs: `https://www.youtube.com/@ChannelName/shorts`
  - Usernames: `@ChannelName` or `ChannelName`
  - Keywords: Any search term (e.g., `funny shorts`)
- **maxResults** (optional, default: 50): Maximum number of Shorts videos to scrape per input (1-1000)
- **sortOrder** (optional, default: "newest"): How to sort results
  - `"newest"`: Sort by date (newest first)
  - `"oldest"`: Sort by date (oldest first)
  - `"most_viewed"`: Sort by view count (highest first)
  - `"most_liked"`: Sort by likes (highest first)
- **maxComments** (optional, default: 0): Maximum comments to extract per video (currently tracks comment count only)
- **proxyConfiguration** (optional): Proxy settings
  - `useApifyProxy`: Set to `true` to use Apify proxy (default: `false` for direct connection)
  - Actor automatically falls back to datacenter then residential proxy if requests are blocked

### Output

#### Output Format

Each video is saved as a separate item in the dataset with the following structure:

```json
{
  "title": "Giving Trick-or-Treaters Weirder and Weirder Gifts",
  "id": "R7MkZL5i3FQ",
  "url": "https://www.youtube.com/watch?v=R7MkZL5i3FQ",
  "thumbnailUrl": "https://i.ytimg.com/vi/R7MkZL5i3FQ/hqdefault.jpg",
  "viewCount": 64493572,
  "date": "2025-11-07",
  "likes": 909841,
  "dislikes": null,
  "channelName": "MrBeast",
  "channelUrl": "https://www.youtube.com/@MrBeast",
  "numberOfSubscribers": 450000000,
  "duration": "0:27",
  "commentsCount": 7171,
  "commentsTurnedOff": false
}
```

#### Output Fields

- **title**: Video title
- **id**: YouTube video ID
- **url**: Full YouTube video URL
- **thumbnailUrl**: Video thumbnail image URL
- **viewCount**: Number of views
- **date**: Publication date (YYYY-MM-DD format)
- **likes**: Number of likes
- **dislikes**: Always null (YouTube no longer shows dislikes)
- **channelName**: Channel name
- **channelUrl**: Channel URL
- **numberOfSubscribers**: Channel subscriber count
- **duration**: Video duration (H:MM:SS or M:SS format)
- **commentsCount**: Number of comments
- **commentsTurnedOff**: Boolean indicating if comments are disabled

### 🚀 How to Use the Actor (via Apify Console)

1. Log in at https://console.apify.com and go to **Actors**
2. Find the **youtube-shorts-scraper** actor and click it
3. Configure inputs:
   - Add channel URLs, usernames, or keywords in the `startUrls` field
   - Set `maxResults` to limit how many videos per input
   - Choose `sortOrder` for result sorting
   - Configure proxy settings if needed
4. Run the actor
5. Monitor logs in real time to see progress
6. Access results in the **OUTPUT** tab
7. Export results to JSON or CSV

### Best Use Cases

- **Content Research**: Analyze Shorts performance across multiple channels
- **Trend Analysis**: Search for trending Shorts by keywords
- **Competitor Analysis**: Monitor competitor channels' Shorts content
- **Data Collection**: Build datasets of Shorts videos for analysis
- **Content Discovery**: Find Shorts videos by topic or keyword

### Frequently Asked Questions

**Q: Can I scrape private channels?**\
A: No, the actor only scrapes publicly available Shorts videos.

**Q: What happens if a channel has no Shorts?**\
A: The actor will return an empty result for that input and continue processing other inputs.

**Q: How does the proxy fallback work?**\
A: If proxy is enabled and a request fails, the actor automatically tries datacenter proxy, then residential proxy, with 3 retries at each level.

**Q: Can I search for Shorts by keyword?**\
A: Yes! Simply provide a keyword as an input (e.g., "funny shorts") and the actor will search YouTube Shorts for matching videos.

**Q: What's the maximum number of results I can get?**\
A: The `maxResults` parameter allows up to 1000 videos per input. For multiple inputs, you'll get up to `maxResults` for each.

**Q: How are results sorted?**\
A: By default, results are sorted by newest first. You can change this using the `sortOrder` parameter.

### Support and Feedback

For issues, questions, or feedback, please contact support through the Apify platform.

### Cautions

- Data is collected only from **publicly available sources**
- No data is taken from private accounts or password-protected content
- The end user is responsible for ensuring legal compliance (spam laws, privacy, data protection, etc.)
- Respect YouTube's Terms of Service and rate limits
- Use proxies responsibly and in accordance with Apify's proxy usage policies

# Actor input Schema

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

Where to scrape Shorts from. Add one or more: channel handles (@MrBeast), usernames (mrbeast), full URLs (https://www.youtube.com/@MrBeast), or search keywords (e.g. funny shorts).

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

Maximum number of Shorts to scrape per channel or keyword. Ranges from 1 to 10,000. Higher = more data, longer run.

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

Filter by publish date. Use a date (YYYY-MM-DD) or relative time (e.g. 7 days, 2 weeks, 1 month, 1 year). Leave empty to include all Shorts.

## `sortOrder` (type: `string`):

Order of results: Newest first, Oldest first, or by Popularity (views).

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

Turn on Apify Proxy for more reliable scraping (useful in EU or restricted regions). Off = direct connection; works in most regions and for Apify QA.

## Actor input object example

```json
{
  "startUrls": [
    "rainbowicecream9780"
  ],
  "maxResults": 10,
  "sortOrder": "newest",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

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

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

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

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "YouTube Shorts Video Scraper",
        "version": "0.1",
        "x-build-id": "Ni6AYbANSFJp97o5W"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/scraperforge~youtube-shorts-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-scraperforge-youtube-shorts-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/scraperforge~youtube-shorts-scraper/runs": {
            "post": {
                "operationId": "runs-sync-scraperforge-youtube-shorts-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/scraperforge~youtube-shorts-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-scraperforge-youtube-shorts-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": [
                    "startUrls"
                ],
                "properties": {
                    "startUrls": {
                        "title": "📍 Channels or keywords (required)",
                        "type": "array",
                        "description": "Where to scrape Shorts from. Add one or more: channel handles (@MrBeast), usernames (mrbeast), full URLs (https://www.youtube.com/@MrBeast), or search keywords (e.g. funny shorts).",
                        "default": [
                            "rainbowicecream9780"
                        ],
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxResults": {
                        "title": "🔢 Max Shorts per channel",
                        "minimum": 1,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Maximum number of Shorts to scrape per channel or keyword. Ranges from 1 to 10,000. Higher = more data, longer run.",
                        "default": 10
                    },
                    "publishedAfter": {
                        "title": "📅 Only Shorts published after",
                        "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$|^(\\d+)\\s*(day|week|month|year)s?$",
                        "type": "string",
                        "description": "Filter by publish date. Use a date (YYYY-MM-DD) or relative time (e.g. 7 days, 2 weeks, 1 month, 1 year). Leave empty to include all Shorts."
                    },
                    "sortOrder": {
                        "title": "↕️ Sort by",
                        "enum": [
                            "newest",
                            "popular",
                            "oldest"
                        ],
                        "type": "string",
                        "description": "Order of results: Newest first, Oldest first, or by Popularity (views).",
                        "default": "newest"
                    },
                    "proxyConfiguration": {
                        "title": "🌐 Proxy configuration",
                        "type": "object",
                        "description": "Turn on Apify Proxy for more reliable scraping (useful in EU or restricted regions). Off = direct connection; works in most regions and for Apify QA."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
