---
title: "Social media scraping"
description: "Social media scraping for public posts, profiles, comments and engagement from Reddit, YouTube, TikTok and X. Structured JSON from public pages, at volume."
canonical: https://www.zenrows.com/use-cases/social-media-scraping
updated: 2026-10-18
---

# Social media scraping

Social media scraping collects public posts, profiles, comments, hashtags and engagement counts from platforms like Reddit, YouTube, TikTok and X. Zenrows fetches the pages a logged-out visitor sees, renders their JavaScript, and returns HTML, Markdown or JSON for listening, creator research and trend tracking.

## Sample output: one public video post

```json
{
  "platform": "tiktok",
  "url": "https://www.tiktok.com/@example_account/video/7425000000000000000",
  "account": {
    "handle": "@example_account",
    "followers": 184300,
    "verified": false
  },
  "caption": "Three ways to fold a fitted sheet, ranked",
  "hashtags": ["laundryhacks", "homeorganization"],
  "posted_at": "2026-10-09T17:20:00Z",
  "duration_seconds": 41,
  "views": 1250000,
  "likes": 96400,
  "comments": 1830,
  "shares": 5210,
  "sound": "original sound",
  "collected_at": "2026-10-12T09:00:00Z"
}
```

Illustrative. The page shows counts like "1.2M": store numbers with the collection time, since engagement keeps moving after posting.

## What teams collect from social media

Most projects read a few public page types: profile, post, comment thread, search or hashtag results. The job decides which, and how often.

| Job | Data you collect | Typical sources |
|---|---|---|
| Social listening | Posts and comments naming a brand, product or topic | Reddit search and threads, YouTube comments, TikTok search, public forums |
| Influencer research | Profile stats, recent posts, engagement per post | TikTok and YouTube public profiles, Twitch channels |
| Trend and hashtag tracking | Hashtag volume, top posts, sounds, formats over time | TikTok hashtag pages, YouTube search, X public posts |
| Comment mining for product feedback | Comment text, replies, likes, timestamps | YouTube review videos, Reddit product communities |
| Competitor content benchmarking | Cadence, formats, engagement of competitor accounts | Public brand pages on TikTok, YouTube and X |
| Community and creator platforms | Posts, subscriber counts, comment threads | substack.com, fandom.com, wordpress.com blogs |

## Why social media scraping fails

Social platforms build each page in the browser, counts change by the minute, and repeat requests from one IP get rate-limited.

| What breaks | What it looks like | How Zenrows handles it |
|---|---|---|
| Rate limits and bot checks | Errors, empty pages or challenges on Reddit and TikTok | Zenrows' stealth and retries get through |
| JavaScript-built pages | A script bundle, no post text or counts | Adaptive Stealth Mode renders and returns the loaded post |
| Infinite scroll and "load more" | Ten comments of thousands | Page actions scroll and click first; Browser runs longer scrolls in Playwright |
| Region-specific feeds | Trending and search differ by country | Geotargeting fetches as a local visitor |
| Frequent redesigns | Class names change; selectors return blanks | Extract returns fields with no selectors to maintain |
| Volume | 50,000 posts re-checked for engagement daily | Batch runs the list as one job, webhook on finish |

## How to scrape social media data with Zenrows

1. **List the public pages**: profiles, posts, searches, hashtags a logged-out visitor can open.
2. **Fetch with Adaptive Stealth Mode**, which escalates to rendering and stealth only when needed.
3. **Load the full thread when it matters**: page actions that scroll, or a Browser session in Playwright.
4. **Structure and store**: Extract or CSS selectors, counts as numbers, a timestamp on every record.
5. **Refresh on a schedule**: re-fetch recent posts in Batch for an engagement curve per post.

```python Python
# pip install requests
import requests

params = {
    "apikey": "YOUR_ZENROWS_API_KEY",
    "url": VIDEO_URL,  # a public video or post page
    "mode": "auto",  # Adaptive Stealth Mode
    "extract": "auto",
}
response = requests.get("https://api.zenrows.com/v1/", params=params)
print(response.json())
```

