TikTok is a goldmine for social media research. But their anti-bot is aggressive. Here is what works.
Official TikTok API
TikTok Research API (for researchers only — requires application):
- Video search and metadata
- Hashtag analytics
- User profile data
What Works Without API
1. TikTok Embed Data
TikTok embeds contain metadata in <script> tags:
const res = await fetch(`https://www.tiktok.com/@user/video/ID`, {
headers: { "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_0)" }
});
const html = await res.text();
const match = html.match(/<script id="__UNIVERSAL_DATA_FOR_REHYDRATION__".*?>(.*?)<\/script>/s);
if (match) {
const data = JSON.parse(match[1]);
// Contains video metadata, author info, stats
}
2. Search via Google
site:tiktok.com "web scraping" inurl:video
3. Use Pre-Built Tools
Apify Store has several TikTok scrapers that handle anti-bot.
Better Alternatives for Social Data
If you just need social media analytics, consider open platforms:
- Bluesky — fully open AT Protocol
- Reddit — JSON endpoint, no auth
- YouTube — Innertube API
These give better data with zero blocking.
Resources
Need TikTok or social media data? $20-50. Email: Spinov001@gmail.com | Hire me
Top comments (0)