Platforms
TikTok
Read TikTok profiles and their lists, posts, comments and replies, transcripts, hashtags, sounds, playlists, live rooms, search and trending.
Read profiles and every list on them, posts with their comments and captions, and what TikTok shows by hashtag, sound, search and trend.
Quick Reference
| Property | Value |
|---|---|
| Endpoints | 22 |
| Accounts by | handle, url or secUid |
| Posts by | url, id or a share link |
| Posts a page | 30 |
| Comments a page | 50, with replies |
| Transcripts | 10 credits |
| Counts | Exact |
Accounts
| Endpoint | Returns | Credits |
|---|---|---|
profile | A profile with its exact follower and like counts. | 1 |
profile/followers | An account's followers, newest first, 30 a page. | 1 |
profile/following | The accounts an account follows, when it shows them. | 1 |
profile/liked | Posts an account liked, when its likes are public. | 1 |
profile/playlists | The playlists an account made. | 1 |
profile/posts | An account's posts, newest first, 30 a page. | 1 |
profile/reposts | Other people's posts an account reposted. | 1 |
live | Whether an account is live, and its room. | 1 |
Read a Profile
import { SocialAPI } from "@socialapihq/sdk";
const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });
const { data } = await client.tiktok.profile({ handle: "nike" });{
"data": {
"id": "208464585232822272",
"username": "nike",
"displayName": "Nike",
"bio": "Just Do It.",
"avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/e0b0ac7b6ad6447a8e923fd1eb162f2c~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=c73b1f8a&x-expires=1795730400&x-signature=WFCAToitWtbkgo5qXRwrQmcX%2FZY%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my",
"url": "https://www.tiktok.com/@nike",
"verified": true,
"private": false,
"followers": 9440793,
"following": 94,
"likes": 51312842,
"posts": 1131,
"externalUrl": "http://empli.fi/niketiktok",
"createdAt": null,
"ext": {
"secUid": "MS4wLjABAAAA_3ndMt8d_tECTdpKgCxcx238tOnQZX-20wqN01aMui5zQ7hsqSdff-jC5qYC-Cl_",
"friends": 47,
"liked": 0,
"category": "Sports, Fitness & Outdoors",
"seller": false,
"likesPublic": false,
"roomId": null
}
}
}Every count is exact: followers, following, likes and posts.
After a Rename
An account's ext.secUid stays the same when its handle changes. Pass it as secUid to read the account by it.
Hidden Lists
- Following returns
403 PRIVATEwhen the account hides it. - Liked posts are an empty list when its likes are private. Its
ext.likesPublicsays which. - A private account's posts and lists return
403 PRIVATE, at no cost.
Live Rooms
Read a room by its account, or by roomId. By its id, the room also says how many entered and when it ended.
Posts
| Endpoint | Returns | Credits |
|---|---|---|
playlist/posts | The posts of a playlist, 30 a page. | 1 |
post | One post with its counts, media and sound. | 1 |
post/comments | A post's top-level comments, 50 a page. | 1 |
post/comment/replies | The replies to one comment, 50 a page. | 1 |
post/related | Posts TikTok recommends beside one post. | 1 |
post/transcript | A post's captions as text with their times. | 10 |
Post Fields
- The text on the video is in
ext.screenText. - TikTok's guess of the caption's language is in
ext.language. - The caption tracks are in
ext.subtitles.
Comments and Replies
Comments come 50 a page. Read a comment's replies with the post and its id as commentId.
Transcripts
import { SocialAPI } from "@socialapihq/sdk";
const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });
const { data } = await client.tiktok.postTranscript({ url: "https://www.tiktok.com/@nike/video/7711414040114892045" });{
"data": {
"postId": "7711414040114892045",
"language": "eng-US",
"source": "ASR",
"text": "Pole or podium?\nPodium. Podium.\nPole. Podium.\nUh, podium. Podium.\nStart soft. Transition of hard. Hard.\nHard or do it.\nHe knows him more than I do.\nUh, let's go soft.\nGotta be fast. Soft.\nGoing for the win. The win.\nEasy. The win,\nthe win. I mean,\nthe win is the win. But like if you got the fastest lap.\nI'm a stats girl. And you can wave that around and be like,\nwell, I was faster.\nUh. Oh, rain.\nI…",
"cues": [
{
"startSeconds": 0.02,
"endSeconds": 1.2,
"text": "Pole or podium?"
},
{
"startSeconds": 1.74,
"endSeconds": 2.9,
"text": "Podium. Podium."
},
{
"startSeconds": 2.901,
"endSeconds": 4.121,
"text": "Pole. Podium."
}
]
}
}- The captions are TikTok's own, generated or the author's.
- A post without tracks returns
404, at no cost. - A transcript costs 10 credits and is kept 30 days.
Discovery
| Endpoint | Returns | Credits |
|---|---|---|
collection/posts | The posts of a public saved collection, 30 a page. | 1 |
hashtag | A hashtag with its post and view counts. | 1 |
hashtag/posts | Posts under a hashtag, 30 a page. | 1 |
search | Posts matching a query, 30 a page. | 1 |
search/users | Accounts matching a query. | 1 |
sound | A sound, and how many posts use it. | 1 |
sound/posts | Posts that use a sound, 30 a page. | 1 |
trending | What the explore page shows now, by category. | 5 |
Trending
- Trending takes the explore page's
category, such ascomedyordaily-life. - Without one, it reads
all. - Each call outside the cache gives a fresh set of about 30 posts.
Hashtags, Sounds and Playlists
- A hashtag is named by
name(fyp, without#),idorurl. - A sound, playlist or collection is named by
idorurl.
Share Links
Share links work wherever a url does: vm.tiktok.com/…, vt.tiktok.com/… and tiktok.com/t/….
- Each is followed once and cached for a day.
- A link to the wrong kind of thing returns
400 INVALID_REQUEST.