# Youtube Posts Scraper (`beautifulscrape/youtube-posts-scraper`) Actor

▶️YouTube🔴 Extract data from YouTube community posts, polls, images, comments, and engagement data from any channel. Ideal for research, trend analysis, and audience insights.

- **URL**: https://apify.com/beautifulscrape/youtube-posts-scraper.md
- **Developed by:** [Beautiful Scrape](https://apify.com/beautifulscrape) (community)
- **Categories:** Social media, Automation, Videos
- **Stats:** 46 total users, 9 monthly users, 100.0% runs succeeded, 2 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

$5.00/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period.You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

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

## 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 Community Posts Scraper

This Apify Actor scrapes community posts from YouTube channels, extracting detailed information including post content, engagement metrics, attachments, and poll data. Perfect for content research, engagement analysis, and social media strategy development.   

### Features

- **Comprehensive Data Extraction**: Scrapes post text, author information, likes, comments, poll choices, images, and videos
- **Multiple Channel Support**: Process multiple YouTube channels in a single run
- **Flexible Limits**: Set maximum number of posts to scrape per channel
- **Rich Metadata**: Captures attachment types (video/image/poll/post), timestamps, and engagement metrics
- **Reliable Scraping**: Uses Camoufox browser automation for robust data extraction

### Output Data

Each scraped post includes the following fields:

| Field | Description |
|-------|-------------|
| `postId` | Unique identifier for the community post |
| `author` | Name of the post creator |
| `postLink` | Direct URL to the post |
| `publishedTime` | Relative time when the post was published (e.g., "2 weeks ago") |
| `timeOfDownload` | Timestamp when the data was scraped |
| `text` | The text content of the post |
| `likesCount` | Number of likes the post received |
| `commentsCount` | Total number of comments on the post |
| `videoLink` | URL to attached video (if applicable) |
| `images` | Array of image URLs attached to the post (if applicable) |
| `pollChoices` | Array of poll choice options (if the post is a poll) |
| `attachmentType` | Type of attachment: `"video"`, `"image"`, `"poll"`, or `"post"` (text-only) |
| `channelUrl` | URL of the YouTube channel the post belongs to |

### Input Configuration

The Actor accepts the following input parameters:

#### Required
- **`start_urls`** (array): List of YouTube channel URLs to scrape. Supports both formats:
  - `https://www.youtube.com/@ChannelName`
  - `https://www.youtube.com/channel/CHANNEL_ID`

#### Optional
- **`max_posts`** (integer, default: 10): Maximum number of posts to scrape per channel. YouTube typically allows up to 200 posts per channel.

### Usage

#### Using Apify Console

1. Go to the Actor page in the Apify Console
2. Click "Start" to open the input configuration
3. Add YouTube channel URLs in the `start_urls` field
4. Optionally set `max_posts` to limit the number of posts scraped
5. Click "Start" to run the Actor
6. Wait for the run to complete and download results from the Dataset


### Example Input

```json
{
  "start_urls": [
    {"url": "https://www.youtube.com/@MrBeast"}
  ],
  "max_posts": 50
}
````

#### Using Apify API

```bash
curl -X POST "https://api.apify.com/v2/acts/YOUR_ACTOR_ID/runs" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "start_urls": [
      {"url": "https://www.youtube.com/@MrBeast"}
    ],
    "max_posts": 50
  }'
