- TikTok
- TikTok following API
TikTok following API
The accounts a creator follows, each with its name, avatar, bio, verified flag and follower, following, video and like counts.
GET /v1/tiktok/profile/following
GET /v1/tiktok/profile/following
The accounts a creator follows, each with its name, avatar, bio, verified flag and follower, following, video and like counts. A page holds 30 accounts; follow cursor for more. parent is the creator's profile. A creator who hides the list, and a private account, answer private (TikTok lets a creator keep the list to themselves, so many large accounts do).
- Cost: 1 credit
- Cache: Results are kept up to 30 days; send
max_age_daysto reuse them for free. - Timeout: A request still running after about 25 seconds answers
202with a job to poll (Batch and jobs).
Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
handle | string | one of | Username, with or without the leading @. Also accepted as username. |
id | string | one of | TikTok user id (numeric) or secUid. Also accepted as user_id, secUid, sec_uid. |
Send at least one of handle, id. If you send several, the first listed is used and the rest are ignored.
Every request also accepts:
cursor: the cursor from the previous page (Pagination).trim:truefor a smaller response withoutnullfields andextra.raw:trueto also get the platform's original object asraw.max_age_days: accept a cached result up to this many days old, for 0 credits (Caching).
Example request#
Set your key in the environment first (see Authentication).
1curl -G "https://api.socialscrape.dev/v1/tiktok/profile/following" \2 -H "x-api-key: $SOCIALSCRAPE_API_KEY" \3 --data-urlencode "handle=nasa"1import os2import requests34params = {5 "handle": "nasa",6}7res = requests.get(8 "https://api.socialscrape.dev/v1/tiktok/profile/following",9 headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},10 params=params,11)12body = res.json()1314if body["ok"]:15 print(body["data"])16else:17 print(body["error"]["code"], body["error"]["message"])1const url = new URL("https://api.socialscrape.dev/v1/tiktok/profile/following");2url.search = new URLSearchParams({3 "handle": "nasa"4}).toString();5const res = await fetch(url, {6 headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! },7});8const body = await res.json();910if (body.ok) {11 console.log(body.data);12} else {13 console.error(body.error.code, body.error.message);14}1{2 "nodes": [3 {4 "name": "SocialScrape TikTok following",5 "type": "n8n-nodes-base.httpRequest",6 "typeVersion": 4.2,7 "position": [8 0,9 010 ],11 "parameters": {12 "method": "GET",13 "url": "https://api.socialscrape.dev/v1/tiktok/profile/following",14 "sendQuery": true,15 "queryParameters": {16 "parameters": [17 {18 "name": "handle",19 "value": "nasa"20 }21 ]22 },23 "sendHeaders": true,24 "headerParameters": {25 "parameters": [26 {27 "name": "x-api-key",28 "value": "={{ $env.SOCIALSCRAPE_API_KEY }}"29 }30 ]31 }32 }33 }34 ],35 "connections": {}36}Example response#
This is a sample from a recorded response, lists and long text are shortened, other people's names and handles are replaced. Status 200.
1{2 "ok": true,3 "credits_charged": 1,4 "credits_remaining": 4999,5 "cached": false,6 "cached_at": null,7 "request_id": "req_9249fa14ca9f5220b5265805",8 "data": {9 "object": "list",10 "items": [11 {12 "object": "profile",13 "platform": "tiktok",14 "id": "1000000001",15 "handle": "sample_user",16 "name": "Sample User",17 "headline": null,18 "url": null,19 "kind": "creator",20 "bio": null,21 "avatar_url": null,22 "banner_url": null,23 "verified": true,24 "is_private": false,25 "external_url": null,26 "links": null,27 "location": null,28 "category": null,29 "created_at": null,30 "stats": {31 "followers": 120700,32 "following": 73,33 "posts": 202,34 "likes": 1300000,35 "views": null36 },37 "extra": {38 "comment_setting": 0,39 "download_setting": 0,40 "duet_setting": 0,41 "friends": 0,42 "is_tiktok_seller": false,43 "sec_uid": "MS4wLjABAAAA927o3zHxfudDnim6_JtQO_vF1GB-xC39hrvp-FoDJp-vuypAjyURRyogMfKKsJY0",44 "stitch_setting": 045 }46 },47 {48 "object": "profile",49 "platform": "tiktok",50 "id": "1000000001",51 "handle": "sample_user",52 "name": "Sample User",53 "headline": null,54 "url": null,55 "kind": "creator",56 "bio": null,57 "avatar_url": null,58 "banner_url": null,59 "verified": true,60 "is_private": false,61 "external_url": null,62 "links": null,63 "location": null,64 "category": null,65 "created_at": null,66 "stats": {67 "followers": 4000000,68 "following": 3,69 "posts": 484,70 "likes": 58000000,71 "views": null72 },73 "extra": {74 "comment_setting": 0,75 "download_setting": 3,76 "duet_setting": 0,77 "friends": 0,78 "is_tiktok_seller": false,79 "sec_uid": "MS4wLjABAAAA_koFVCM4NeoOqAdo46YE-YwasHf8k6peh1lA9Unpsu5_ruMz1dQwk3_4LfQ4RvUm",80 "stitch_setting": 081 }82 }83 ],84 "cursor": null,85 "has_more": false,86 "parent": {87 "object": "profile",88 "platform": "tiktok",89 "id": "1000000001",90 "handle": "sample_user",91 "name": "Sample User",92 "headline": null,93 "url": null,94 "kind": "creator",95 "bio": null,96 "avatar_url": null,97 "banner_url": null,98 "verified": true,99 "is_private": false,100 "external_url": null,101 "links": null,102 "location": null,103 "category": null,104 "created_at": null,105 "stats": {106 "followers": 2171299,107 "following": 23,108 "posts": 65,109 "likes": 11638237,110 "views": null111 },112 "extra": {113 "comment_setting": 0,114 "download_setting": 0,115 "duet_setting": 0,116 "following_visible": true,117 "friends": 17,118 "is_commerce_user": false,119 "is_tiktok_seller": false,120 "sec_uid": "MS4wLjABAAAAU9BRVzC8oCaegVnia8IbqWhPb_-dbU7s00Y3wS1_Nx8g5RUaYvyXrpejgjdxTwd6",121 "stitch_setting": 0122 }123 }124 },125 "cursor": null,126 "has_more": false127}Response#
A list of Profile objects in data.items, with data.cursor and data.has_more.
See Data models for every field. The envelope around data is described in Responses.
Errors#
Failures are free: credits_charged is 0. Branch on error.code, never on the message.
| Code | HTTP | Retry | Meaning |
|---|---|---|---|
invalid_params | 400 | no | A parameter is missing, unknown or has the wrong type. |
not_found | 404 | no | The platform says this profile, post or item does not exist. |
private | 403 | no | The content is private. |
Every request can also fail with the account and platform errors listed on the Errors page.
Example error:
1{2 "ok": false,3 "error": {4 "code": "private",5 "message": "The content is private.",6 "retryable": false7 },8 "credits_charged": 0,9 "request_id": "req_e9862f1328418e4c69460664"10}Also served at#
These paths answer the same request, so code written for other APIs keeps working: /v1/tiktok/user/following. See Switching from ScrapeCreators.
Related endpoints#
- TikTok profile (
GET /v1/tiktok/profile) - TikTok profile region (
GET /v1/tiktok/profile/region) - TikTok profile videos (
GET /v1/tiktok/profile/videos) - TikTok collection videos (
GET /v1/tiktok/collection/videos) - TikTok video details (
GET /v1/tiktok/video) - TikTok video transcript (
GET /v1/tiktok/video/transcript) - TikTok video comments (
GET /v1/tiktok/video/comments) - TikTok comment replies (
GET /v1/tiktok/video/comment/replies)