TikTok Scraper quickstart
Retrieve one TikTok account profile with the User Detail actor. This walkthrough uses the username and request from the official User Detail example.
Before you begin
You need a Scrapeless account, a valid API key, and cURL. Get your key from the Scrapeless dashboard.
1. Send a profile request
Replace YOUR_API_KEY with your key. You can replace teamtrump with the username you want to retrieve. As in the official example, pass the username itself rather than a profile URL.
curl --request POST 'https://api.scrapeless.com/api/v1/scraper/request' \
--header 'x-api-token: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"actor": "scraper.tiktok.user.detail",
"input": {
"unique_id": "teamtrump"
}
}'actor selects scraper.tiktok.user.detail. The required input.unique_id identifies the account.
2. Read a completed result
An HTTP 200 response returns profile data. This is a subset of the published response example, not a fresh capture:
{
"account_id": "7365161718782395438",
"unique_id": "teamtrump",
"sec_uid": "MS4wLjABAAAAIb0gpCf24bC1i5TWl87J5SjS0h7ZB59nfledznAyQ_DF7-vpgJJ8nYfzo98Ba3fp",
"nickname": "Team Trump",
"profile_url": "https://www.tiktok.com/@teamtrump",
"is_verified": true
}The full example also includes avatar and statistics. Its statistics values are strings. Save the actual sec_uid from your completed result if you want to request the account’s posts with User Work.
3. Retrieve a task that is still processing
If you receive HTTP 201, read taskId from the response and replace YOUR_TASK_ID below:
curl --request GET 'https://api.scrapeless.com/api/v1/scraper/result/YOUR_TASK_ID' \
--header 'x-api-token: YOUR_API_KEY'Use Results and Polling for polling intervals and retry limits. Reuse the returned task ID rather than creating a duplicate profile request.
If the request fails
Inspect the HTTP status and response body. The User Detail reference documents a 400 response with code and message, and includes the error example code: 20500, message: "scraping failed". Check the input username and authentication before retrying.
Next steps
Continue to Endpoints to request posts using sec_uid or retrieve a Shop product using product_id and region.