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.
Updated
{
"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"
}
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 | |
| Influencer research | Profile stats, recent posts, engagement per post | |
| Trend and hashtag tracking | Hashtag volume, top posts, sounds, formats over time | |
| Comment mining for product feedback | Comment text, replies, likes, timestamps | |
| Competitor content benchmarking | Cadence, formats, engagement of competitor accounts | Public brand pages on |
| 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.
Errors, empty pages or challenges on Reddit and TikTok
Zenrows' stealth and retries get through
A script bundle, no post text or counts
Adaptive Stealth Mode renders and returns the loaded post
Ten comments of thousands
Page actions scroll and click first; Browser runs longer scrolls in Playwright
Trending and search differ by country
Geotargeting fetches as a local visitor
Class names change; selectors return blanks
Extract returns fields with no selectors to maintain
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
- List the public pages: profiles, posts, searches, hashtags a logged-out visitor can open.
- Fetch with Adaptive Stealth Mode, which escalates to rendering and stealth only when needed.
- Load the full thread when it matters: page actions that scroll, or a Browser session in Playwright.
- Structure and store: Extract or CSS selectors, counts as numbers, a timestamp on every record.
- Refresh on a schedule: re-fetch recent posts in Batch for an engagement curve per post.
# 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())// 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();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# 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
- Fetch a public post, profile or search FetchRenders JavaScript and handles rate limits in one request
- Get post and profile fields without selectors ExtractJSON that adapts to layout changes
- Scroll long threads or click through tabs BrowserA real browser over CDP, driven by Playwright or Puppeteer
- Refresh engagement on thousands of posts daily BatchOne job, results by webhook or download
- Let analysts pull social data in chat MCP ServerClaude, 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
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.