# Social Media Comments Scraper (`scrapeforge/social-comments-scraper`) Actor

Extract comments and replies from Facebook, Instagram, LinkedIn, and YouTube posts in one run. Automatically detects the platform from each URL and returns a unified, consistent output. Ideal for social listening, brand monitoring, and audience research. Export to JSON, CSV, or Excel.

- **URL**: https://apify.com/scrapeforge/social-comments-scraper.md
- **Developed by:** [ScrapeForge](https://apify.com/scrapeforge) (community)
- **Categories:** Agents, Social media, MCP servers
- **Features:** Limited permissions
- **Stats:** 284 total users, 18 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 youtube comments

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

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

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

## How to integrate an Actor?

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

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

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

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

# README

### Social Media Comments Scraper

Extract comments from **Facebook, Instagram, LinkedIn, and YouTube** posts with a single Actor. Paste the post URLs — you can mix platforms in the same run — and the Actor automatically detects each social network and returns its comments in one consistent, unified format. Export to JSON, CSV, or Excel with no coding required.

### Use cases

- **Social listening** — Monitor what audiences say under your posts and your competitors' across several networks at once.
- **Reputation management** — Spot negative comments, complaints, or emerging crises close to real time.
- **Audience research** — Understand who comments, which topics drive the most conversation, and in what tone.
- **Reporting & insights** — Collect structured comment datasets for social listening reports, market research, or coverage analysis.
- **Competitive benchmarking** — Compare conversation volume and sentiment across brands or campaigns.
- **AI analysis** — Feed sentiment, classification, or summarization models with clean, normalized comments.

### Features

- **Four platforms, one Actor** — Facebook, Instagram, LinkedIn, and YouTube in the same run.
- **Automatic platform detection** — Paste any post URL and the Actor identifies the network and handles it accordingly.
- **Comments and replies** — Download comments and, optionally, the replies to each one.
- **Configurable sorting** — Choose most relevant or most recent on YouTube and LinkedIn.
- **Per-post limits** — Control how many comments and replies to fetch per post to fine-tune volume and cost.
- **Unified output** — Every comment shares the same schema, regardless of the source platform.
- **Run summary** — Each run saves a summary with per-platform counts.

### Input

| Field | Description | Default |
|-------|-------------|---------|
| **Post URLs** | List of post URLs. You can mix platforms. | — |
| **Max comments per post** | Maximum top-level comments per post. `0` = all. | `0` |
| **Max replies per comment** | Maximum replies per comment. `0` = do not fetch replies. Not available on Instagram. | `0` |
| **YouTube sort order** | `top` (most relevant) or `newest` (most recent). | `top` |
| **LinkedIn sort order** | `date` (most recent) or `relevance` (most relevant). | `date` |

Supported URL formats:

- **Facebook**: `facebook.com/.../posts/...`, `/reel/...`, `fb.watch/...`
- **Instagram**: `instagram.com/p/...`, `/reel/...`, `/tv/...`
- **LinkedIn**: `linkedin.com/posts/...`, `linkedin.com/feed/update/urn:li:activity:...`
- **YouTube**: `youtube.com/watch?v=...`, `youtu.be/...`, `/shorts/...`

#### Input example

```json
{
    "postUrls": [
        "https://www.youtube.com/watch?v=VIDEO_ID",
        "https://www.instagram.com/p/POST_ID/",
        "https://www.linkedin.com/posts/user_activity-123",
        "https://www.facebook.com/page/posts/123"
    ],
    "maxCommentsPerPost": 100,
    "maxRepliesPerComment": 10,
    "youtubeSortBy": "newest",
    "linkedinSortBy": "date"
}
```

### Output

Each comment is a dataset item with a unified schema across platforms. Replies are returned as their own items with `isReply: true` and the `parentCommentId` of their parent comment.

```json
{
    "platform": "youtube",
    "postUrl": "https://www.youtube.com/watch?v=VIDEO_ID",
    "commentId": "Ugxxxxxxxxxxxx",
    "parentCommentId": null,
    "isReply": false,
    "text": "Great content, congrats!",
    "publishedAt": "2 days ago",
    "likeCount": 42,
    "replyCount": 3,
    "reactions": {},
    "author": {
        "id": "UCxxxxxxxxxxxx",
        "name": "Author name",
        "username": "",
        "profileUrl": "https://www.youtube.com/channel/UCxxxxxxxxxxxx",
        "avatarUrl": "https://...",
        "isVerified": true
    },
    "extra": {},
    "scrapedAt": "2026-07-07T12:00:00.000Z"
}
```

- **platform** — the comment's social network (`facebook`, `instagram`, `linkedin`, `youtube`).
- **text / publishedAt** — the comment's content and date. On YouTube the date is relative ("2 days ago"); on the other platforms it is ISO 8601.
- **likeCount / replyCount / reactions** — the comment's interaction metrics.
- **author** — author details (name, username, profile, avatar, verified status).
- **extra** — platform-specific fields (e.g., author type on LinkedIn, or whether a YouTube comment is pinned).

When it finishes, the Actor saves a `RUN_SUMMARY` record with the total number of comments, per-platform counts, and any URLs that could not be processed.

### Pricing

This Actor charges **per event**, with an independent price per platform: each Facebook, Instagram, LinkedIn, or YouTube comment or reply has its own rate, plus a small charge when the run starts. You only pay for the comments actually downloaded.

### Usage limits for free tier users

To keep the service sustainable, accounts on the **Apify Free plan** have the following limits when running this Actor:

- **1 post URL per run** — additional URLs are ignored.
- **Up to 20 comments per post** — any higher value in `Max comments per post` is automatically reduced.
- **Replies are not available** — `Max replies per comment` is forced to 0.
- **1 run per 24 hours** — when this limit can be checked, a second run launched within 24 hours of the previous one finishes immediately with a status message explaining when to retry.

When a limit is reached, the run finishes gracefully (no error) and the status message explains what happened.

**Paid plans** (Starter / Bronze and above) are not subject to these per-actor limits. To remove the restrictions, upgrade your Apify plan at <https://console.apify.com/billing>.

### FAQ

**Can I mix platforms in a single run?**
Yes. Put Facebook, Instagram, LinkedIn, and YouTube URLs together in `Post URLs`; each one is processed with the right handling.

**Does it download replies to comments?**
Yes, optionally. Adjust `Max replies per comment`. Instagram does not allow downloading replies to comments.

**How many comments can I get per post?**
As many as you want: use `Max comments per post` to cap the volume (and cost), or leave it at `0` to fetch all available. Free plan accounts are capped at 20 per post regardless of this setting.

**What happens if a URL is invalid or not recognized?**
It is skipped and recorded in the run summary; the rest of the URLs are processed normally.

**Can I schedule recurring runs?**
Yes. Use Apify's built-in scheduler to run the Actor daily, weekly, or on a custom schedule, and integrate the results with Google Sheets, Slack, webhooks, or other tools.

### Disclaimer

This Actor is an unofficial tool and is not affiliated with, endorsed by, or sponsored by Meta, LinkedIn, Google/YouTube, or their affiliates. All product names, trademarks, and registered trademarks are the property of their respective owners. Use this Actor responsibly and in compliance with each platform's Terms of Service and applicable data protection regulations.

# Actor input Schema

## `postUrls` (type: `array`):

List of post URLs. You can mix platforms: Facebook (facebook.com/.../posts/..., /reel/...), Instagram (/p/..., /reel/...), LinkedIn (/posts/..., /feed/update/urn:li:activity:...) and YouTube (watch?v=..., youtu.be/..., /shorts/...). Free Apify plans are limited to 1 URL per run.

## `maxCommentsPerPost` (type: `integer`):

Maximum number of top-level comments per post. 0 = all available. Free Apify plans are capped at 20 comments per post.

## `maxRepliesPerComment` (type: `integer`):

Maximum number of replies to download per comment. 0 = do not download replies. Supported on Facebook, LinkedIn, and YouTube. Instagram does not allow downloading replies to comments. Replies are not available on free Apify plans.

## `youtubeSortBy` (type: `string`):

Sort order for YouTube comments.

## `linkedinSortBy` (type: `string`):

Sort order for LinkedIn comments.

## `proxy` (type: `object`):

Proxy configuration. We recommend keeping Apify Proxy enabled for better stability.

## Actor input object example

```json
{
  "postUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "maxCommentsPerPost": 0,
  "maxRepliesPerComment": 0,
  "youtubeSortBy": "top",
  "linkedinSortBy": "date",
  "proxy": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `comments` (type: `string`):

Dataset with all extracted comments and replies, normalized across platforms

## `runSummary` (type: `string`):

Per-platform counts and any skipped URLs for this run

# 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 = {
    "postUrls": [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapeforge/social-comments-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 = { "postUrls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"] }

# Run the Actor and wait for it to finish
run = client.actor("scrapeforge/social-comments-scraper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "postUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ]
}' |
apify call scrapeforge/social-comments-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scrapeforge/social-comments-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/dR4AbkSyCC8KvuCam/builds/BSh8u8RE4OBnBjmWe/openapi.json
