
Ethan Collins
Pattern Recognition Specialist

AI agents powering social listening, brand monitoring, and market research need structured data from public social media profiles, posts, and engagement metrics. Social platforms deploy aggressive CAPTCHA and bot protection that blocks automated data collection — even for publicly available information. This guide covers building a social media public data pipeline for AI agents using CapSolver to maintain continuous access to platform data.
AI agents performing social listening, competitive intelligence, and market research need access to public social media data. Brand mentions, trending topics, engagement patterns, and public sentiment are all derived from publicly posted content. However, social platforms deploy multiple layers of bot protection to manage automated access.
When an AI agent attempts to collect public posts, profile information, or engagement metrics at scale, it triggers verification challenges.
pip install git+https://github.com/capsolver-ai/capsolver-core.git
pip install aiohttp beautifulsoup4 pandas
export CAPSOLVER_API_KEY="your-capsolver-api-key"
SOCIAL_PLATFORMS = {
"reddit_public": {
"name": "Reddit (Public)",
"captcha_type": "ReCaptchaV2TaskProxyLess",
"trigger": "rate_limit_after_30_pages",
"public_data": ["posts", "comments", "upvotes", "subreddit_stats"]
},
"twitter_public": {
"name": "X/Twitter (Public)",
"captcha_type": "AntiTurnstileTaskProxyLess",
"trigger": "behavioral_and_rate",
"public_data": ["tweets", "likes", "retweets", "follower_count"]
},
"linkedin_public": {
"name": "LinkedIn (Public Profiles)",
"captcha_type": "AntiTurnstileTaskProxyLess",
"trigger": "after_20_profile_views",
"public_data": ["name", "headline", "company", "public_posts"]
},
"review_platforms": {
"name": "G2/Trustpilot/Capterra",
"captcha_type": "ReCaptchaV2TaskProxyLess",
"trigger": "after_50_reviews_viewed",
"public_data": ["reviews", "ratings", "company_scores", "feature_mentions"]
}
}
import asyncio
from capsolver_core import create_capsolver, CaptchaType, CaptchaInfo
from dataclasses import dataclass
from typing import List
@dataclass
class SocialDataPoint:
platform: str
content_type: str
text: str
engagement: dict
author: str
timestamp: float
url: str
class SocialDataCollector:
def __init__(self, api_key: str, proxies: list):
self.cap = create_capsolver(api_key=api_key)
self.proxies = proxies
self.proxy_idx = 0
async def collect_public_posts(self, platform: str, query: str, max_pages: int = 5) -> List[SocialDataPoint]:
results = []
for page in range(max_pages):
proxy = self.proxies[self.proxy_idx % len(self.proxies)]
self.proxy_idx += 1
html = await self._fetch(platform, query, page, proxy)
if self._is_captcha(html):
token = await self._solve(platform)
html = await self._retry(platform, query, page, proxy, token)
posts = self._parse_posts(html, platform)
results.extend(posts)
if not posts:
break
await asyncio.sleep(5)
return results
async def _solve(self, platform_key: str) -> str:
config = SOCIAL_PLATFORMS[platform_key]
type_map = {
"ReCaptchaV2TaskProxyLess": CaptchaType.RECAPTCHA_V2,
"AntiTurnstileTaskProxyLess": CaptchaType.CLOUDFLARE
}
info = CaptchaInfo(
type=type_map[config["captcha_type"]],
website_url=f"https://www.{platform_key.split('_')[0]}.com",
website_key=config.get("site_key", "")
)
solution = await self.cap.solve(info)
return solution.token
async def monitor_brand_mentions(self, brand: str, platforms: list) -> dict:
all_mentions = []
for platform in platforms:
posts = await self.collect_public_posts(platform, brand)
mentions = [p for p in posts if brand.lower() in p.text.lower()]
all_mentions.extend(mentions)
return {
"brand": brand,
"total_mentions": len(all_mentions),
"by_platform": {p: len([m for m in all_mentions if m.platform == p]) for p in platforms}
}
async def close(self):
await self.cap.aclose()
| Use Case | Data Required | Platforms | Value |
|---|---|---|---|
| Brand sentiment | Public mentions + engagement | Reddit, Twitter, Reviews | Real-time brand health |
| Competitive intel | Competitor mentions + sentiment | All platforms | Market positioning |
| Trend detection | Post volume + topics over time | Reddit, Twitter | Early trend identification |
| Lead generation | Public professional profiles | LinkedIn (public) | Sales prospecting data |
| Product feedback | Reviews + feature mentions | G2, Capterra, Trustpilot | Product development input |
| Monitoring Scope | Daily Collections | Monthly CAPTCHAs | Monthly Cost |
|---|---|---|---|
| 1 brand, 2 platforms | ~60 pages | ~540 | $1.08-1.62 |
| 5 brands, 3 platforms | ~450 pages | ~4,050 | $8.10-12.15 |
| 20 brands, 4 platforms | ~2,400 pages | ~21,600 | $43-65 |
Claim Your Bonus Code: Use code WEBS at CapSolver Dashboard to get an extra 5% bonus on every recharge.
The CapSolver FAQ on responsible use provides additional guidance. The CapSolver web scraping guide covers infrastructure patterns. For Cloudflare-protected platforms, the Turnstile documentation provides implementation details.
Social media public data collection for AI agents requires handling diverse protection systems across platforms while maintaining strict ethical boundaries. CapSolver provides the verification-clearing infrastructure that enables continuous access to public social data — solving reCAPTCHA and Cloudflare Turnstile in 3-12 seconds.
Collecting publicly posted information is generally permissible in most jurisdictions. However, platform terms of service may restrict automated access. Always consult legal counsel for your specific use case.
Platforms with standard CAPTCHA protection: Reddit (public subreddits), X/Twitter (public tweets), LinkedIn (public profiles), review sites (G2, Trustpilot, Capterra), and community forums.
Public data includes: post text, engagement metrics (likes, shares, comments), posting timestamp, author public profile information, hashtags, and media links. Private messages and non-public profile fields are never collected.
Learn scalable Rust web scraping architecture with reqwest, scraper, async scraping, headless browser scraping, proxy rotation, and compliant CAPTCHA handling.

Learn the best techniques to scrape job listings without getting blocked. Master Indeed scraping, Google Jobs API, and web scraping API with CapSolver.