```

### Example Output

```json
[
  {
    "postId": "Ugkx-B-xTpQa9uApirojWaZsjkWCUaEzc24y",
    "author": "MrBeast",
    "postLink": "https://www.youtube.com/post/Ugkx-B-xTpQa9uApirojWaZsjkWCUaEzc24y",
    "publishedTime": "11 days ago",
    "timeOfDownload": "19/12/2025, 10:40:43",
    "text": "I just launched a BRAND NEW Feastables product. Watch the video below to see what it is. I promise you'll love it!",
    "likesCount": "93K",
    "commentsCount": "974",
    "videoLink": "https://www.youtube.com/watch?v=nF0rqeymxmQ",
    "images": null,
    "pollChoices": null,
    "attachmentType": "video",
    "channelUrl": "https://www.youtube.com/@MrBeast"
  },
  {
    "postId": "Ugkxb5JzX362uGUdzayf61nmJFOrqtglQBEg",
    "author": "MrBeast",
    "postLink": "https://www.youtube.com/post/Ugkxb5JzX362uGUdzayf61nmJFOrqtglQBEg",
    "publishedTime": "2 weeks ago",
    "timeOfDownload": "19/12/2025, 10:40:43",
    "text": "WE DID IT!!!!! TEAMWATER HIT ITS GOAL AND NOW 2,000,000 WILL GET CLEAN WATER 🥰 🎉",
    "likesCount": "330K",
    "commentsCount": "2.5K",
    "videoLink": null,
    "images": [
      "https://yt3.ggpht.com/DeT-ij2PlgUIyvnsJu594vpJoF6ukMiPK6ulR-R9XHlmw-0Ow_tCnBHmB23k3levQ5rtoqZ9id6izPs=s288-c-fcrop64=1,1ba30000e45cffff-rw-nd-v1",
      "https://yt3.ggpht.com/DeT-ij2PlgUIyvnsJu594vpJoF6ukMiPK6ulR-R9XHlmw-0Ow_tCnBHmB23k3levQ5rtoqZ9id6izPs=s400-c-fcrop64=1,1ba30000e45cffff-rw-nd-v1",
      "https://yt3.ggpht.com/DeT-ij2PlgUIyvnsJu594vpJoF6ukMiPK6ulR-R9XHlmw-0Ow_tCnBHmB23k3levQ5rtoqZ9id6izPs=s512-c-fcrop64=1,1ba30000e45cffff-rw-nd-v1",
      "https://yt3.ggpht.com/DeT-ij2PlgUIyvnsJu594vpJoF6ukMiPK6ulR-R9XHlmw-0Ow_tCnBHmB23k3levQ5rtoqZ9id6izPs=s640-c-fcrop64=1,1ba30000e45cffff-rw-nd-v1",
      "https://yt3.ggpht.com/DeT-ij2PlgUIyvnsJu594vpJoF6ukMiPK6ulR-R9XHlmw-0Ow_tCnBHmB23k3levQ5rtoqZ9id6izPs=s800-c-fcrop64=1,1ba30000e45cffff-rw-nd-v1",
      "https://yt3.ggpht.com/DeT-ij2PlgUIyvnsJu594vpJoF6ukMiPK6ulR-R9XHlmw-0Ow_tCnBHmB23k3levQ5rtoqZ9id6izPs=s1024-c-fcrop64=1,1ba30000e45cffff-rw-nd-v1",
      "https://yt3.ggpht.com/DeT-ij2PlgUIyvnsJu594vpJoF6ukMiPK6ulR-R9XHlmw-0Ow_tCnBHmB23k3levQ5rtoqZ9id6izPs=s1035-c-fcrop64=1,1ba30000e45cffff-rw-nd-v1"
    ],
    "pollChoices": null,
    "attachmentType": "image",
    "channelUrl": "https://www.youtube.com/@MrBeast"
  },
  {
    "postId": "UgkxHfpLdJiBz5UK81CSIMaE77sHmErjkCN5",
    "author": "MrBeast",
    "postLink": "https://www.youtube.com/post/UgkxHfpLdJiBz5UK81CSIMaE77sHmErjkCN5",
    "publishedTime": "4 weeks ago",
    "timeOfDownload": "19/12/2025, 10:40:43",
    "text": "If I offered you $1,000,000 but you only keep it if the first person you call answers, who would you call?",
    "likesCount": "382K",
    "commentsCount": "16K",
    "videoLink": null,
    "images": null,
    "pollChoices": null,
    "attachmentType": "post",
    "channelUrl": "https://www.youtube.com/@MrBeast"
  },
]
```

### Use Cases

- **Content Research**: Identify popular topics and trends within YouTube channels to align content with audience preferences
- **Engagement Analysis**: Track likes, comments, and interactions to understand what drives the most engagement
- **Competitive Analysis**: Monitor competitor channels to analyze their community post strategies
- **Audience Insights**: Understand audience behavior and preferences through poll results and engagement metrics
- **Content Strategy**: Use historical post data to inform future content planning and posting schedules
- **Social Media Management**: Aggregate community post data for comprehensive social media analytics

### Limitations

- **Post Limit**: YouTube typically allows access to up to 200 posts per channel
- **Rate Limiting**: Be mindful of YouTube's rate limits when scraping multiple channels
- **Channel Requirements**: Only channels with a Community tab enabled will have scrapable posts
- **Dynamic Content**: Some posts may require JavaScript rendering, which this Actor handles automatically

### Pricing

This Actor runs on the Apify platform. It requires a $5/month rental fee to access, in addition to compute resource usage (CPU time, memory, and data transfer).

### Technical Details

- **Browser Automation**: Uses Camoufox (Playwright-based) for reliable JavaScript rendering
- **Data Extraction**: Parses embedded JSON data from YouTube's internal API
- **Pagination**: Automatically handles continuation tokens for fetching additional posts
- **Error Handling**: Robust error handling with detailed logging for debugging

### Support

For issues, questions, or feature requests, please check the Actor's page on Apify or contact the maintainer.

### FAQ

**Q: How many posts can I scrape per channel?**\
A: YouTube typically allows access to up to 200 posts per channel. You can set the `max_posts` parameter to control this.

**Q: Can I scrape multiple channels at once?**\
A: Yes! Add multiple channel URLs to the `start_urls` array to scrape multiple channels in a single run.

**Q: What format is the output data?**\
A: All data is exported as JSON to the Apify Dataset, which can be downloaded in JSON, CSV, Excel, XML, or HTML formats.

**Q: Does this scrape post comments?**\
A: Currently, this Actor extracts comment counts but not individual comment content. The comment count is included in the `commentsCount` field.

**Q: How do I handle rate limiting?**\
A: The Actor includes built-in delays and uses browser automation to minimize detection. For high-volume scraping, consider using Apify's proxy options.

**Q: Can I run this Actor on a schedule?**\
A: Yes! Use Apify's scheduling feature to run the Actor automatically at specified intervals.

# Actor input Schema

## `start_urls` (type: `array`):

URLs to start with

## `max_posts` (type: `integer`):

Maximum number of posts to scrape

## Actor input object example

```json
{
  "start_urls": [
    {
      "url": "https://www.youtube.com/@MrBeast"
    }
  ],
  "max_posts": 10
}
```

# Actor output Schema

## `overview` (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 = {
    "start_urls": [
        {
            "url": "https://www.youtube.com/@MrBeast"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("beautifulscrape/youtube-posts-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 = { "start_urls": [{ "url": "https://www.youtube.com/@MrBeast" }] }

# Run the Actor and wait for it to finish
run = client.actor("beautifulscrape/youtube-posts-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 '{
  "start_urls": [
    {
      "url": "https://www.youtube.com/@MrBeast"
    }
  ]
}' |
apify call beautifulscrape/youtube-posts-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Youtube Posts Scraper",
        "description": "▶️YouTube🔴 Extract data from YouTube community posts, polls, images, comments, and engagement data from any channel. Ideal for research, trend analysis, and audience insights.",
        "version": "1.0",
        "x-build-id": "C5ezFBV7PeSsV9i28"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/beautifulscrape~youtube-posts-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-beautifulscrape-youtube-posts-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/beautifulscrape~youtube-posts-scraper/runs": {
            "post": {
                "operationId": "runs-sync-beautifulscrape-youtube-posts-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/beautifulscrape~youtube-posts-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-beautifulscrape-youtube-posts-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": [
                    "start_urls"
                ],
                "properties": {
                    "start_urls": {
                        "title": "Start URLs",
                        "type": "array",
                        "description": "URLs to start with",
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL of a web page",
                                    "format": "uri"
                                }
                            }
                        }
                    },
                    "max_posts": {
                        "title": "Maximum number of posts to scrape (Youtube allows 200 posts per channel)",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Maximum number of posts to scrape",
                        "default": 10
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