```javascript Node.js
// npm install playwright
import { chromium } from "playwright";

const THREAD_URL = "https://www.reddit.com/r/example/comments/abc123/";  // placeholder
const COMMENT_SELECTOR = "[data-testid='comment']";  // example selector

const browser = await chromium.connectOverCDP(
  "wss://browser.zenrows.com?apikey=YOUR_ZENROWS_API_KEY"
);
const page = await browser.newPage();
await page.goto(THREAD_URL);

// Scroll until the thread stops growing, then read every comment
for (let i = 0; i < 20; i++) {
  await page.mouse.wheel(0, 3000);
  await page.waitForTimeout(1200);
}
const comments = await page.$$eval(COMMENT_SELECTOR, (nodes) =>
  nodes.map((n) => n.innerText)
);
console.log(comments.length, "comments");
await browser.close();
```

```bash CLI
npx -y @zenrows/cli init
# A public video page as structured JSON
zenrows extract VIDEO_URL --autoparse
# Daily engagement refresh: one {"url": "..."} per tracked post
zenrows batch create posts.jsonl --wait
zenrows batch results JOB_ID --out engagement.jsonl
```

```text Claude Code (MCP)
# Connect once
claude mcp add zenrows -e ZENROWS_API_KEY=YOUR_ZENROWS_API_KEY -- npx -y @zenrows/mcp

# Then ask:
Use Zenrows to open the public YouTube channel pages of these four brands and list each channel's last ten videos with title, upload date, views and comment count.
```

## Which Zenrows product fits

| If you need to | Use | Why |
|---|---|---|
| Fetch a public post, profile or search | [Fetch](/products/fetch) | Renders JavaScript and handles rate limits in one request |
| Get post and profile fields without selectors | [Extract](/products/extract) | JSON that adapts to layout changes |
| Scroll long threads or click through tabs | [Browser](/products/browser) | A real browser over CDP, driven by Playwright or Puppeteer |
| Refresh engagement on thousands of posts daily | [Batch](/products/batch) | One job, results by webhook or download |
| Let analysts pull social data in chat | [MCP Server](/mcp) | Claude, Cursor and other MCP clients call Zenrows as a tool |

## What success looks like

| Measure | What good looks like | How to check it |
|---|---|---|
| Field completeness | Text, handle, timestamp and counts on nearly every post | Empty fields per platform, per run |
| Thread depth | Comments to the end of the thread, or your set depth | Stored comments against the displayed count |
| Engagement history | Readings at fixed intervals, not one snapshot | Readings per post in its first week |
| Platform coverage | Every platform returns data every run | Successful requests per platform per day |
| Public-only scope | No login-gated or private pages | Audit source URLs against allowed page types |
| Refresh run time | The daily refresh fits its window as the list grows | Start and end time of each Batch job |

## Social media scraping FAQ

### What is social media scraping?

Turning public posts, profiles, comments, hashtags and engagement counts into records, from pages a logged-out visitor sees. Used for listening, creator research, trends and sentiment datasets.

### Is it legal to scrape social media data?

It depends. Public content is widely collected, but platform terms apply and posts hold personal data under GDPR and CCPA: take only what you need, skip sensitive categories, pseudonymise handles. Not legal advice; ask your legal team.

### What about private accounts or content behind a login?

Zenrows is built for public data a logged-out visitor can open. For your own accounts' data (ad metrics, page insights), use the platform's official API with your credentials and join it with the public data.

### Which platforms can I collect from?

Any platform visible logged out: Reddit threads and search; YouTube videos, channels and comments; TikTok videos, profiles and hashtags; public X posts; Substack and Fandom. What shows without login varies, so test your page types before scaling.

### Should I use a social media scraping API or the official platform API?

Official APIs suit your own accounts but cap volume, often cost money and exclude others' content. Scraping reads public pages across platforms in one format. Many use both: official for owned channels, scraping for the conversation.

### How do I scrape social media data without coding?

Connect the Zenrows MCP server to Claude, Cursor or another client and ask, say, for the last ten videos on some YouTube channels with views; you get a table. For repeat jobs, the CLI runs it in one command from a terminal or cron.

### Can I get historical posts?

What the platform still shows, like older videos or a thread's full comments. A page only shows today's counts, so for engagement history start early and store a reading per visit.

## Related use cases

