Guide
Social media scraping: methods, limits and APIs
Updated by the Handles API team
What social media scraping is
Social media scraping is a program reading public pages or endpoints of a social platform and turning what it finds into structured data. It is the opposite of using a feature the platform built for you, which is what an official API is.
Three kinds of data are usually collected. Profiles carry the handle, name, bio, verification state and category. Counters carry followers, following, posts and likes, and become useful when you store them daily. Posts carry text, publication time, links, media and engagement counts.
Everything in this guide concerns public data. Private and protected accounts, direct messages and anything behind a login of someone else's are out of scope, and so are personal email addresses.
The four methods compared
There are four ways to get public social data, and they trade effort against stability. As of November 2026 the pattern is the same on every platform: the more the method depends on the platform's web pages, the more often it breaks.
| Method | How it works | Breaks when | Cost | Best for |
|---|---|---|---|---|
| HTML or JSON parsing | Request pages or internal endpoints and parse the response | Markup or endpoints change, a login wall or bot challenge appears, an IP is blocked | Free code, plus proxies and upkeep | A small one-off job |
| Headless browser | Drive Playwright or Puppeteer and read the rendered page | Page layout changes, the platform detects automation, sessions expire | Compute, proxies and maintenance time | Pages that need JavaScript to render |
| Official API | Register an app and call the platform's documented endpoints | Rarely; access rules and prices change by announcement | Free, metered or approval-based, depends on the platform | Posting, user-authorized data, anything the platform sanctions |
| Data API | Send one key to a service that returns public data as JSON | The provider repairs it; you see a changed field or a 503 | Credits, plans from $29 a month | Public profiles and counters across platforms |
The first two put the maintenance on you. The last two move it to a platform or a provider, at the price of less flexibility: you get the fields they expose and no others.
Platform by platform: what you can use
Each platform offers a different official route, and the gaps between them are the reason people scrape. The table lists what the official API gives, whether logged-out visitors hit a login wall, and what Handles API covers.
| Platform | Official API | Login wall | Handles API catalog | Live read |
|---|---|---|---|---|
| X | Pay-per-use reads: $0.005 per post, $0.010 per user (X API pricing) | Yes, for most pages and searches | About 33.0M accounts | Yes, 2 credits |
| Business and Creator accounts only; Business Discovery reads other professional accounts; Basic Display closed 4 December 2024 (Instagram Platform) | Often, for logged-out visitors | About 53K accounts | No, switched off for now | |
| TikTok | Research API for eligible academic and non-profit researchers; Display API returns only the authorizing user's own data (TikTok Research API) | Bot challenges and sign-in prompts | About 27K accounts | Catalog only |
| YouTube | YouTube Data API v3, default quota of 10,000 units a day (quota costs) | No, public channel pages load logged out | About 97K accounts | Catalog only |
| Telegram | Bot API and TDLib, built for bots and clients | No, public channels can be viewed without an account | About 3.7M accounts | Yes, 2 credits, channel read |
| Bluesky | AT Protocol, an open protocol for posting and authenticated reads | No, public profiles are readable without an account | About 4.2M accounts | Catalog only |
| Twitch | Helix API, needs a registered app and token | No, public channel pages load logged out | About 1.9M accounts | Catalog only |
| Kick | Developer tools for apps that channels authorize | No, public channel pages load logged out | About 852K accounts | Catalog only |
| Official APIs cover sign-in, posting and partner programs | Yes, for most profile views | Company records, by slug or domain | Yes, capped at four calls a minute |
Platform-specific guides go deeper: Twitter scraper, Instagram scraper and TikTok scraper. For YouTube, the YouTube Data API guide covers keys and quota. Per-platform field lists are on the platforms docs page.
Staying inside the rules
Major platforms prohibit automated collection in their terms, and public availability does not change that. X states that “crawling or scraping the Services in any form, for any purpose without our prior written consent is expressly prohibited” (X Terms of Service). TikTok's terms bar use of “automated scripts to collect information from or otherwise interact with the Services” (TikTok Terms of Service). Instagram's say “You can't attempt to create accounts or access or collect information in unauthorized ways” (Instagram Terms).
- Public data only. Never collect private or protected content, and never use someone else's login to reach it.
- Minimize personal data. Store the fields you need and delete the rest. Public personal data is still personal data.
- Keep the rate low. Spread requests out. Hammering a platform is a fast way to get blocked and can disrupt the service.
- Read robots.txt and the terms. They tell you what the operator allows, and the terms bind you even where robots.txt is silent.
- Know your data protection duties. In 2023 twelve data protection authorities stated that publicly accessible personal information “is still subject to data protection and privacy laws in most jurisdictions” (joint statement). Under GDPR you need a lawful basis, and you may owe people notice.
Using an API moves the collection off your servers, it does not remove your own obligations under GDPR or similar laws. The court cases and regulator statements are in Is web scraping legal?
When an API is cheaper than scraping
A scraper is cheapest for a small one-off job and gets more expensive each time it has to run on a schedule. The cost is not the first script; it is the upkeep after every change a platform makes.
- Maintenance. Selectors, endpoints and request signatures change, and someone has to notice and repair.
- Proxies. Platforms can block data center IPs and heavy repeat traffic, so you end up paying for rotating addresses.
- Accounts. Where a login is needed, you need accounts, and accounts get suspended.
- Monitoring. A scraper fails quietly, returning empty pages that look like results, until you add checks.
A data API replaces those lines with one metered price. A catalog read costs 1 credit and a live read 2 credits, and the table shows the cost per 1,000 reads on each paid plan. The free trial is 100 credits once, no card.
| Plan | Monthly price | Credits | 1,000 catalog reads | 1,000 live reads |
|---|---|---|---|---|
| Handles API Starter | $29 | 15,000 | $1.93 | $3.87 |
| Handles API Pro | $99 | 75,000 | $1.32 | $2.64 |
| Handles API Business | $299 | 300,000 | $1.00 | $1.99 |
| Handles API Scale | $799 | 1,200,000 | $0.67 | $1.33 |
An API has limits too. The catalog is partial, Instagram live reads are off, and some platforms have no follower lists. Check the limits on each platform page before you choose.
Find a handle on every platform with one request
The people lookup endpoint takes one handle and searches all the catalogs for it, returning each match with evidence of whether the accounts share an owner. It costs 1 credit and is read from the catalog, not from the platforms.
curl "https://api.handlesapi.com/v1/people/lookup?handle=nasa" \
-H "Authorization: Bearer $HANDLES_API_KEY"const res = await fetch("https://api.handlesapi.com/v1/people/lookup?handle=nasa", {
headers: { Authorization: `Bearer ${process.env.HANDLES_API_KEY}` },
});
const { data, meta } = await res.json();import os
import requests
res = requests.get(
"https://api.handlesapi.com/v1/people/lookup?handle=nasa",
headers={"Authorization": f"Bearer {os.environ['HANDLES_API_KEY']}"},
timeout=30,
)
body = res.json(){
"data": {
"entries": [
{
"handle": "nasa",
"profiles": [
{
"platform": "instagram",
"object": "account",
"id": "528817151",
"handle": "nasa",
"name": "NASA",
"audience": 104444295,
"audience_metric": "followers",
"verified": true,
"engagement_rate": 0.3433,
"language": "en",
"category": "politics",
"url": "https://instagram.com/nasa",
"record": {
"user_id": "528817151",
"handle": "nasa",
"full_name": "NASA",
"follower_count": 104444295,
"verified": true,
"category": "politics",
"language": "en",
"avatar_url": "https://scontent-iad3-2.cdninstagram.com/v/t51.2885-19/29090066_159271188110124_11520681590296412...",
"engagement_rate": 0.3433
}
},
{
"platform": "x",
"object": "account",
"id": "11348282",
"handle": "NASA",
"name": "NASA",
"audience": 92086821,
"audience_metric": "followers",
"verified": false,
"engagement_rate": null,
"language": "en",
"category": "science",
"url": "https://x.com/NASA",
"record": {
"user_id": "11348282",
"username": "NASA",
"name": "NASA",
"followers_count": 92086821,
"is_verified": false,
"language": "en",
"category": "science"
}
}
],
"totals": {
"platforms": 6,
"audience": 215774389,
"largest_platform": "instagram"
},
"match": {
"found_on": [
"instagram",
"x"
],
"verified_on": [
"instagram",
"tiktok"
],
"names": [
"nasa",
"user3890627351453"
],
"names_agree": false
}
}
],
"unavailable": []
},
"meta": {
"source": "catalog:cross_platform",
"page": {
"limit": 1,
"next_cursor": null,
"count": 6
},
"request_id": "req_7ed263f1410ea3d5",
"generated_at": "2026-11-26T13:54:54.182Z",
"took_ms": 20
}
}Real response from the live API, captured Nov 26, 2026. Long strings and arrays are shortened.
Filter a catalog
Each platform catalog can also be listed with filters such as min_followers, country, language and category. This request lists X accounts with at least one million followers. Lists use cursor pagination. To find a username across networks without code, use the free username search.
curl "https://api.handlesapi.com/v1/directory/x?min_followers=1000000&limit=3" \
-H "Authorization: Bearer $HANDLES_API_KEY"const res = await fetch("https://api.handlesapi.com/v1/directory/x?min_followers=1000000&limit=3", {
headers: { Authorization: `Bearer ${process.env.HANDLES_API_KEY}` },
});
const { data, meta } = await res.json();import os
import requests
res = requests.get(
"https://api.handlesapi.com/v1/directory/x?min_followers=1000000&limit=3",
headers={"Authorization": f"Bearer {os.environ['HANDLES_API_KEY']}"},
timeout=30,
)
body = res.json(){
"data": [
{
"user_id": "44196397",
"username": "elonmusk",
"name": "Elon Musk",
"description": "https://t.co/ZdBx5WABYx",
"followers_count": 239804602,
"following_count": 1429,
"statuses_count": 112882,
"media_count": 4788,
"favourites_count": 260169,
"url": "https://x.com/elonmusk",
"is_verified": false,
"is_blue_verified": true,
"verified_type": null,
"is_automated": false,
"location": null,
"photo_url": "https://pbs.twimg.com/profile_images/2122506092437504001/NSS4RHyZ_400x400.jpg",
"banner_url": "https://pbs.twimg.com/profile_banners/44196397/1774145451",
"account_created_at": "2009-06-02 20:12:29+00",
"language": "en",
"country": null,
"category": null,
"citation_score": 97790,
"tier": "S",
"status": "active",
"is_nsfw": false,
"last_seen": "2026-11-26 13:53:24.643921+00",
"weekly_growth": -705137
}
],
"meta": {
"page": {
"limit": 3,
"next_cursor": "eyJzIjoiZm9sbG93ZXJzIiwibyI6ImRlc2MiLCJrIjoiMTU1NjU5MjEzIiwidiI6MTE0MzQzNTk3fQ.pTEIlV94SqlKwbI_Kg...",
"count": 3
},
"source": "catalog",
"request_id": "req_c3f291d93d0008b6",
"generated_at": "2026-11-26T13:54:54.256Z",
"took_ms": 29
}
}Real response from the live API, captured Nov 26, 2026. Long strings and arrays are shortened.
Keys are secrets for your server, never for a browser. Plans are on the pricing page, and live X endpoints need the scrape:live scope, which keys do not get by default.
Frequently asked questions
What is social media scraping?
Is social media scraping legal?
Which social platforms offer an official API for public data?
What data can I collect from public profiles?
Is an API cheaper than building a scraper?
Can I scrape private accounts?
Try it on your own handles
The free trial gives you 100 credits for every endpoint, once, with no card. Paid plans start at $29 a month.