Guides / Scrape TikTok
How to Scrape TikTok in 2026
TikTok uses aggressive anti-bot detection, a JavaScript-heavy single-page application architecture, rate limiting, and geo-restrictions. Scraping it yourself means dealing with sophisticated fingerprinting and constantly changing page structures. With Browser7, you get fully rendered profile data and video links in a single API call.
What makes TikTok hard to scrape
Anti-bot detection
TikTok uses advanced browser fingerprinting, behavioral analysis, and device validation to detect automated access. Datacenter IPs are blocked immediately, and headless browser signatures are detected and rejected.
JavaScript-heavy SPA
TikTok renders profiles, video grids, and engagement metrics entirely with client-side JavaScript. A simple HTTP request returns a page shell with no useful profile data. You need a real browser with full JavaScript execution.
Rate limiting
TikTok enforces aggressive rate limits and will block IPs that make too many requests. Exceeding these limits results in CAPTCHA challenges, temporary blocks, or permanent bans.
Geo-restrictions
TikTok content availability varies by region. Some profiles and videos may not be accessible from certain countries, and the platform may show different content based on the visitor's location.
Scrape a TikTok profile
Browser7 handles proxy rotation, browser fingerprinting, CAPTCHA solving, and JavaScript rendering automatically. This example renders a public TikTok profile page and returns the fully rendered HTML with profile data and video thumbnails.
from browser7 import Browser7
client = Browser7(
api_key="b7_your_api_key",
base_url="https://ca-api.browser7.com/v1"
)
result = client.render(
"https://www.tiktok.com/@natgeo",
country_code="US",
)
print(result.html)That is the complete code. No proxy configuration, no browser setup, no geo-restriction handling. The response contains the fully rendered HTML of the TikTok profile page, including follower counts, bio, and recent video links.
Data you can extract
The rendered HTML contains all the data TikTok shows to a real visitor. Common data points to extract:
Profile stats
- Follower count
- Following count
- Total likes count
- Verified badge status
- Account category
Bio and about
- Display name
- Username/handle
- Bio text
- Profile picture URL
- External website link
Videos
- Video URLs and IDs
- Thumbnail image URLs
- Video view counts
- Video descriptions/captions
- Sound/music used
Engagement
- Like counts per video
- Comment counts per video
- Share counts
- Save/bookmark counts
- Engagement rate calculations
Complete example: render and parse profile data
Here is a complete example that renders a TikTok profile and extracts structured data. TikTok uses excellent data-e2e test attributes on key profile elements, making parsing significantly more reliable than class-based selectors. Elements like followers-count, following-count, and likes-count are clearly labeled.
from browser7 import Browser7
from bs4 import BeautifulSoup
import json
client = Browser7(
api_key="b7_your_api_key",
base_url="https://ca-api.browser7.com/v1"
)
result = client.render(
"https://www.tiktok.com/@natgeo",
country_code="US",
)
soup = BeautifulSoup(result.html, "html.parser")
profile = {
"displayName": None,
"username": None,
"bio": None,
"followers": None,
"following": None,
"likes": None,
}
# Display name from data-e2e attribute
name_el = soup.select_one('h1[data-e2e="user-title"]')
if name_el:
profile["displayName"] = name_el.get_text(strip=True)
# Username from data-e2e attribute
username_el = soup.select_one('h2[data-e2e="user-subtitle"]')
if username_el:
profile["username"] = username_el.get_text(strip=True)
# Bio from data-e2e attribute
bio_el = soup.select_one('h2[data-e2e="user-bio"]')
if bio_el:
profile["bio"] = bio_el.get_text(strip=True)
# Followers count
followers_el = soup.select_one('strong[data-e2e="followers-count"]')
if followers_el:
profile["followers"] = followers_el.get_text(strip=True)
# Following count
following_el = soup.select_one('strong[data-e2e="following-count"]')
if following_el:
profile["following"] = following_el.get_text(strip=True)
# Likes count
likes_el = soup.select_one('strong[data-e2e="likes-count"]')
if likes_el:
profile["likes"] = likes_el.get_text(strip=True)
print(json.dumps(profile, indent=2))CSS selectors may change if TikTok updates their page structure. The data-e2e attributes tend to be stable since they are used for TikTok's own end-to-end testing, but can still change. Inspect the current page if any fields return null.
Sample output:
{
"displayName": "National Geographic",
"username": "natgeo",
"bio": "Experience the world.",
"followers": "8.2M",
"following": "12",
"likes": "112.5M"
}Extract recent video links
The profile page contains links to recent videos. Extract these URLs to build a list of videos you can then scrape individually for detailed engagement data, captions, and comments.
from browser7 import Browser7
from bs4 import BeautifulSoup
client = Browser7(
api_key="b7_your_api_key",
base_url="https://ca-api.browser7.com/v1"
)
result = client.render(
"https://www.tiktok.com/@natgeo",
country_code="US",
)
soup = BeautifulSoup(result.html, "html.parser")
# Extract links to recent videos
video_links = []
for link in soup.select('a[href*="/video/"]'):
href = link.get("href")
if href and href not in video_links:
video_links.append(href)
for url in video_links[:10]:
if url.startswith("http"):
print(url)
else:
print(f"https://www.tiktok.com{url}")Take a screenshot of the profile
Capture TikTok profiles as images for influencer analysis reports, brand monitoring dashboards, or tracking follower growth and content trends over time.
import base64
from browser7 import Browser7
client = Browser7(
api_key="b7_your_api_key",
base_url="https://ca-api.browser7.com/v1"
)
result = client.render(
"https://www.tiktok.com/@natgeo",
country_code="US",
block_images=False,
include_screenshot=True,
screenshot_full_page=True,
screenshot_format="png"
)
# Save the screenshot
with open("tiktok-profile.png", "wb") as f:
f.write(base64.b64decode(result.screenshot))
print("Screenshot saved")What this costs
Every TikTok page render costs $0.01 - the same as any other website. Residential proxies, JavaScript rendering, CAPTCHA solving, and screenshots are all included. There are no per-domain surcharges, no credit multipliers, and no bandwidth fees.
Scraping 1,000 TikTok profiles costs $10. You know this before you start, not after.