- [Social listening data](https://www.zenrows.com/use-cases/social-listening.md): Keyword mentions with thread context from Reddit, YouTube, TikTok and forums, for trend and sentiment tracking.
- [Influencer data](https://www.zenrows.com/use-cases/influencer-data.md): Public creator profiles, recent posts and engagement history from TikTok, YouTube, Twitch and X.
- [Sentiment analysis data](https://www.zenrows.com/use-cases/sentiment-analysis-data.md): Review text with ratings, forum threads and comments, cleaned and labeled for sentiment and NLP models.
- [Brand monitoring](https://www.zenrows.com/use-cases/brand-monitoring.md): Every mention of your brand in news, forums, reviews and search, as clean text for sentiment and alerts.
- [Review scraping](https://www.zenrows.com/use-cases/review-scraping.md): Review text, ratings, dates and replies from Amazon, Google, Yelp, Trustpilot and G2, every page.
- [Competitor ad intelligence](https://www.zenrows.com/use-cases/competitor-ads.md): Creatives, copy and landing pages from ad libraries and paid search results, tracked by advertiser and country.

Start free: https://app.zenrows.com/register. Docs: https://docs.zenrows.com

## Structured data



<script type="application/ld+json">
{"@context":"https://schema.org","@graph":[{"@type":"WebPage","@id":"https://www.zenrows.com/use-cases/social-media-scraping#webpage","url":"https://www.zenrows.com/use-cases/social-media-scraping","name":"Social media scraping","description":"Social media scraping for public posts, profiles, comments and engagement from Reddit, YouTube, TikTok and X. Structured JSON from public pages, at volume.","isPartOf":{"@id":"https://www.zenrows.com/#website"},"inLanguage":"en","datePublished":"2026-10-18","dateModified":"2026-10-18","about":{"@type":"Thing","name":"social media scraping"},"keywords":"social media scraping, social media scraper, scrape social media data, social media data, social media scraping api, social media data api, social media scraping tools, how to scrape social media data, social media monitoring, what is social media scraping","publisher":{"@type":"Organization","name":"Zenrows","url":"https://www.zenrows.com/"}},{"@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://www.zenrows.com/"},{"@type":"ListItem","position":2,"name":"Use cases","item":"https://www.zenrows.com/use-cases"},{"@type":"ListItem","position":3,"name":"Social media scraping","item":"https://www.zenrows.com/use-cases/social-media-scraping"}]},{"@type":"FAQPage","@id":"https://www.zenrows.com/use-cases/social-media-scraping#faq","mainEntity":[{"@type":"Question","name":"What is social media scraping?","acceptedAnswer":{"@type":"Answer","text":"Turning public posts, profiles, comments, hashtags and engagement counts into records, from pages a logged-out visitor sees. Used for listening, creator research, trends and sentiment datasets."}},{"@type":"Question","name":"Is it legal to scrape social media data?","acceptedAnswer":{"@type":"Answer","text":"It depends. Public content is widely collected, but platform terms apply and posts hold personal data under GDPR and CCPA: take only what you need, skip sensitive categories, pseudonymise handles. Not legal advice; ask your legal team."}},{"@type":"Question","name":"What about private accounts or content behind a login?","acceptedAnswer":{"@type":"Answer","text":"Zenrows is built for public data a logged-out visitor can open. For your own accounts' data (ad metrics, page insights), use the platform's official API with your credentials and join it with the public data."}},{"@type":"Question","name":"Which platforms can I collect from?","acceptedAnswer":{"@type":"Answer","text":"Any platform visible logged out: Reddit threads and search; YouTube videos, channels and comments; TikTok videos, profiles and hashtags; public X posts; Substack and Fandom. What shows without login varies, so test your page types before scaling."}},{"@type":"Question","name":"Should I use a social media scraping API or the official platform API?","acceptedAnswer":{"@type":"Answer","text":"Official APIs suit your own accounts but cap volume, often cost money and exclude others' content. Scraping reads public pages across platforms in one format. Many use both: official for owned channels, scraping for the conversation."}},{"@type":"Question","name":"How do I scrape social media data without coding?","acceptedAnswer":{"@type":"Answer","text":"Connect the Zenrows MCP server to Claude, Cursor or another client and ask, say, for the last ten videos on some YouTube channels with views; you get a table. For repeat jobs, the CLI runs it in one command from a terminal or cron."}},{"@type":"Question","name":"Can I get historical posts?","acceptedAnswer":{"@type":"Answer","text":"What the platform still shows, like older videos or a thread's full comments. A page only shows today's counts, so for engagement history start early and store a reading per visit."}}]}]}
</script>
