this is a cool project I thought I'd host so other people could use it - I'll maybe make something cool with it at some point... but for now feel free to use it however works best for you.
there are two main api endpoints, details and liked - you can see how to use both below.
GET
videoId is just, you guessed it, the ID of the tiktok!
id: string,
video: {
url: string,
height: number,
width: number
}
image: {
url: string
}
audio: {
url: string
}
author: {
username: string
}
statistics: {
likes: number,
comments: number
}
src: {
type: string,
data: {
// i'm not documenting the sheer amount of data in here, go have a look yourself...
}
}
id: "7234283230088776961",
video: {
url: "https://api16-normal-c-useast1a.tiktokv.com/aweme/v1/play/?video_id=v10044g50000chilcg3c77u6fb9e2r70&line=0&is_play_url=1&source=PackSourceEnum_FEED&file_id=547b164bd2a74356a8bd26f77a7ac440",
height: 1024,
width: 576
}
image: {
url: "https://p16-sign-sg.tiktokcdn.com/large/tos-alisg-p-0037/4da60f985e8f47bf99cd2d21d4de8520_1684362836.jpeg?x-expires=1687863600&x-signature=CzMXXpUpNVj%2B8Ntg3Uh24luXuds%3D&s=FEED&se=false&sh=≻=cover&l=2023062611070574D60D721A9D0B101CE3"
}
audio: {
url: "https://sf16-ies-music-sg.tiktokcdn.com/obj/tiktok-obj/6928719130585467649.mp3"
}
author: {
username: "madisonbeermoon"
}
statistics: {
likes: 74343,
comments: 184
}
src: {
type: string,
data: {
// i'm not documenting the sheer amount of data in here, go have a look yourself...
}
}
GET
secUid is a unique identifier for your account
to find your secUid, view the page source of the explore home page and CTRL + F for secUid
sidGuard is some special tiktok cookie that you shouldn't share with random people
to find your sidGuard, view the cookies (with inspect, application > storage (or just storage if you use firefox)) for www.tiktok.com and filter by sid_guard
query parameters
onlyIds (optional), if you specify true, will return only the video IDs, otherwise will return a playable URL
liked: string[]
liked: [
"https://api16-normal-c-useast1a.tiktokv.com/aweme/v1/play/?video_id=v10044g50000chilcg3c77u6fb9e2r70&line=0&is_play_url=1&source=PackSourceEnum_FEED&file_id=547b164bd2a74356a8bd26f77a7ac440"
]
liked: [
"7234283230088776961"
]