# YouTube Community Posts & Polls Scraper (`sian.agency/youtube-community-posts-scraper`) Actor

Scrape every YouTube community post — polls, image carousels, shared videos, and text — plus full comment threads. Three operations, one actor, no API key needed. Built for creator agencies, social-listening teams, and AI-training pipelines that need structured community-tab data.

- **URL**: https://apify.com/sian.agency/youtube-community-posts-scraper.md
- **Developed by:** [SIÁN OÜ](https://apify.com/sian.agency) (community)
- **Categories:** Videos, Social media, Marketing
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.50 / 1,000 community post rows

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/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 Community Posts & Polls Scraper — Posts, Polls, Comments 📝🚀

[![Store-SIÁN Agency](https://img.shields.io/badge/Store-SI%C3%81N%20Agency-1AE392)](https://apify.com/sian.agency?fpr=sian) [![Store-YouTube AI Comments](https://img.shields.io/badge/Store-YouTube%20AI%20Comments-FF0000)](https://apify.com/sian.agency/youtube-ai-comments-scraper-and-questions-extractor?fpr=sian) [![Store-YouTube Comments Scraper](https://img.shields.io/badge/Store-YouTube%20Comments%20Scraper-FF0000)](https://apify.com/sian.agency/cheapest-youtube-comments-scraper?fpr=sian) [![Store-YouTube Query Suggestions](https://img.shields.io/badge/Store-YouTube%20Query%20Suggestions-FF0000)](https://apify.com/sian.agency/youtube-auto-complete-and-query-suggestion?fpr=sian)

#### 🎉 The ONLY actor that returns **YouTube community posts + post detail + comments** in one tool — including fully-parsed polls
##### Built for creator-management agencies, brand-sentiment teams, AI training pipelines, and social-listening platforms

---

### 📋 Overview

**Three operations. One actor. Every YouTube community post you'll ever need.** Scrape the community-tab feed of any channel, enrich any post into a rich single-row record, and pull every comment on any post — all without touching the Google API or maintaining your own session.

**Why thousands of professionals choose us:**
- ✅ **All-in-one toolkit**: Channel feed listing + post detail enrichment + full comment threads in a single actor (every competitor ships only the listing).
- ⚡ **Polls fully structured**: `pollChoices[]` array + parsed `pollTotalVotes` integer — no other actor surfaces poll data this cleanly.
- 🎯 **Multi-image carousels unwrapped**: Get a flat `imageUrls[]` array of best-resolution URLs, not nested arrays.
- 💸 **Pay only for what you keep**: Pay-per-event pricing — billed per row returned, error rows free. Starts at $0.005/post.
- 💎 **Handle resolver baked in**: Paste `@MKBHD`, get the canonical `UC…` channel ID free.
- ✨ **NEW**: Bonus `commentsContinuationToken` exposed in every post-detail row — chain straight into the comments operation without re-fetching the post.

---

### ✨ Features

- 📝 **Channel Community Posts Listing** — Paginated feed of every recent community post on a channel: text, image, multi-image carousel, shared video, and polls.
- 🔍 **Post Detail Enrichment** — Single-row enrichment with full image resolutions, complete poll metadata, attached video info, and the embedded `commentsContinuationToken`.
- 💬 **Post Comments Thread** — Paginated comments on any community post, ~20 comments per page, with continuation across pages.
- 🗳 **Structured Poll Data** — `pollChoices` as a JS array, `pollTotalVotes` parsed to integer, `pollTotalVotesText` preserved for display.
- 🖼 **Smart Image Handling** — `imageUrls[]` returns one URL per image at the best resolution available, whether the post has 1 image or a 10-image carousel.
- 🔗 **Auto Handle Resolution** — Paste a `@handle`, a custom URL, or a full `/channel/UC…` URL — the actor resolves to the canonical ID for free.
- 🧩 **Bulk Operation Support** — Process 1 or 200 channels per run (listing op), or 1 or 500 post IDs per run (detail / comments ops).
- 🏷 **44 Typed Output Fields** — Curated camelCase columns with consistent types, plus an `extra` blob for any upstream fields not yet mapped.
- 🌍 **Localization Ready** — Optional `geo` (US/GB/IN/BR/DE/JP/KR/MX) and `lang` (en/es/pt/hi/ja/ko) parameters for region-aware results.
- 📊 **HTML Run Report** — Every run produces a clean HTML summary with row counts, post-type breakdown, and channel metadata — saved even on fatal errors.

---

### 🎬 Quick Start

Pick an operation, pass an ID, hit Run. That's it.

```bash
curl -X POST 'https://api.apify.com/v2/acts/sian.agency~youtube-community-posts-scraper/runs?token=YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"operation":"channelCommunityPosts","channelIds":"@MKBHD","maxPages":3}'
````

***

### 🚀 Getting Started (3 Simple Steps)

#### Step 1: Pick your operation

- **📝 Channel Community Posts** — discover every recent post on a channel. Start here.
- **🔍 Post Detail** — enrich a known post ID with full metadata.
- **💬 Post Comments** — pull every comment on a post.

#### Step 2: Paste your IDs

- For `channelCommunityPosts`: paste channel IDs (`UC…`), handles (`@MKBHD`), or full channel URLs — one per line.
- For `postDetail` / `postComments`: paste post IDs (`Ugkx…`) or full post URLs — one per line.

#### Step 3: Run and collect

- Hit **Start** — results stream to the Apify dataset as they arrive.
- Export as JSON / CSV / Excel from the dataset view, or pull via API.
- HTML run report is in the key-value store under `report.html`.

**That's it! In under 60 seconds, you'll have:**

- Every community post on a channel, paginated and structured
- Or a full comment thread on any post
- Or a rich enriched record of any individual post

***

### 📥 Input Configuration

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `operation` | enum | ✅ | One of `channelCommunityPosts`, `postDetail`, `postComments` |
| `channelIds` | string (textarea) | for listing op | Channel IDs, handles, or URLs — one per line |
| `postIds` | string (textarea) | for detail/comments | Post IDs (`Ugkx…`) or post URLs — one per line |
| `maxPages` | integer | optional | Pages per channel / per post (1–25, default 3). Ignored for `postDetail`. |
| `geo` | string | optional | Two-letter country code (default `US`) |
| `lang` | string | optional | Two-letter language code (default `en`) |

**Example — Channel Community Posts:**

```json
{
  "operation": "channelCommunityPosts",
  "channelIds": "UCBJycsmduvYEL83R_U4JriQ\n@MrBeast\nhttps://www.youtube.com/@LofiGirl",
  "maxPages": 3
}
```

**Example — Post Detail (single-row enrichment):**

```json
{
  "operation": "postDetail",
  "postIds": "UgkxX6gkDxQ0KRucvyG7NLui0LhjHp0CLlfZ\nUgkxoALLVbJBCAlPjcXE3bcrv8PCAuBYQbc9"
}
```

**Example — Post Comments:**

```json
{
  "operation": "postComments",
  "postIds": "UgkxX6gkDxQ0KRucvyG7NLui0LhjHp0CLlfZ",
  "maxPages": 5
}
```

***

### 📤 Output

Results stream to the Apify dataset with **44 typed fields** including (most valuable shown):

| Field | Type | Description |
|-------|------|-------------|
| `postId` | string | Canonical community-post ID (`Ugkx…`) |
| `postPageUrl` | string | Canonical URL `https://www.youtube.com/post/{postId}` |
| `postType` | string | `text`, `image`, `multi_image`, `shared_video`, `poll`, or `unknown` |
| `contentText` | string | Body text of the post |
| `voteCount` | integer | Parsed integer vote/like count |
| `replyCount` | integer | Parsed integer reply count on the post |
| `pollChoices` | array | Poll choice texts (poll posts only) |
| `pollTotalVotes` | integer | Parsed total vote count (poll posts) |
| `imageUrls` | array | Best-resolution image URLs (image / multi\_image posts) |
| `sharedVideoId` | string | Shared video ID (shared\_video posts) |
| `sharedVideoTitle` | string | Title of the shared video |
| `commentsContinuationToken` | string | (postDetail) Continuation token to fetch comments without re-querying |
| `authorChannelHandle` | string | Author handle (e.g. `@MKBHD`) |
| `publishedAt` | string | ISO 8601 publish timestamp |
| `channelTitle` | string | Display name of the channel |
| `channelSubscriberCountText` | string | Subscriber count from upstream meta |
| `commentId` | string | (postComments) Canonical comment ID |
| `textDisplay` | string | (postComments) Comment text body |
| `likesCount` | integer | (postComments) Parsed like count on the comment |
| `authorIsChannelOwner` | boolean | (postComments) True iff comment author owns the host channel |

**Example — Poll post row:**

```json
{
  "postId": "UgkxzXI5yqUI81XAwGFCCpcmqyk8Tmya93v4",
  "postPageUrl": "https://www.youtube.com/post/UgkxzXI5yqUI81XAwGFCCpcmqyk8Tmya93v4",
  "postType": "poll",
  "contentText": "Current study status? 🧐",
  "authorChannelId": "UCSJ4gkVC6NrvII8umztf0Ow",
  "authorText": "Lofi Girl",
  "authorChannelHandle": "@LofiGirl",
  "voteCount": 1600,
  "voteCountText": "1.6K",
  "replyCount": 424,
  "pollChoices": ["📖 High School", "🎓 University /College", "🎉 Already Graduated"],
  "pollTotalVotesText": "42K votes",
  "pollTotalVotes": 42000,
  "channelTitle": "Lofi Girl",
  "channelSubscriberCountText": "15.7M",
  "publishedAt": "2026-05-15T00:00:00Z",
  "publishedTimeText": "6 days ago",
  "status": "success",
  "_operation": "channelCommunityPosts"
}
```

***

### 💼 Use Cases & Examples

#### 1. Creator-Management Agency — Talent Engagement Tracking

**Track every community post across a 30-channel talent roster, once a week.**

**Input:** A list of 30+ channel IDs in a single `channelCommunityPosts` run.
**Output:** Every recent community post per channel — text, polls, image carousels, shared videos — with structured vote/reply counts.
**Use:** Benchmark talent-level engagement and identify channels where community posts outperform regular uploads.

#### 2. Brand-Sentiment Researcher — Pre-Sponsorship Poll Aggregation

**Pull a creator's community-tab poll history before signing a sponsorship deal.**

**Input:** Channel ID of the creator under consideration.
**Output:** Every poll that creator has posted, with choices + total votes.
**Use:** Data-back your sponsorship decision with real audience-preference signals instead of vanity metrics.

#### 3. AI Training Data Engineer — Long-Form Creator Text + Structured Polls

**Bulk-collect community posts across hundreds of channels for model training pipelines.**

**Input:** A list of channel IDs filtered by your training-set definition.
**Output:** Long-form text content + poll-choice arrays as a structured corpus.
**Use:** Train models on creator-audience interaction patterns or fine-tune sentiment classifiers on engagement-rich text.

#### 4. Social-Listening Platform — Cross-Creator Poll Trends

**Aggregate poll choices across competing creators to detect emerging audience preferences.**

**Input:** Vertical-defined channel list run as `channelCommunityPosts`, then `postDetail` on the polls.
**Output:** Normalized poll-result data feeding into your existing trend-detection pipeline.
**Use:** Spot rising preferences before they hit mainstream metrics dashboards.

#### 5. Academic Researcher — Creator-Audience Interaction Dynamics

**Study how creators interact with their audience through posts → comment threads.**

**Input:** Channel IDs in `channelCommunityPosts`, then `postComments` per discovered postId.
**Output:** Full post → comment graph including reply counts, like counts, and channel-owner reply flags.
**Use:** Sociolinguistic studies, engagement-pattern research, parasocial-bond analysis.

***

### 🔗 Integration Examples

#### JavaScript / Node.js

```javascript
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_TOKEN' });

const run = await client.actor('sian.agency/youtube-community-posts-scraper').call({
  operation: 'channelCommunityPosts',
  channelIds: 'UCBJycsmduvYEL83R_U4JriQ\n@MrBeast',
  maxPages: 3,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
const polls = items.filter(r => r.postType === 'poll');
console.log(`Pulled ${items.length} posts, ${polls.length} polls`);
```

#### Python

```python
from apify_client import ApifyClient
client = ApifyClient('YOUR_TOKEN')

run = client.actor('sian.agency/youtube-community-posts-scraper').call(
    run_input={
        'operation': 'channelCommunityPosts',
        'channelIds': 'UCBJycsmduvYEL83R_U4JriQ',
        'maxPages': 3,
    }
)

for row in client.dataset(run['defaultDatasetId']).iterate_items():
    if row.get('postType') == 'poll':
        print(row['contentText'], row['pollChoices'], row['pollTotalVotes'])
```

#### cURL

```bash
curl -X POST 'https://api.apify.com/v2/acts/sian.agency~youtube-community-posts-scraper/runs?token=YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"operation":"postComments","postIds":"UgkxX6gkDxQ0KRucvyG7NLui0LhjHp0CLlfZ","maxPages":5}'
```

#### Automation Workflows (n8n / Zapier / Make)

1. **Trigger**: Schedule (e.g. daily at 09:00) or webhook
2. **HTTP Request**: POST to `https://api.apify.com/v2/acts/sian.agency~youtube-community-posts-scraper/runs?token=YOUR_TOKEN`
3. **Wait for run**: Poll `/v2/actor-runs/{runId}` until status = `SUCCEEDED`
4. **Process**: Fetch dataset items via `/v2/datasets/{datasetId}/items`
5. **Action**: Filter by `postType`, push to Slack / CRM / data warehouse

***

### 📊 Performance & Pricing

Pay-per-event (PPE) pricing — billed per row delivered, never per failed attempt.

#### Live event prices

| Event | FREE | BRONZE | SILVER | GOLD / PLATINUM / DIAMOND |
|---|---|---|---|---|
| `apify-actor-start` (one-time, after input validates) | $0.020 | $0.002 | $0.002 | $0.002 |
| `community-post-row` ⭐ headline | $0.015 | $0.005 | $0.00375 | $0.0025 |
| `post-detail-result` (premium single-row) | $0.024 | $0.008 | $0.006 | $0.004 |
| `post-comment-row` | $0.015 | $0.005 | $0.00375 | $0.0025 |

#### Cost estimator examples

| Scenario | Rows | Cost (BRONZE) |
|---|---|---|
| 1 channel × 30 community posts | 30 | $0.150 |
| 30 channels × 30 community posts (agency weekly) | 900 | $4.502 |
| 1 post × full comment thread (avg 200 comments) | 200 | $1.002 |
| 100 post details enriched | 100 | $0.802 |

💸 **Best price-per-quality on the market** — comprehensive multi-op tooling at single-op pricing.

🔗 [View current pricing](https://apify.com/sian.agency/youtube-community-posts-scraper?fpr=sian)

***

### ❓ Frequently Asked Questions

**Q: How is this different from other YouTube community-post scrapers?**
A: We ship **all three operations in one actor** — channel feed listing, post detail enrichment, and comment threads. Every competitor ships only the listing op; you'd need to chain 3 separate scrapers to get the same coverage. Plus we parse polls into structured fields, unwrap multi-image carousels, and resolve handle URLs automatically.

**Q: Are polls fully structured?**
A: Yes — `pollChoices` is a JavaScript array of choice strings, `pollTotalVotes` is a parsed integer, `pollTotalVotesText` preserves the raw display string (e.g. `"42K votes"`). No other community-posts actor surfaces this level of structure.

**Q: What if a channel has no community tab?**
A: The run completes successfully with zero post rows plus an HTML summary noting the empty result. You're not charged per-row for empty channels — only `apify-actor-start` fires.

**Q: Can I paste a YouTube handle like `@MKBHD` instead of a `UC…` ID?**
A: Yes. Handles, custom URLs, and `/channel/UC…` URLs are all accepted. The actor calls the YouTube resolver one extra time per channel — at no extra charge.

**Q: How do I chain post-detail into comments without paying twice?**
A: Every `postDetail` row carries a `commentsContinuationToken` field. Pass that token into your downstream comments workflow and skip the initial fetch — one fewer upstream call per post.

**Q: How accurate are the parsed counts (votes, replies, likes)?**
A: We parse upstream text strings like `"11K"`, `"1.7M"`, `"244"` into integers using a deterministic rule (multiplier × base × `K|M|B|none`). Both the raw text (e.g. `voteCountText`) and the parsed integer (e.g. `voteCount`) are returned so you can verify the parse.

**Q: What output formats are available?**
A: JSON, CSV, Excel — all available from the Apify dataset view. The HTML run summary is saved separately in the key-value store under `report.html`.

**Q: Does this work with restricted or deleted posts?**
A: Restricted / deleted posts return an `error` row with a human-readable `errorMessage` field. Error rows are saved to the dataset for traceability but are **not charged**.

**Q: Is this legal?**
A: We only extract publicly accessible community-tab data. See the "Is it legal to scrape data?" section below for a full GDPR primer.

**Q: How fast is it?**
A: ~1–5 seconds per page (10 posts) for the listing op. ~3 seconds per `postDetail` enrichment. ~5 seconds per page (20 comments) for the comments op.

*YouTube® is a trademark of Google LLC. This actor is an independent scraping tool. It is not affiliated with, endorsed by, or sponsored by Google LLC or YouTube.*

***

### 🐛 Troubleshooting

**"Could not resolve {input} to a canonical YouTube channel ID"**

- Make sure you're pasting a real `UC…` channel ID, a channel URL, or a handle URL (e.g. `https://www.youtube.com/@MKBHD`).
- Bare strings like `MKBHD` (without `@`) won't resolve — use the handle URL or the canonical ID instead.

**Channel returns 0 posts**

- Verify the channel actually has a community tab. Some brands (e.g. Apple) don't.
- If the channel uses the community tab but returns 0, try opening the channel manually at `youtube.com/channel/{UC…}/community` — if the tab is empty there, our result is correct.

**Post returns "Post not found"**

- The post ID may have been deleted or the channel may have removed the post.
- Check the post still exists at `https://www.youtube.com/post/{postId}` — if it 404s, it's gone.

**Pagination stops earlier than expected**

- YouTube only paginates as far as it has data — older posts roll off the index over time.
- For channels with rich history, increase `maxPages` (cap is 25). For very-active channels, lower `maxPages` to cap cost.

**Comment thread returns fewer comments than expected**

- YouTube hides spam and low-quality replies — the upstream excludes those.
- `replyCount` on the parent post is the upstream's total; what you receive is post-filtered.

***

### ⚖️ Is it legal to scrape data?

Our actors are ethical and do not extract any private user data, such as email addresses, gender, or location. They only extract what the user has chosen to share publicly. We therefore believe that our actors, when used for ethical purposes by Apify users, are safe.

However, you should be aware that your results could contain personal data. Personal data is protected by the **GDPR** in the European Union and by other regulations around the world. You should not scrape personal data unless you have a legitimate reason to do so. If you're unsure whether your reason is legitimate, consult your lawyers.

You can also read Apify's blog post on the [legality of web scraping](https://blog.apify.com/is-web-scraping-legal/).

***

### 🤝 Support

[![Telegram Support](https://img.shields.io/badge/Telegram-Support%20Group-0088cc?logo=telegram)](https://t.me/+vyh1sRE08sAxMGRi)

**Join our active support community**

- For issues or questions, open an issue in the Apify Console Issues tab
- Check [SIÁN Agency Store](https://apify.com/sian.agency?fpr=sian) for more automation tools
- 📧 <apify@sian-agency.online>

***

**Built by [SIÁN Agency](https://www.sian-agency.online)** | **[More Tools](https://apify.com/sian.agency?fpr=sian)**

# Actor input Schema

## `operation` (type: `string`):

🎯 **PICK ONE OPERATION PER RUN.** Each run produces one clean dataset matching the chosen mode.

- **📝 Channel Community Posts** — pass one or more channel IDs (or handle URLs) → get the paginated community-tab feed: text, image carousels, polls, shared videos. Headline operation.
- **🔍 Post Detail** — pass one or more post IDs → enriched single-row detail per post (full image resolutions, poll metadata, attached video info, embedded `commentsContinuationToken` for free comment chaining).
- **💬 Post Comments** — pass one or more post IDs → paginated comments + replies on each post.

💡 **TIP:** Start with `Channel Community Posts` to discover post IDs for a channel, then feed those IDs into `Post Detail` or `Post Comments` for enrichment.

## `channelIds` (type: `string`):

📺 **Required for `Channel Community Posts`.**

One or more channel inputs. Each will be processed independently, paginated up to `maxPages`. Accepts any mix of:

- Canonical channel ID: `UCBJycsmduvYEL83R_U4JriQ`
- Channel URL: `https://www.youtube.com/channel/UCBJycsmduvYEL83R_U4JriQ`
- Handle URL: `https://www.youtube.com/@MKBHD`
- Bare handle: `@MKBHD` (will be resolved)

💡 **TIP:** Handles + URLs are resolved to canonical channel IDs automatically (one extra upstream call per channel — no extra charge).

## `postIds` (type: `string`):

🔍 **Required for `Post Detail` and `Post Comments`.**

One or more YouTube community post IDs. Each ID starts with `Ugkx…` and is ~34 characters. Accepts:

- Bare post IDs: `UgkxX6gkDxQ0KRucvyG7NLui0LhjHp0CLlfZ`
- Full post URLs: `https://www.youtube.com/post/UgkxX6gkDxQ0KRucvyG7NLui0LhjHp0CLlfZ` (the actor will extract the ID)
- Comma-separated or one per line

💡 **TIP:** Use the `Channel Community Posts` operation first to discover post IDs from a channel. The `Post Detail` operation also returns a `commentsContinuationToken` you can pass directly into a downstream `Post Comments` workflow.

## `maxPages` (type: `integer`):

📄 **Applies to paginated operations only** (`Channel Community Posts`, `Post Comments`). Ignored for `Post Detail`.

- **Channel Community Posts:** ~10 posts per page
- **Post Comments:** ~20 comments per page

For multi-input runs (multiple channels or post IDs), the cap applies per-input.

⚠️ Hard cap: 25 pages to prevent runaway runs.

## `geo` (type: `string`):

🌍 **Optional.** Two-letter country code to localize results. Defaults to `US`.

Examples: `US`, `GB`, `IN`, `BR`, `DE`, `JP`, `KR`, `MX`.

## `lang` (type: `string`):

🗣 **Optional.** Two-letter language code for localized labels. Defaults to `en`.

Examples: `en`, `es`, `pt`, `hi`, `ja`, `ko`.

## Actor input object example

```json
{
  "operation": "channelCommunityPosts",
  "channelIds": "UCBJycsmduvYEL83R_U4JriQ\n@MrBeast\nhttps://www.youtube.com/@LofiGirl",
  "postIds": "UgkxX6gkDxQ0KRucvyG7NLui0LhjHp0CLlfZ\nUgkxoALLVbJBCAlPjcXE3bcrv8PCAuBYQbc9",
  "maxPages": 3,
  "geo": "US",
  "lang": "en"
}
```

# Actor output Schema

## `output` (type: `string`):

Community-post rows with curated camelCase fields (postType, contentText, voteCount, replyCount, pollChoices, imageUrls, sharedVideoId, …) or comment rows (commentId, textDisplay, likesCount, authorIsChannelOwner, …). One row per post (or per comment).

## `report` (type: `string`):

HTML report with run status, success/error counts, post-type breakdown, pages fetched, duration, and inputs — written even on fatal crash.

# 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 = {
    "channelIds": "UCBJycsmduvYEL83R_U4JriQ",
    "postIds": "UgkxX6gkDxQ0KRucvyG7NLui0LhjHp0CLlfZ"
};

// Run the Actor and wait for it to finish
const run = await client.actor("sian.agency/youtube-community-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 = {
    "channelIds": "UCBJycsmduvYEL83R_U4JriQ",
    "postIds": "UgkxX6gkDxQ0KRucvyG7NLui0LhjHp0CLlfZ",
}

# Run the Actor and wait for it to finish
run = client.actor("sian.agency/youtube-community-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 '{
  "channelIds": "UCBJycsmduvYEL83R_U4JriQ",
  "postIds": "UgkxX6gkDxQ0KRucvyG7NLui0LhjHp0CLlfZ"
}' |
apify call sian.agency/youtube-community-posts-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "YouTube Community Posts & Polls Scraper",
        "description": "Scrape every YouTube community post — polls, image carousels, shared videos, and text — plus full comment threads. Three operations, one actor, no API key needed. Built for creator agencies, social-listening teams, and AI-training pipelines that need structured community-tab data.",
        "version": "1.0",
        "x-build-id": "PzZdeUZLAF1kgjB8u"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/sian.agency~youtube-community-posts-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-sian.agency-youtube-community-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/sian.agency~youtube-community-posts-scraper/runs": {
            "post": {
                "operationId": "runs-sync-sian.agency-youtube-community-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/sian.agency~youtube-community-posts-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-sian.agency-youtube-community-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": [
                    "operation"
                ],
                "properties": {
                    "operation": {
                        "title": "🎯 Operation — what do you want to scrape?",
                        "enum": [
                            "channelCommunityPosts",
                            "postDetail",
                            "postComments"
                        ],
                        "type": "string",
                        "description": "🎯 **PICK ONE OPERATION PER RUN.** Each run produces one clean dataset matching the chosen mode.\n\n- **📝 Channel Community Posts** — pass one or more channel IDs (or handle URLs) → get the paginated community-tab feed: text, image carousels, polls, shared videos. Headline operation.\n- **🔍 Post Detail** — pass one or more post IDs → enriched single-row detail per post (full image resolutions, poll metadata, attached video info, embedded `commentsContinuationToken` for free comment chaining).\n- **💬 Post Comments** — pass one or more post IDs → paginated comments + replies on each post.\n\n💡 **TIP:** Start with `Channel Community Posts` to discover post IDs for a channel, then feed those IDs into `Post Detail` or `Post Comments` for enrichment.",
                        "default": "channelCommunityPosts"
                    },
                    "channelIds": {
                        "title": "📺 Channel IDs or YouTube channel URLs (one per line)",
                        "type": "string",
                        "description": "📺 **Required for `Channel Community Posts`.**\n\nOne or more channel inputs. Each will be processed independently, paginated up to `maxPages`. Accepts any mix of:\n- Canonical channel ID: `UCBJycsmduvYEL83R_U4JriQ`\n- Channel URL: `https://www.youtube.com/channel/UCBJycsmduvYEL83R_U4JriQ`\n- Handle URL: `https://www.youtube.com/@MKBHD`\n- Bare handle: `@MKBHD` (will be resolved)\n\n💡 **TIP:** Handles + URLs are resolved to canonical channel IDs automatically (one extra upstream call per channel — no extra charge)."
                    },
                    "postIds": {
                        "title": "🔍 Post IDs or post URLs (one per line)",
                        "type": "string",
                        "description": "🔍 **Required for `Post Detail` and `Post Comments`.**\n\nOne or more YouTube community post IDs. Each ID starts with `Ugkx…` and is ~34 characters. Accepts:\n- Bare post IDs: `UgkxX6gkDxQ0KRucvyG7NLui0LhjHp0CLlfZ`\n- Full post URLs: `https://www.youtube.com/post/UgkxX6gkDxQ0KRucvyG7NLui0LhjHp0CLlfZ` (the actor will extract the ID)\n- Comma-separated or one per line\n\n💡 **TIP:** Use the `Channel Community Posts` operation first to discover post IDs from a channel. The `Post Detail` operation also returns a `commentsContinuationToken` you can pass directly into a downstream `Post Comments` workflow."
                    },
                    "maxPages": {
                        "title": "📄 Max pages per channel / per post",
                        "minimum": 1,
                        "maximum": 25,
                        "type": "integer",
                        "description": "📄 **Applies to paginated operations only** (`Channel Community Posts`, `Post Comments`). Ignored for `Post Detail`.\n\n- **Channel Community Posts:** ~10 posts per page\n- **Post Comments:** ~20 comments per page\n\nFor multi-input runs (multiple channels or post IDs), the cap applies per-input.\n\n⚠️ Hard cap: 25 pages to prevent runaway runs.",
                        "default": 3
                    },
                    "geo": {
                        "title": "🌍 Country (optional, ISO 3166-1 alpha-2)",
                        "type": "string",
                        "description": "🌍 **Optional.** Two-letter country code to localize results. Defaults to `US`.\n\nExamples: `US`, `GB`, `IN`, `BR`, `DE`, `JP`, `KR`, `MX`.",
                        "default": "US"
                    },
                    "lang": {
                        "title": "🗣 Language (optional, ISO 639-1)",
                        "type": "string",
                        "description": "🗣 **Optional.** Two-letter language code for localized labels. Defaults to `en`.\n\nExamples: `en`, `es`, `pt`, `hi`, `ja`, `ko`.",
                        "default": "en"
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
