TikTok Scraper API — How to Scrape TikTok Data with ScrapingBot
The TikTok scraper API from ScrapingBot lets you collect public profile and hashtag data at scale — in JSON, without getting blocked. With over 1 billion active users, TikTok is one of the richest sources of social data available today. In this guide, you will learn how to set up and use the TikTok scraper API with a simple two-step async pattern that handles all anti-bot protections for you.
Table of contents
1. Why use a TikTok scraper API?
TikTok's official API is private and heavily rate-limited. Nevertheless, for developers and data engineers, the platform's public data represents a real opportunity. Here are the main use cases for a TikTok scraper API:
- Market research — track trends, hashtags, and viral content in real time. For reference, see TikTok's audience insights documentation.
- Influencer analysis — evaluate profiles by followers, engagement rate, and top videos
- Brand monitoring — measure how your brand or competitors are discussed
- ML datasets — build training datasets from public social content
In other words, you can build powerful data pipelines without complex infrastructure. To make this easier, ScrapingBot's TikTok scraper API handles JavaScript rendering, rotating IPs, and anti-bot measures for you.
2. What data can you collect with the TikTok scraper API?
The TikTok scraper API supports two types of data collection. First, you can scrape public profiles. Second, you can collect hashtag data. Both are returned as structured JSON.
TikTok Profiles
| Field | Description |
|---|---|
nickname, id, biography | Basic profile info |
verified, privateAccount | Account status |
followers, following, hearts | Engagement metrics |
videoCount | Total videos published |
topVideos[] | Top videos with full metadata (ID, description, plays, shares, comments, music info) |
TikTok Hashtags
| Field | Description |
|---|---|
title, description | Hashtag info |
videoCount, viewCount | Reach metrics |
topVideos[] | Top videos with engagement data (likes, shares, comments, plays, URL, author) |
3. Prerequisites
To follow this guide and start using the TikTok scraper API, you need three things. First, make sure you have all of them ready before you continue:
- A ScrapingBot account with your username and API key
- A TikTok profile URL or hashtag keyword you want to scrape
- Any HTTP client — cURL, Python
requests, Node.jsaxios, or Postman
4. How the TikTok scraper API works
Overview of the async pattern
Unlike a standard REST API, the TikTok scraper API uses an asynchronous two-step pattern. Indeed, this approach is needed because TikTok actively detects and blocks standard scrapers.
Why async?
In short, TikTok has strong protections that require extra processing time to bypass. Therefore, instead of returning data right away, the API first gives you a responseId. You then use that ID to fetch results once they are ready.
Your App
│
├─ POST /scrape/data-scraper
│ └─ body: { scraper, url / hashtag }
│
│ ← { responseId: "abc123" }
│
├─ GET /scrape/data-scraper-response?responseId=abc123&scraper=tiktokProfile
│ └─ if { status: "pending" } → wait a few seconds and retry
│
└─ ← Full JSON data (profile or hashtag)5. Step 1 — POST request (get a responseId)
To get started with the TikTok scraper API, send a POST request to obtain a responseId. Afterward, you will use that ID in Step 2. Authenticate with HTTP Basic Auth using your ScrapingBot username and API key.
Endpoint
POST https://api.scraping-bot.io/scrape/data-scraperRequest body — TikTok profile
For a profile, pass the tiktokProfile scraper along with the target URL:
{
"scraper": "tiktokProfile",
"url": "https://www.tiktok.com/@nike"
}Request body — TikTok hashtag
For a hashtag, use tiktokHashtag and pass the keyword without the # symbol:
{
"scraper": "tiktokHashtag",
"hashtag": "football"
}cURL example
Here is how to call the TikTok scraper API using cURL:
curl -X POST https://api.scraping-bot.io/scrape/data-scraper \
-u "YOUR_USERNAME:YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"scraper": "tiktokProfile", "url": "https://www.tiktok.com/@nike"}'Python example
Similarly, here is the equivalent TikTok scraper API call in Python:
import requests
from requests.auth import HTTPBasicAuth
response = requests.post(
"https://api.scraping-bot.io/scrape/data-scraper",
json={"scraper": "tiktokProfile", "url": "https://www.tiktok.com/@nike"},
auth=HTTPBasicAuth("YOUR_USERNAME", "YOUR_API_KEY")
)
response_id = response.json().get("responseId")
print(f"Response ID: {response_id}")JavaScript (Node.js) example
Finally, here is the same request using axios in Node.js:
const axios = require('axios');
const { data } = await axios.post(
'https://api.scraping-bot.io/scrape/data-scraper',
{ scraper: 'tiktokProfile', url: 'https://www.tiktok.com/@nike' },
{ auth: { username: 'YOUR_USERNAME', password: 'YOUR_API_KEY' } }
);
const { responseId } = data;
console.log('Response ID:', responseId);6. Step 2 — GET request (poll for results)
Next, use the responseId from Step 1 to poll the TikTok scraper API for your results. If scraping is not finished yet, simply wait a few seconds and try again.
Endpoint
GET https://api.scraping-bot.io/scrape/data-scraper-response?responseId=YOUR_ID&scraper=tiktokProfilePending response
When the data is not ready yet, you will receive this response. In that case, retry after a short delay:
{
"status": "pending",
"message": "Scraping is not finished for this request, try again in a few seconds"
}Python — with retry logic
The following function polls the TikTok scraper API until the data is ready or the retry limit is reached:
import requests, time
from requests.auth import HTTPBasicAuth
def get_tiktok_data(response_id, scraper, username, api_key, max_retries=10):
url = "https://api.scraping-bot.io/scrape/data-scraper-response"
for attempt in range(max_retries):
res = requests.get(
url,
params={"responseId": response_id, "scraper": scraper},
auth=HTTPBasicAuth(username, api_key)
)
data = res.json()
if data.get("status") == "pending":
print(f"Attempt {attempt + 1}: still processing, retrying in 5s...")
time.sleep(5)
continue
return data # Data is ready
raise TimeoutError("Scraping timed out after max retries")
result = get_tiktok_data(response_id, "tiktokProfile", "YOUR_USERNAME", "YOUR_API_KEY")
print(result)JavaScript — with retry logic
Likewise, here is the same polling logic in Node.js with async/await:
async function getTikTokData(responseId, scraper, username, apiKey, maxRetries = 10) {
const url = 'https://api.scraping-bot.io/scrape/data-scraper-response';
for (let attempt = 0; attempt < maxRetries; attempt++) {
const { data } = await axios.get(url, {
params: { responseId, scraper },
auth: { username, password: apiKey }
});
if (data.status === 'pending') {
console.log(`Attempt ${attempt + 1}: still processing, retrying in 5s...`);
await new Promise(r => setTimeout(r, 5000));
continue;
}
return data;
}
throw new Error('Scraping timed out after max retries');
}7. Example JSON response from the TikTok scraper API
Once scraping is complete, you will receive a clean JSON object. In addition, this response is ready to insert into any database or pipeline — no transformation needed:
{
"id": "123456789",
"nickname": "nike",
"biography": "Just Do It.",
"verified": true,
"privateAccount": false,
"followers": 8500000,
"following": 12,
"hearts": 45000000,
"videoCount": 312,
"topVideos": [
{
"id": "987654321",
"description": "Speed is everything. #nike #running",
"playCount": 12000000,
"diggCount": 980000,
"shareCount": 45000,
"commentCount": 12300,
"url": "https://www.tiktok.com/@nike/video/987654321"
}
]
}As you can see, the response includes both profile-level data and an array of top videos. Moreover, each video entry contains full engagement metrics ready for analysis.
8. Tips for using the TikTok scraper API in production
Once your basic setup is working, keep these best practices in mind. They will help you get the most out of the TikTok scraper API at scale:
| Tip | Details |
|---|---|
| Retry with backoff | Wait at least 3–5 seconds between polling attempts to avoid overloading the API |
| Parallel scraping | Send multiple POST requests at once, then poll each responseId in parallel to boost throughput |
| Hashtag scraping | Replace "url" with "hashtag": "yourkeyword" — do not include the # symbol |
| Data storage | The JSON response works directly with MongoDB, PostgreSQL (JSONB), BigQuery, or any data pipeline |
| Error handling | Always wrap your polling loop in a try/catch and set a maxRetries limit to prevent infinite loops |
Ready to start using the TikTok scraper API? Sign up for ScrapingBot and get 100 free credits — no credit card required.
Try ScrapingBot for free →



