Comparing version 2.0.11 to 3.0.0
1877
api.js
@@ -1,67 +0,193 @@ | ||
const Wrape = require("wrape"); | ||
/** | ||
* The Types are automatically generated with Rests | ||
*/ | ||
import Rests from "rests"; | ||
import { | ||
jsCodeSample, | ||
pyCodeSample, | ||
iterationCodeSamples, | ||
hashtagCodeSamples | ||
} from "./code_samples.js"; | ||
const endpoints = { | ||
/** | ||
* Frequently Used Parameters Schemas | ||
*/ | ||
const p = { | ||
username: { | ||
help: "The TikTok user username", | ||
validate: "^([a-zA-Z0-9_\.]+|https?:\/\/vm.tiktok.com\/[a-zA-Z0-9]+\/?)$", | ||
type: "string" | ||
}, | ||
secUid: { | ||
validate: "^(.*?){30,}$", | ||
help: "The TikTok user secUid. You can get this from the <a href='#tag/Public/operation/public.check'>Get profile information</a> endpoint using the username.", | ||
type: "string", | ||
example: "MS4wLjABAAAAsHntXC3s0AvxcecggxsoVa4eAiT8OVafVZ4OQXxy-9htpnUi0sOYSr0kGGD1Loud" | ||
}, | ||
user_id:{ | ||
help: "The TikTok user ID", | ||
type: "string", | ||
validate: "^[0-9]+$", | ||
}, | ||
cursor: { | ||
help: "The starting point of the items list. Returned in every response, should be included in the next request for iteration.<br><br> *(A simple iteration method is already implemented in the Javascript & Python libraries as seen in the request samples)*", | ||
type: "string", | ||
validate: "^[0-9]+$" | ||
}, | ||
offset: { | ||
help: "The starting offset of items list. Returned in every response, should be included in the next request for iteration.<br><br> *(A simple iteration method is already implemented in the Javascript & Python libraries as seen in the request samples)*", | ||
type: "number", | ||
validate: "^[0-9]+$" | ||
}, | ||
count: { | ||
example: 30, | ||
default: 30, | ||
max: 30, | ||
type: "number", | ||
help: "Maximum amount of items for one request", | ||
validate: "^[0-9]{1,2}$" | ||
}, | ||
musicId:{ | ||
validate: "^([0-9]+|https?:\/\/vm.tiktok.com\/[a-zA-Z0-9]+\/?)$", | ||
type: "string", | ||
help: "The music ID. Can also be a short TikTok link (e.g. vm.tiktok.com/UwU)" | ||
}, | ||
hashtagId:{ | ||
validate: "^([0-9]+|https?:\/\/vm.tiktok.com\/[a-zA-Z0-9]+\/?)$", | ||
type: "string", | ||
help: "The hashtag ID. Can also be a short TikTok link (e.g. vm.tiktok.com/UwU)" | ||
}, | ||
videoId:{ | ||
help: "The video ID. Can also be a short TikTok link (e.g. vm.tiktok.com/UwU)", | ||
type: "string", | ||
validate: "^([0-9]+|https?:\/\/vm.tiktok.com\/[a-zA-Z0-9]+\/?)$" | ||
}, | ||
commentId:{ | ||
validate: "^[0-9]+$", | ||
help: "The comment ID", | ||
type: "string", | ||
}, | ||
roomId:{ | ||
help: "The Live room ID. You can find this using the <a href='#tag/Public/operation/public.check'>Get profile information</a> endpoint.", | ||
type: "string", | ||
example: "7112492061034646278" | ||
} | ||
}; | ||
const exampleSecUid = 'MS4wLjABAAAAsHntXC3s0AvxcecggxsoVa4eAiT8OVafVZ4OQXxy-9htpnUi0sOYSr0kGGD1Loud'; | ||
const exampleUid = '6569595380449902597'; | ||
const exampleVideoId = '7109178205151464746'; | ||
const exampleCommentId = '7109185042560680750'; | ||
const premiumBadge = `**Premium**<img title='Only Business and Enterprise subscriptions can access this | ||
endpoint' style='margin-bottom: -3px;cursor: help;' | ||
src='/assets/img/star.png' width='18px'><br/> | ||
`; | ||
const specialBadge = `*This endpoint is only available to trusted customers. | ||
<a target="_blank" href='https://helpdesk.tikapi.io/portal/en/kb/articles/how-can-i-get-access-to-special-endpoints'> Learn more about special endpoints</a>* | ||
`; | ||
const videoLink = `<a target="_blank" href='https://helpdesk.tikapi.io/portal/en/kb/articles/how-to-download-tiktok-videos'> | ||
Learn more about downloading videos</a> | ||
`; | ||
const userSecurity = (scopes=[])=>([{ | ||
"apiKey": [], | ||
"accountKey": scopes | ||
}]); | ||
/** | ||
* API Schema | ||
*/ | ||
const API = Rests({ | ||
$options:{ | ||
base: "https://api.tikapi.io", | ||
sandboxBase: "http://sandbox.tikapi.io", | ||
params:{ | ||
apiKey: { | ||
name: "X-API-KEY", | ||
required: true, | ||
location: "headers", | ||
validate: "^[a-zA-Z0-9]{10,}$", | ||
example: "DemoAPIKeyTokenSeHYGXDfd4SFD320Sc39Asd0Sc39Asd4s", | ||
help: "The TikAPI API Key is required for all requests", | ||
$initsOnly: true | ||
}, | ||
}, | ||
$other: { | ||
openapi:{ | ||
packageName: 'tikapi', | ||
jsTemplate: jsCodeSample, | ||
pyTemplate: pyCodeSample, | ||
fields:{ | ||
security: [ | ||
{ | ||
"apiKey": [], | ||
} | ||
], | ||
responses:{ | ||
"403": { | ||
"$ref": "./error_responses/403.yaml" | ||
}, | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
public: { | ||
$help: "Public endpoints do not require an user authorization", | ||
user: { | ||
help: "Public endpoints do not require an authenticated user.", | ||
$options: { | ||
params:{ | ||
country: { | ||
type: "string", | ||
validate: "^[a-z]{2}$", | ||
help: `You can optionally choose the proxy country from where the request | ||
is being sent by providing an ISO Code (e.g us, ca, gb) — 200+ countries supported`, | ||
location: "query", | ||
example: "us" | ||
} | ||
}, | ||
$other:{ | ||
openapi: { | ||
fields:{ | ||
tags: [ | ||
"Public" | ||
] | ||
}, | ||
} | ||
} | ||
}, | ||
check: { | ||
path: "/public/check", | ||
help: "Get user profile information", | ||
help: "Get a user's profile information", | ||
comment: "Get profile information and statistics from a username or secUid.", | ||
params: { | ||
username: { | ||
...p.username, | ||
required: true, | ||
help: "The TikTok account username", | ||
example: "lilyachty" | ||
example: 'lilyachty' | ||
}, | ||
secUid: { | ||
help: "The TikTok user secUid", | ||
validate: "^(.*?){30,}$" | ||
...p.secUid, | ||
help: "Optionally you can get the profile information using the secUid parameter." | ||
} | ||
}, | ||
example_response: { | ||
"status": "success", | ||
"message": "string", | ||
"statusCode": 0, | ||
"userInfo": { | ||
"user": { | ||
"id": 684574219000000000, | ||
"uniqueId": "lilyachty", | ||
"nickname": "lilyachty", | ||
"avatarThumb": "https://p16-sign-sg.tiktokcdn.com/aweme/100x100/tiktok-obj/db20c99f44182ab54cca90de85f673bf.jpeg?x-expires=1606165200&x-signature=pw%2BueamaONA9LQMd7h0Pyyb0%2FAY%3D", | ||
"avatarMedium": "https://p16-sign-sg.tiktokcdn.com/aweme/720x720/tiktok-obj/db20c99f44182ab54cca90de85f673bf.jpeg?x-expires=1606165200&x-signature=8FzlgFpqsP8ZPLJhxDKmqHyJ0N0%3D", | ||
"avatarLarger": "https://p16-sign-sg.tiktokcdn.com/aweme/1080x1080/tiktok-obj/db20c99f44182ab54cca90de85f673bf.jpeg?x-expires=1606165200&x-signature=SYNT1mnTj7VipZCFrh8FrmVsRJU%3D", | ||
"signature": null, | ||
"verified": true, | ||
"secUid": "MS4wLjABAAAA77...........", | ||
"secret": true, | ||
"ftc": true, | ||
"relation": 0, | ||
"openFavorite": true, | ||
"commentSetting": 0, | ||
"duetSetting": 0, | ||
"stitchSetting": 0, | ||
"privateAccount": true | ||
}, | ||
"stats": { | ||
"followingCount": 0, | ||
"followerCount": 0, | ||
"heartCount": 0, | ||
"videoCount": 0, | ||
"diggCount": 0, | ||
"heart": 0 | ||
}, | ||
"shareMeta": { | ||
"title": "lilyachty on TikTok", | ||
"desc": "@lilyachty 0 Followers 0 Following 0 Likes - Watch awesome short videos created by lilyachty" | ||
} | ||
} | ||
} | ||
}, | ||
explore: { | ||
help: "Get recommended posts", | ||
help: "Get trending posts", | ||
comment: "Get a list of recommended posts from the *For You* section.", | ||
path: "/public/explore", | ||
params: { | ||
count: { | ||
example: 5, | ||
default: 30, | ||
validate: "^[0-9]{1,2}$" | ||
count: p.count, | ||
session_id:{ | ||
type: "number", | ||
max: 20, | ||
example: 0, | ||
help: "Longer sessions. The cookies and IP are preserved through different requests for a longer amount of time. You should include this in order to get different posts on every request." | ||
} | ||
@@ -71,261 +197,72 @@ } | ||
posts: { | ||
help: "Get posts of an user", | ||
help: "Get a user's feed posts", | ||
path: "/public/posts", | ||
params: { | ||
secUid: { | ||
...p.secUid, | ||
required: true, | ||
validate: "^(.*?){30,}$", | ||
help: "The user secUid", | ||
example: "MS4wLjABAAAAsHntXC3s0AvxcecggxsoVa4eAiT8OVafVZ4OQXxy-9htpnUi0sOYSr0kGGD1Loud" | ||
example: exampleSecUid | ||
}, | ||
count: { | ||
example: 5, | ||
default: 30, | ||
validate: "^[0-9]{1,2}$" | ||
}, | ||
cursor: { | ||
validate: "^[0-9]+$" | ||
count: p.count, | ||
cursor: p.cursor | ||
}, | ||
$other:{ | ||
openapi: { | ||
...iterationCodeSamples('cursor') | ||
} | ||
}, | ||
example_response: { | ||
"status": "success", | ||
"message": "string", | ||
"statusCode": 0, | ||
"itemList": [ | ||
{ | ||
"id": 6932268218690145000, | ||
"desc": "The way he dives into the ball pit 😂😂😂 TYSM to Sarah and Rock Dodd from NY! 🥰", | ||
"createTime": 1614044487, | ||
"video": { | ||
"id": 6932268218690145000, | ||
"height": 1024, | ||
"width": 576, | ||
"duration": 58, | ||
"ratio": "720p", | ||
"cover": "https://p16-sign-sg.tiktokcdn.com/tos-maliva-p-0068/7a9f49ac001748bc8c807b74805696a0~tplv-dmt-logom:tos-maliva-p-0000/147eca0bbe4a4320adf3a754500753b6.image?x-expires=1614106800&x-signature=TwoCAwb61y6S5WgzE6qLvqSZ9UI%3D", | ||
"originCover": "https://p16-sign-sg.tiktokcdn.com/obj/tos-maliva-p-0068/e66f4a91f7344027a1d810669e9ae36e_1614044489?x-expires=1614106800&x-signature=dcw8cAWMrxpkRQ3VK%2FuQfcpP1f8%3D", | ||
"dynamicCover": "https://p16-sign-sg.tiktokcdn.com/obj/tos-maliva-p-0068/50a86c1ff6244894b5d7a7e524265b52_1614044493?x-expires=1614106800&x-signature=WIxlVRaftMgyJgJB8UBKo6r1yOI%3D", | ||
"playAddr": "https://v16-web.tiktok.com/video/tos/useast2a/tos-useast2a-pve-0068/5bf7260ddb454770a69af5504005ca8c/?a=1988&br=4138&bt=2069&cd=0%7C0%7C1&ch=0&cr=0&cs=0&cv=1&dr=0&ds=3&er=&expire=1614107310&l=202102231307320101902092161F0FE04F&lr=tiktok_m&mime_type=video_mp4&pl=0&policy=2&qs=0&rc=M3g3d3E1Ozk4MzMzOjczM0ApOGY6Mzg8OWU5Nzo3ZDs4M2dsa29kc24ybm5gLS1iMTZzc2BfLzUzYjA2L18uMzEtMTE6Yw%3D%3D&signature=7db7b85f595129f501618fc50d7408fe&tk=tt_webid_v2&vl=&vr=", | ||
"downloadAddr": "https://v16-web.tiktok.com/video/tos/useast2a/tos-useast2a-pve-0068/5bf7260ddb454770a69af5504005ca8c/?a=1988&br=4138&bt=2069&cd=0%7C0%7C1&ch=0&cr=0&cs=0&cv=1&dr=0&ds=3&er=&expire=1614107310&l=202102231307320101902092161F0FE04F&lr=tiktok_m&mime_type=video_mp4&pl=0&policy=2&qs=0&rc=M3g3d3E1Ozk4MzMzOjczM0ApOGY6Mzg8OWU5Nzo3ZDs4M2dsa29kc24ybm5gLS1iMTZzc2BfLzUzYjA2L18uMzEtMTE6Yw%3D%3D&signature=7db7b85f595129f501618fc50d7408fe&tk=tt_webid_v2&vl=&vr=", | ||
"shareCover": [ | ||
null | ||
], | ||
"reflowCover": "https://p16-sign-sg.tiktokcdn.com/obj/tos-maliva-p-0068/9e209ac43d03422555230402d3f4cf07?x-expires=1614106800&x-signature=GC3FZC2q01W6gzUCx2SgLNkOGA0%3D" | ||
}, | ||
"author": { | ||
"id": 6658113054100652000, | ||
"uniqueId": "heresyourmonkeycontent", | ||
"nickname": "Georgie Boy", | ||
"avatarThumb": "https://p16-sign-va.tiktokcdn.com/musically-maliva-obj/1663367077635077~c5_100x100.jpeg?x-expires=1614171600&x-signature=ykouyuQyhAgJhAO%2FkNEIH1AcS50%3D", | ||
"avatarMedium": "https://p16-sign-va.tiktokcdn.com/musically-maliva-obj/1663367077635077~c5_720x720.jpeg?x-expires=1614171600&x-signature=Oo9ewQlRjJUH%2BVOPmKyDPAZvIeo%3D", | ||
"avatarLarger": "https://p16-sign-va.tiktokcdn.com/musically-maliva-obj/1663367077635077~c5_1080x1080.jpeg?x-expires=1614171600&x-signature=CXugf2YWO%2BJUEtUADeAE2Kj9zmI%3D", | ||
"signature": "👆YOUTUBE AND INSTA", | ||
"verified": true, | ||
"secUid": "MS4wLjABAAAA7CyNvLiT5-wfMyn7_KhW2jJM-QZZMgvDH9UjKnlgd2pCWpyI0PUewJn-f_hLOuMD", | ||
"secret": true, | ||
"ftc": true, | ||
"relation": 1, | ||
"openFavorite": true, | ||
"commentSetting": 0, | ||
"duetSetting": 0, | ||
"stitchSetting": 0, | ||
"privateAccount": true | ||
}, | ||
"music": { | ||
"id": 6932268233760509000, | ||
"title": "original sound", | ||
"playUrl": "https://sf16-ies-music-va.tiktokcdn.com/obj/musically-maliva-obj/6932268236901731077.mp3", | ||
"coverThumb": "https://p16-sign-va.tiktokcdn.com/musically-maliva-obj/1663367077635077~c5_100x100.jpeg?x-expires=1614171600&x-signature=ykouyuQyhAgJhAO%2FkNEIH1AcS50%3D", | ||
"coverMedium": "https://p16-sign-va.tiktokcdn.com/musically-maliva-obj/1663367077635077~c5_720x720.jpeg?x-expires=1614171600&x-signature=Oo9ewQlRjJUH%2BVOPmKyDPAZvIeo%3D", | ||
"coverLarge": "https://p16-sign-va.tiktokcdn.com/musically-maliva-obj/1663367077635077~c5_1080x1080.jpeg?x-expires=1614171600&x-signature=CXugf2YWO%2BJUEtUADeAE2Kj9zmI%3D", | ||
"authorName": "Georgie Boy", | ||
"original": true, | ||
"duration": 58, | ||
"album": null | ||
}, | ||
"challenges": [ | ||
{ | ||
"id": 22453, | ||
"title": "monkey", | ||
"desc": null, | ||
"profileThumb": null, | ||
"profileMedium": null, | ||
"profileLarger": null, | ||
"coverThumb": null, | ||
"coverMedium": null, | ||
"coverLarger": null, | ||
"isCommerce": true | ||
} | ||
], | ||
"stats": { | ||
"diggCount": 16000, | ||
"shareCount": 612, | ||
"commentCount": 393, | ||
"playCount": 80200 | ||
}, | ||
"duetInfo": { | ||
"duetFromId": 0 | ||
}, | ||
"originalItem": true, | ||
"officalItem": true, | ||
"textExtra": [ | ||
{ | ||
"awemeId": null, | ||
"start": 82, | ||
"end": 89, | ||
"hashtagName": "monkey", | ||
"hashtagId": null, | ||
"type": 1, | ||
"userId": null, | ||
"isCommerce": true, | ||
"userUniqueId": null, | ||
"secUid": null | ||
} | ||
], | ||
"secret": true, | ||
"forFriend": true, | ||
"digged": true, | ||
"itemCommentStatus": 0, | ||
"showNotPass": true, | ||
"vl1": true, | ||
"itemMute": true, | ||
"authorStats": { | ||
"followingCount": 282, | ||
"followerCount": 12900000, | ||
"heartCount": 142600000, | ||
"videoCount": 455, | ||
"diggCount": 1443, | ||
"heart": 142600000 | ||
}, | ||
"privateItem": true, | ||
"duetEnabled": true, | ||
"stitchEnabled": true, | ||
"shareEnabled": true, | ||
"stickersOnItem": [ | ||
{ | ||
"stickerType": 0 | ||
} | ||
], | ||
"isAd": true | ||
} | ||
], | ||
"cursor": 1611774375000, | ||
"hasMore": true | ||
} | ||
}, | ||
likes: { | ||
help: "Get liked posts of an user", | ||
help: "Get a user's liked posts", | ||
path: "/public/likes", | ||
params: { | ||
secUid: { | ||
...p.secUid, | ||
required: true, | ||
validate: "^(.*?){30,}$", | ||
help: "The user secUid", | ||
example: "MS4wLjABAAAAsHntXC3s0AvxcecggxsoVa4eAiT8OVafVZ4OQXxy-9htpnUi0sOYSr0kGGD1Loud" | ||
example: exampleSecUid | ||
}, | ||
count: { | ||
example: 5, | ||
default: 30, | ||
validate: "^[0-9]{1,2}$" | ||
}, | ||
cursor: { | ||
validate: "^[0-9]+$" | ||
count: p.count, | ||
cursor: p.cursor | ||
}, | ||
$other:{ | ||
openapi: { | ||
...iterationCodeSamples('cursor') | ||
} | ||
}, | ||
} | ||
}, | ||
video: { | ||
path: "/public/video", | ||
help: "Get a video information/ Download a video", | ||
help: "Get video information", | ||
comment: videoLink, | ||
params: { | ||
id: { | ||
...p.videoId, | ||
required: true, | ||
help: "The video ID", | ||
example: "6950501241915018501", | ||
validate: "^[0-9]+$" | ||
}, | ||
username: { | ||
help: "The author username", | ||
example: "lilyachty", | ||
required: false, | ||
required: true | ||
}, | ||
download: { | ||
help: "Set this to `1` to get a mp4 file", | ||
default: 0, | ||
in: [0,1] | ||
example: exampleVideoId | ||
} | ||
} | ||
}, | ||
discover: { | ||
$help: "Search users, music, hashtags", | ||
users: { | ||
path: "/public/discover/users", | ||
params: { | ||
keyword: {}, | ||
count: { | ||
default: 30, | ||
validate: "^[0-9]{1,2}$" | ||
}, | ||
cursor: { | ||
validate: "^[0-9]+$" | ||
} | ||
} | ||
}, | ||
music: { | ||
path: "/public/discover/music", | ||
params: { | ||
keyword: { | ||
example: 'lilyachty' | ||
}, | ||
count: { | ||
default: 30, | ||
validate: "^[0-9]{1,2}$" | ||
}, | ||
cursor: { | ||
validate: "^[0-9]+$" | ||
} | ||
help: "Discover users, music, hashtags", | ||
comment: `You can also include *Account Key* to show personalized results for the user.<br/> The offset paramater might not work as excepted with a keyword. Try using the <a href='#tag/Public/operation/public.search'>Search</a> endpoint instead.`, | ||
path: "/public/discover/{category}", | ||
params: { | ||
category: { | ||
help: "The discover category", | ||
example: "users", | ||
in: ["users", "music", "hashtag"], | ||
location: "path", | ||
type: "string", | ||
required: true | ||
}, | ||
example_response: { | ||
"status": "success", | ||
"message": null, | ||
"musicInfoList": [ | ||
{ | ||
"music": { | ||
"album": "Hey Julie! (feat. Lil Yachty)", | ||
"authorName": "KYLE", | ||
"coverLarge": "https://p16-sg.tiktokcdn.com/aweme/720x720/tos-alisg-i-0000/d03864babe5c4c1ea2106db77909807e.jpeg", | ||
"coverMedium": "https://p16-sg.tiktokcdn.com/aweme/200x200/tos-alisg-i-0000/d03864babe5c4c1ea2106db77909807e.jpeg", | ||
"coverThumb": "https://p16-sg.tiktokcdn.com/aweme/100x100/tos-alisg-i-0000/d03864babe5c4c1ea2106db77909807e.jpeg", | ||
"duration": 33, | ||
"id": 6659459073378995000, | ||
"original": true, | ||
"playUrl": "https://sf16-ies-music-sg.tiktokcdn.com/obj/tiktok-obj/030aee3fc6cf3eecf1b97b08c344d392.mp3", | ||
"title": "Hey Julie! (feat. Lil Yachty)" | ||
}, | ||
"stats": { | ||
"videoCount": 5600000 | ||
} | ||
} | ||
], | ||
"offset": 10, | ||
"statusCode": 0 | ||
} | ||
keyword: { | ||
help: "Discover keyword is optional", | ||
type: "string" | ||
}, | ||
count: p.count, | ||
offset: p.offset, | ||
}, | ||
hashtag: { | ||
path: "/public/discover/hashtag", | ||
params: { | ||
keyword: { | ||
example: 'lilyachty' | ||
}, | ||
count: { | ||
default: 30, | ||
validate: "^[0-9]{1,2}$" | ||
}, | ||
cursor: { | ||
validate: "^[0-9]+$" | ||
} | ||
}, | ||
example_response: { | ||
$other:{ | ||
openapi:{ | ||
...iterationCodeSamples('offset') | ||
} | ||
@@ -335,151 +272,79 @@ } | ||
hashtag: { | ||
help: "Get posts by hashtag ID (You can find it using Discover endpoint)", | ||
help: "Get hashtag posts", | ||
comment: "Your first request should be using the hashtag `name` parameter, then the following requests should be using the `id` parameter which you have stored from the first request (returned in response as `challenge_id`).", | ||
path: "/public/hashtag", | ||
params: { | ||
id: { | ||
required: true, | ||
validate: "^[0-9]+$", | ||
help: "The hashtag ID" | ||
...p.hashtagId, | ||
example: '4655293', | ||
}, | ||
count: { | ||
default: 30, | ||
validate: "^[0-9]{1,2}$" | ||
name: { | ||
type: "string", | ||
help: "The hashtag name", | ||
}, | ||
cursor: { | ||
validate: "^[0-9]+$", | ||
help: "The starting point of items list" | ||
count: p.count, | ||
cursor: p.cursor, | ||
}, | ||
$other:{ | ||
openapi: { | ||
...hashtagCodeSamples('cursor') | ||
} | ||
} | ||
}, | ||
music: { | ||
help: "Get music posts", | ||
comment: "Get a list of posts that are using this music", | ||
path: "/public/music", | ||
params: { | ||
id: { | ||
...p.musicId, | ||
required: true, | ||
example: "28459463" | ||
}, | ||
count: p.count, | ||
cursor: p.cursor, | ||
}, | ||
example_response: { | ||
"status": "success", | ||
"message": "string", | ||
"itemStruct": { | ||
"cursor": 60, | ||
"hasMore": true, | ||
"itemList": [ | ||
{ | ||
"author": { | ||
"avatarLarger": "https://p16-sign-va.tiktokcdn.com/musically-maliva-obj/ed46bcdd5e318d4670f26aec440e2052~c5_1080x1080.jpeg?x-expires=1618480800&x-signature=tKuHC7eXYB343bslQKrw41UN%2FIo%3D", | ||
"avatarMedium": "https://p16-sign-va.tiktokcdn.com/musically-maliva-obj/ed46bcdd5e318d4670f26aec440e2052~c5_720x720.jpeg?x-expires=1618480800&x-signature=OjnTsyKRskBVTj%2Fi2spU%2F%2FEEgvA%3D", | ||
"avatarThumb": "https://p16-sign-va.tiktokcdn.com/musically-maliva-obj/ed46bcdd5e318d4670f26aec440e2052~c5_100x100.jpeg?x-expires=1618480800&x-signature=Bq6J1aq3O248fvPcZZXyj5uI6JI%3D", | ||
"commentSetting": 0, | ||
"duetSetting": 0, | ||
"ftc": true, | ||
"id": "6743547525321xxxxx", | ||
"nickname": "RAP", | ||
"openFavorite": true, | ||
"privateAccount": true, | ||
"relation": 0, | ||
"secUid": "MS4wLjABAAAAyZX6.", | ||
"secret": true, | ||
"signature": "Link in bio", | ||
"stitchSetting": 0, | ||
"uniqueId": "rap", | ||
"verified": true | ||
}, | ||
"authorStats": { | ||
"diggCount": 5795, | ||
"followerCount": 5400000, | ||
"followingCount": 434, | ||
"heart": 200100000, | ||
"heartCount": 200100000, | ||
"videoCount": 2405 | ||
}, | ||
"challenges": [ | ||
{ | ||
"coverLarger": null, | ||
"coverMedium": null, | ||
"coverThumb": null, | ||
"desc": null, | ||
"id": 656, | ||
"isCommerce": true, | ||
"profileLarger": null, | ||
"profileMedium": null, | ||
"profileThumb": null, | ||
"title": "bobbyshmurda" | ||
} | ||
], | ||
"createTime": 1615085843, | ||
"desc": null, | ||
"digged": true, | ||
"duetEnabled": true, | ||
"duetInfo": { | ||
"duetFromId": 0 | ||
}, | ||
"forFriend": true, | ||
"id": 6936740859383680000, | ||
"isAd": true, | ||
"itemCommentStatus": 0, | ||
"itemMute": true, | ||
"music": { | ||
"album": null, | ||
"authorName": "RAP", | ||
"coverLarge": "https://p16-sign-va.tiktokcdn.com/musically-maliva-obj/ed46bcdd5e318d4670f26aec440e2052~c5_1080x1080.jpeg?x-expires=1618480800&x-signature=tKuHC7eXYB343bslQKrw41UN%2FIo%3D", | ||
"coverMedium": "https://p16-sign-va.tiktokcdn.com/musically-maliva-obj/ed46bcdd5e318d4670f26aec440e2052~c5_720x720.jpeg?x-expires=1618480800&x-signature=OjnTsyKRskBVTj%2Fi2spU%2F%2FEEgvA%3D", | ||
"coverThumb": "https://p16-sign-va.tiktokcdn.com/musically-maliva-obj/ed46bcdd5e318d4670f26aec440e2052~c5_100x100.jpeg?x-expires=1618480800&x-signature=Bq6J1aq3O248fvPcZZXyj5uI6JI%3D", | ||
"duration": 15, | ||
"id": 6936740754928717000, | ||
"original": true, | ||
"playUrl": "https://sf16-ies-music-va.tiktokcdn.com/obj/musically-maliva-obj/6936740824692558597.mp3", | ||
"title": "original sound" | ||
}, | ||
"officalItem": true, | ||
"originalItem": true, | ||
"privateItem": true, | ||
"secret": true, | ||
"shareEnabled": true, | ||
"showNotPass": true, | ||
"stats": { | ||
"commentCount": 5270, | ||
"diggCount": 232700, | ||
"playCount": 2100000, | ||
"shareCount": 2957 | ||
}, | ||
"stickersOnItem": [ | ||
{ | ||
"stickerText": [ | ||
"Bobby Shmurda pulling up to All Star weekend🔥" | ||
], | ||
"stickerType": 4 | ||
} | ||
], | ||
"stitchEnabled": true, | ||
"textExtra": [ | ||
{ | ||
"awemeId": null, | ||
"end": 13, | ||
"hashtagId": 656, | ||
"hashtagName": "bobbyshmurda", | ||
"isCommerce": true, | ||
"secUid": null, | ||
"start": 0, | ||
"type": 1, | ||
"userId": null, | ||
"userUniqueId": null | ||
} | ||
], | ||
"video": { | ||
"cover": "https://p16-sign-va.tiktokcdn.com/obj/tos-maliva-p-0068/43bdcd4b086446f68ece8ec7289845fc?x-expires=1618416000&x-signature=rMQAUzfMneoP%2B8bHXKGSfwIfxTU%3D", | ||
"downloadAddr": "https://v16-web.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068c003/3f83725baa75439ea8ba764a2ab6dd75/?a=1988&br=3120&bt=1560&cd=0%7C0%7C1&ch=0&cr=0&cs=0&cv=1&dr=0&ds=3&er=&expire=1618419556&l=202104141059010101890531331400A966&lr=tiktok_m&mime_type=video_mp4&net=0&pl=0&policy=2&qs=0&rc=anc4Zjw4aDY3NDMzOTczM0ApOTNlOmQ0Nzw7NzZoZjY2ZWdrLTJgcTYxLy9gLS1iMTZzczQuYl8uMGE2MTYvMmEzM2I6Yw%3D%3D&signature=5c842ee10fd13d7947cc6f52a0c04d82&tk=tt_webid_v2&vl=&vr=", | ||
"duration": 15, | ||
"dynamicCover": "https://p16-sign-va.tiktokcdn.com/obj/tos-maliva-p-0068/def4c536e245468ba0404da490337aeb_1615085845?x-expires=1618416000&x-signature=NTiyZa3N5mddjNvoFtDyznzRH6A%3D", | ||
"height": 1024, | ||
"id": 6936740859383680000, | ||
"originCover": "https://p16-sign-va.tiktokcdn.com/obj/tos-maliva-p-0068/28baaa197b1440fdb0aa9795106b8825_1615085845?x-expires=1618416000&x-signature=veEGB6CU9nZIDTFaEwOOU0gHbjY%3D", | ||
"playAddr": "https://v16-web.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068c003/3f83725baa75439ea8ba764a2ab6dd75/?a=1988&br=3120&bt=1560&cd=0%7C0%7C1&ch=0&cr=0&cs=0&cv=1&dr=0&ds=3&er=&expire=1618419556&l=202104141059010101890531331400A966&lr=tiktok_m&mime_type=video_mp4&net=0&pl=0&policy=2&qs=0&rc=anc4Zjw4aDY3NDMzOTczM0ApOTNlOmQ0Nzw7NzZoZjY2ZWdrLTJgcTYxLy9gLS1iMTZzczQuYl8uMGE2MTYvMmEzM2I6Yw%3D%3D&signature=5c842ee10fd13d7947cc6f52a0c04d82&tk=tt_webid_v2&vl=&vr=", | ||
"ratio": "720p", | ||
"reflowCover": "https://p16-sign-va.tiktokcdn.com/obj/tos-maliva-p-0068/43bdcd4b086446f68ece8ec7289845fc?x-expires=1618416000&x-signature=rMQAUzfMneoP%2B8bHXKGSfwIfxTU%3D", | ||
"shareCover": [ | ||
null | ||
], | ||
"width": 576 | ||
}, | ||
"vl1": true | ||
} | ||
], | ||
"message": null, | ||
"status": "success", | ||
"statusCode": 0 | ||
$other:{ | ||
openapi: { | ||
...iterationCodeSamples('cursor') | ||
} | ||
} | ||
}, | ||
musicInfo: { | ||
help: "Get music information", | ||
path: "/public/music/info", | ||
params: { | ||
id: { | ||
...p.musicId, | ||
required: true, | ||
example: "28459463" | ||
} | ||
} | ||
}, | ||
search:{ | ||
help: "Search", | ||
comment: "Search TikTok anything, users, videos, or get keyword autocomplete suggestions.", | ||
path: '/public/search/{category}', | ||
params: { | ||
category: { | ||
help: "The search category", | ||
in: ["general", "users", "videos", "autocomplete"], | ||
required: true, | ||
type: "string", | ||
example: "general", | ||
location: "path" | ||
}, | ||
query:{ | ||
type: 'string', | ||
example: "lilyachty", | ||
required: true, | ||
help: 'The search keyword' | ||
}, | ||
cursor: p.offset | ||
}, | ||
$other:{ | ||
openapi:{ | ||
...iterationCodeSamples('cursor') | ||
} | ||
} | ||
} | ||
@@ -490,163 +355,70 @@ }, | ||
help: 'The user endpoints require an `accountKey`', | ||
$options: { | ||
params: { | ||
apiKey: { | ||
name: "X-API-KEY", | ||
required: true, | ||
location: "headers", | ||
validate: "^[a-zA-Z0-9]{10,}$", | ||
example: 'myAPIKey' | ||
}, | ||
accountKey: { | ||
name: "X-ACCOUNT-KEY", | ||
required: true, | ||
help: "You can get Account Key with OAuth, or Add a Test user on your dashboard.", | ||
help: "The Account Key is required", | ||
location: "headers", | ||
validate: "^[a-zA-Z0-9]{10,}$", | ||
example: 'myAccountKey' | ||
example: 'DemoAccountKeyTokenSeHYGXDfd4SFD320Sc39Asd0Sc39A', | ||
$initsOnly: true | ||
} | ||
} | ||
}, | ||
info: { | ||
help: "Get profile information", | ||
comment: "Get current user profile information, or another user's by specifying the username.", | ||
path: "/user/info", | ||
params: { | ||
username: p.username | ||
}, | ||
$other:{ | ||
openapi: { | ||
fields:{ | ||
security: userSecurity(['view_profile']), | ||
tags: [ | ||
"Profile" | ||
], | ||
}, | ||
} | ||
} | ||
}, | ||
profile: { | ||
info: { | ||
help: "Get current user profile information", | ||
path: "/user/info", | ||
example_response: { | ||
"status": "success", | ||
"message": "string", | ||
"statusCode": 0, | ||
"userInfo": { | ||
"user": { | ||
"id": 684574219000000000, | ||
"uniqueId": "lilyachty", | ||
"nickname": "lilyachty", | ||
"avatarThumb": "https://p16-sign-sg.tiktokcdn.com/aweme/100x100/tiktok-obj/db20c99f44182ab54cca90de85f673bf.jpeg?x-expires=1606165200&x-signature=pw%2BueamaONA9LQMd7h0Pyyb0%2FAY%3D", | ||
"avatarMedium": "https://p16-sign-sg.tiktokcdn.com/aweme/720x720/tiktok-obj/db20c99f44182ab54cca90de85f673bf.jpeg?x-expires=1606165200&x-signature=8FzlgFpqsP8ZPLJhxDKmqHyJ0N0%3D", | ||
"avatarLarger": "https://p16-sign-sg.tiktokcdn.com/aweme/1080x1080/tiktok-obj/db20c99f44182ab54cca90de85f673bf.jpeg?x-expires=1606165200&x-signature=SYNT1mnTj7VipZCFrh8FrmVsRJU%3D", | ||
"signature": null, | ||
"verified": true, | ||
"secUid": "MS4wLjABAAAA77...........", | ||
"secret": true, | ||
"ftc": true, | ||
"relation": 0, | ||
"openFavorite": true, | ||
"commentSetting": 0, | ||
"duetSetting": 0, | ||
"stitchSetting": 0, | ||
"privateAccount": true | ||
}, | ||
"stats": { | ||
"followingCount": 0, | ||
"followerCount": 0, | ||
"heartCount": 0, | ||
"videoCount": 0, | ||
"diggCount": 0, | ||
"heart": 0 | ||
}, | ||
"shareMeta": { | ||
"title": "lilyachty on TikTok", | ||
"desc": "@lilyachty 0 Followers 0 Following 0 Likes - Watch awesome short videos created by lilyachty" | ||
} | ||
} | ||
edit: { | ||
help: "Edit profile", | ||
comment: premiumBadge + "Update the current user profile fields.", | ||
path: "/user/edit/{field}", | ||
method: "POST", | ||
params: { | ||
field:{ | ||
required: true, | ||
help: "The profile field.", | ||
in: ["nickname", "username", "bio", "private"], | ||
example: "bio", | ||
location: "path", | ||
type: "string" | ||
}, | ||
value:{ | ||
required: true, | ||
type: "string", | ||
example: "My new bio", | ||
help: "The new field value" | ||
} | ||
}, | ||
edit: { | ||
help: "Edit the user profile", | ||
path: "/user/edit", | ||
method: "POST", | ||
enctype: "json", | ||
params: { | ||
nickname: { | ||
example: false, | ||
$other:{ | ||
openapi: { | ||
fields:{ | ||
security: userSecurity(['edit']), | ||
tags: [ | ||
"Profile" | ||
], | ||
}, | ||
username: { | ||
example: false, | ||
}, | ||
bio: { | ||
example: "My new bio", | ||
}, | ||
privacy: { | ||
example: false, | ||
validate: "^[0-1]$" | ||
} | ||
}, | ||
example_response: { | ||
"status": "success", | ||
"message": null, | ||
"extra": { | ||
"fatal_item_ids": [], | ||
"logid": "202104141323300101901...", | ||
"now": 1618406620418 | ||
}, | ||
"log_pb": { | ||
"impr_id": "202104141323300101..." | ||
}, | ||
"status_code": 0, | ||
"user": { | ||
"apple_account": 0, | ||
"avatar_larger": { | ||
"uri": "tiktok-obj/db20c99f44182ab54cca90de85f673bf", | ||
"url_list": [ | ||
"https://p16-sign-sg.tiktokcdn.com..." | ||
] | ||
}, | ||
"avatar_medium": { | ||
"uri": "tiktok-obj/db20c99f44182ab54cca90de85f673bf", | ||
"url_list": [ | ||
"https://p16-sign-sg.tiktokcdn.com..." | ||
] | ||
}, | ||
"avatar_thumb": { | ||
"uri": "tiktok-obj/db20c99f44182ab54cca90de85f673bf", | ||
"url_list": [ | ||
"https://p16-sign-sg.tiktokcdn.com..." | ||
] | ||
}, | ||
"google_account": null, | ||
"ins_id": null, | ||
"nickname": "demoapi", | ||
"secret": 0, | ||
"self_visible_avatar_larger": { | ||
"uri": "1080x1080/tiktok-obj/db20c99f44182ab54cca90de85f673bf", | ||
"url_list": [ | ||
"https://p16-sign-sg.tiktokcdn.com..." | ||
] | ||
}, | ||
"self_visible_avatar_medium": { | ||
"uri": "720x720/tiktok-obj/db20c99f44182ab54cca90de85f673bf", | ||
"url_list": [ | ||
"https://p16-sign-sg.tiktokcdn..." | ||
] | ||
}, | ||
"self_visible_avatar_thumb": { | ||
"uri": "100x100/tiktok-obj/db20c99f44182ab54cca90de85f673bf", | ||
"url_list": [ | ||
"https://p16-sign-sg..." | ||
] | ||
}, | ||
"share_qrcode_uri": null, | ||
"short_id": 0, | ||
"signature": "My new bio!", | ||
"twitter_id": null, | ||
"twitter_name": null, | ||
"uid": "6845742198232xxxxxx", | ||
"unique_id": "demoapi", | ||
"verification_type": 0, | ||
"video_icon": { | ||
"uri": null, | ||
"url_list": [] | ||
}, | ||
"youtube_channel_id": null, | ||
"youtube_channel_title": null | ||
} | ||
} | ||
} | ||
}, | ||
notifications: { | ||
help: "Get user notifications", | ||
help: "Get notifications", | ||
comment: "Get current user recent notifications.<br><br>*Note: Some notifications are limited by TikTok.*", | ||
path: "/user/notifications", | ||
@@ -656,55 +428,118 @@ params: { | ||
default: "all", | ||
in: ["all", "likes", "comments", "mentions", "followers"], | ||
help: "Filter notifications by type", | ||
type: "string", | ||
in: [ | ||
"all", | ||
"likes", | ||
"comments", | ||
"mentions", | ||
"followers" | ||
], | ||
}, | ||
count: { | ||
default: 20, | ||
max: 20, | ||
validate: "^[0-9]{1,2}$" | ||
}, | ||
maxTime: { | ||
count: p.count, | ||
max_time: { | ||
name: 'max_time', | ||
help: "Returned in every response, should be included in the next request for iteration.", | ||
validate: "^[0-9]+$" | ||
}, | ||
minTime: { | ||
min_time: { | ||
help: "Returned in every response, should be included in the next request for iteration.", | ||
name: 'min_time', | ||
validate: "^[0-9]+$" | ||
} | ||
}, | ||
$other:{ | ||
openapi: { | ||
...iterationCodeSamples('min_time'), | ||
fields:{ | ||
security: userSecurity(['view_profile']), | ||
tags: [ | ||
"Profile" | ||
], | ||
}, | ||
} | ||
} | ||
}, | ||
followers: { | ||
help: "[Deprecated] Get followers list", | ||
path: "/user/followers", | ||
params: { | ||
count: { | ||
default: 30, | ||
validate: "^[0-9]{1,2}$" | ||
analytics: { | ||
help: "Get analytics", | ||
comment: "Get analytics for business or creator accounts", | ||
path: "/creator/analytics/{type}", | ||
params:{ | ||
type:{ | ||
required: true, | ||
in: ['overview', 'content', 'video', 'followers', 'live'], | ||
type: "string", | ||
help: "The analytics type", | ||
example: "overview", | ||
location: "path" | ||
}, | ||
maxTime: { | ||
name: 'max_time', | ||
validate: "^[0-9]+$" | ||
days:{ | ||
default: 7, | ||
help: "The days time frame of analytics data", | ||
validate: "^[0-9]+$", | ||
type: "number" | ||
}, | ||
minTime: { | ||
name: 'min_time', | ||
media_id: { | ||
help: "Required only for **video** type analytics, otherwise don't include.", | ||
validate: "^[0-9]+$" | ||
} | ||
}, | ||
$other:{ | ||
openapi: { | ||
fields:{ | ||
security: userSecurity(['view_profile']), | ||
tags: [ | ||
"Profile" | ||
], | ||
}, | ||
} | ||
} | ||
}, | ||
verify:{ | ||
help: "Check session", | ||
comment: "Check if the current user's session is valid. Auto-removes the user if it's invalid. <br><br>*Note: The session is automatically checked, though you can still manually call this endpoint if you are having issues with a user.*", | ||
path: "/user/session/check", | ||
$other:{ | ||
openapi: { | ||
fields:{ | ||
security: userSecurity(['view_profile']), | ||
tags: [ | ||
"Profile" | ||
], | ||
responses:{ | ||
"428": { | ||
"$ref": "./error_responses/428.yaml" | ||
}, | ||
} | ||
}, | ||
} | ||
} | ||
}, | ||
following: { | ||
help: "Get following list", | ||
comment: "Get current user's following list", | ||
path: "/user/following", | ||
params: { | ||
count: { | ||
default: 30, | ||
validate: "^[0-9]{1,2}$" | ||
}, | ||
count: p.count, | ||
cursor: { | ||
validate: "^[0-9]+$" | ||
...p.cursor, | ||
type: "number" | ||
} | ||
}, | ||
$other:{ | ||
openapi: { | ||
fields:{ | ||
tags: [ | ||
"Followers" | ||
], | ||
security: userSecurity(['view_profile']), | ||
}, | ||
} | ||
} | ||
}, | ||
follow: { | ||
help: "Follow an user", | ||
comment: specialBadge, | ||
path: "/user/follow", | ||
@@ -715,20 +550,31 @@ method: "POST", | ||
username: { | ||
...p.username, | ||
required: true, | ||
example: 'lilyachty', | ||
}, | ||
secUid:{ | ||
...p.secUid, | ||
required: true | ||
}, | ||
userId: { | ||
example: '6569595380449902597', | ||
name: 'user_id', | ||
required: true | ||
user_id: { | ||
...p.user_id, | ||
required: true, | ||
example: '6569595380449902597' | ||
} | ||
}, | ||
example_response: { | ||
"status": "success", | ||
"message": "string", | ||
$other:{ | ||
openapi: { | ||
fields:{ | ||
tags: [ | ||
"Followers" | ||
], | ||
security: userSecurity(['follow_actions']), | ||
}, | ||
} | ||
} | ||
}, | ||
unfollow: { | ||
help: "Unfollows an user", | ||
path: "/user/follow", | ||
comment: specialBadge, | ||
path: "/user/unfollow", | ||
method: "POST", | ||
@@ -738,86 +584,107 @@ enctype: "json", | ||
username: { | ||
example: 'lilyachty', | ||
...p.username, | ||
required: true, | ||
example: 'lilyachty' | ||
}, | ||
secUid:{ | ||
...p.secUid, | ||
required: true | ||
}, | ||
userId: { | ||
name: 'user_id', | ||
example: '6569595380449902597', | ||
help: "The user ID", | ||
required: true | ||
user_id: { | ||
...p.user_id, | ||
required: true, | ||
example: '6569595380449902597' | ||
} | ||
}, | ||
example_response: { | ||
"status": "success", | ||
"message": "string", | ||
$other:{ | ||
openapi: { | ||
fields:{ | ||
tags: [ | ||
"Followers" | ||
], | ||
security: userSecurity(['follow_actions']), | ||
}, | ||
} | ||
} | ||
}, | ||
feed: { | ||
help: "Get user feed posts", | ||
path: "/user/feed", | ||
params: { | ||
count: { | ||
default: 30, | ||
validate: "^[0-9]{1,2}$" | ||
posts: { | ||
$options:{ | ||
$other:{ | ||
openapi: { | ||
fields:{ | ||
tags: [ | ||
"Posts" | ||
], | ||
}, | ||
} | ||
} | ||
}, | ||
feed: { | ||
help: "Get feed posts", | ||
comment: "Get current user feed posts, or someone elses by providing the `secUid` parameter.", | ||
path: "/user/feed", | ||
params: { | ||
count: p.count, | ||
cursor: p.cursor, | ||
secUid: p.secUid | ||
}, | ||
cursor: { | ||
validate: "^[0-9]+$" | ||
$other:{ | ||
openapi: { | ||
...iterationCodeSamples('cursor'), | ||
fields:{ | ||
security: userSecurity(['explore']), | ||
}, | ||
} | ||
} | ||
}, | ||
likes: { | ||
help: "Get liked posts", | ||
comment: "Get current user liked posts, or someone elses by providing the `secUid` parameter.", | ||
path: "/user/likes", | ||
params: { | ||
count: p.count, | ||
secUid: p.secUid, | ||
cursor: p.cursor, | ||
}, | ||
secUid: { | ||
validate: "^(.*?){30,}$" | ||
$other:{ | ||
openapi: { | ||
...iterationCodeSamples('cursor'), | ||
fields:{ | ||
security: userSecurity(['explore']) | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
likes: { | ||
help: "Get user liked posts", | ||
path: "/user/likes", | ||
params: { | ||
count: { | ||
default: 30, | ||
validate: "^[0-9]{1,2}$" | ||
}, | ||
explore: { | ||
help: "Get trending posts", | ||
comment: "Get current user recommended posts from the *For You* section.", | ||
path: "/user/explore", | ||
params: { | ||
count: p.count | ||
}, | ||
id: { | ||
validate: "^[0-9]+$" | ||
}, | ||
secUid: { | ||
validate: "^(.*?){30,}$" | ||
}, | ||
maxTime: { | ||
name: 'max_time', | ||
validate: "^[0-9]+$" | ||
}, | ||
minTime: { | ||
name: 'min_time', | ||
validate: "^[0-9]+$" | ||
}, | ||
} | ||
}, | ||
explore: { | ||
help: "Get recommended posts", | ||
path: "/user/explore", | ||
params: { | ||
count: { | ||
default: 30, | ||
validate: "^[0-9]{1,2}$" | ||
$other:{ | ||
openapi: { | ||
fields:{ | ||
security: userSecurity(['explore']), | ||
}, | ||
} | ||
} | ||
} | ||
}, | ||
posts: { | ||
info: { | ||
help: "Get video information/Download video", | ||
path: "/public/video", | ||
}, | ||
video: { | ||
help: "Get video information", | ||
comment: videoLink, | ||
path: "/user/video", | ||
params: { | ||
id: { | ||
example: "6950501241915018501", | ||
help: "The video ID", | ||
validate: "^[0-9]+$", | ||
required: true | ||
}, | ||
download: { | ||
default: 0, | ||
in: [0,1] | ||
...p.videoId, | ||
required: true, | ||
example: exampleVideoId | ||
} | ||
}, | ||
$other:{ | ||
openapi: { | ||
fields:{ | ||
security: userSecurity(['explore']), | ||
}, | ||
} | ||
} | ||
@@ -827,2 +694,3 @@ }, | ||
help: "Like a video", | ||
comment: specialBadge, | ||
path: "/user/like", | ||
@@ -832,13 +700,14 @@ method: "POST", | ||
params: { | ||
mediaId: { | ||
example: "6950501241915018501", | ||
help: "The video ID", | ||
name: "media_id", | ||
media_id: { | ||
...p.videoId, | ||
required: true, | ||
validate: "^[0-9]+$" | ||
example: exampleVideoId | ||
} | ||
}, | ||
example_response: { | ||
"status": "success", | ||
"message": "string", | ||
$other:{ | ||
openapi: { | ||
fields:{ | ||
security: userSecurity(['media_actions']), | ||
}, | ||
} | ||
} | ||
@@ -848,2 +717,3 @@ }, | ||
help: "Unlike a video", | ||
comment: specialBadge, | ||
path: "/user/like", | ||
@@ -853,16 +723,26 @@ method: "POST", | ||
params: { | ||
mediaId: { | ||
example: "6950501241915018501", | ||
name: "media_id", | ||
media_id: { | ||
...p.videoId, | ||
required: true, | ||
help: "The video ID", | ||
validate: "^[0-9]+$" | ||
example: exampleVideoId | ||
} | ||
}, | ||
example_response: { | ||
"status": "success", | ||
"message": "string", | ||
$other:{ | ||
openapi: { | ||
fields:{ | ||
security: userSecurity(['media_actions']), | ||
}, | ||
} | ||
} | ||
}, | ||
comments: { | ||
$options:{ | ||
$other:{ | ||
openapi: { | ||
fields:{ | ||
security: userSecurity(['media_actions']), | ||
}, | ||
} | ||
} | ||
}, | ||
list: { | ||
@@ -872,22 +752,13 @@ help: "Get a video comments list", | ||
params: { | ||
mediaId: { | ||
name: "media_id", | ||
example: "6950501241915018501", | ||
media_id: { | ||
...p.videoId, | ||
required: true, | ||
help: "The video ID", | ||
validate: "^[0-9]+$" | ||
example: exampleVideoId | ||
}, | ||
count: { | ||
default: 20, | ||
min: 20, | ||
validate: "^[0-9]{1,2}$" | ||
}, | ||
cursor: { | ||
validate: "^[0-9]+$" | ||
}, | ||
authorId: { | ||
name: 'author_id' | ||
}, | ||
authorUsername: { | ||
name: 'author_username' | ||
count: p.count, | ||
cursor: p.cursor, | ||
}, | ||
$other:{ | ||
openapi:{ | ||
...iterationCodeSamples('cursor') | ||
} | ||
@@ -900,23 +771,22 @@ } | ||
params: { | ||
mediaId: { | ||
name: "media_id", | ||
media_id: { | ||
...p.videoId, | ||
required: true, | ||
help: "The video ID", | ||
example: "6950501241915018501", | ||
validate: "^[0-9]+$" | ||
example: exampleVideoId | ||
}, | ||
commentId: { | ||
name: "comment_id", | ||
help: "The comment ID", | ||
example: "6950502632121548805", | ||
comment_id: { | ||
...p.commentId, | ||
required: true, | ||
validate: "^[0-9]+$" | ||
example: exampleCommentId | ||
}, | ||
count: { | ||
default: 20, | ||
validate: "^[0-9]{1,2}$" | ||
count: p.count, | ||
cursor: p.cursor | ||
}, | ||
$other:{ | ||
openapi:{ | ||
...iterationCodeSamples('cursor') | ||
} | ||
} | ||
}, | ||
make: { | ||
post: { | ||
path: "/user/comment", | ||
@@ -926,51 +796,26 @@ method: "POST", | ||
help: "Post a new comment", | ||
comment: specialBadge + "Make a comment or reply to a comment.", | ||
params: { | ||
mediaId: { | ||
name: "media_id", | ||
media_id: { | ||
...p.videoId, | ||
required: true, | ||
validate: "^[0-9]+$", | ||
help: "The video ID", | ||
example: "6950501241915018501", | ||
example: exampleVideoId | ||
}, | ||
text: { | ||
required: true, | ||
example: "That's cool" | ||
type: "string", | ||
help: "The comment text", | ||
example: "Italian food is the best" | ||
}, | ||
commentId: { | ||
name: "reply_comment_id", | ||
reply_comment_id: { | ||
validate: "^[0-9]+$", | ||
type: "string", | ||
help: "You can reply to a comment by including a comment ID" | ||
}, | ||
has_tags: {}, | ||
authorId: { | ||
name: 'author_id' | ||
has_tags: { | ||
type: "boolean", | ||
default: false, | ||
help: "You should set this to true if you are mentioning someone." | ||
}, | ||
authorUsername: { | ||
name: 'author_username' | ||
} | ||
}, | ||
example_response: { | ||
"status": "success", | ||
"message": "string", | ||
"comment": { | ||
"text": "Thats cool", | ||
"aweme_id": 69095729000000000, | ||
"digg_count": 0, | ||
"user": {}, | ||
"reply_id": 0, | ||
"text_extra": [], | ||
"reply_to_reply_id": 0, | ||
"cid": 69102083240000000, | ||
"status": 7, | ||
"user_digged": 0, | ||
"reply_comment": [], | ||
"label_list": "string", | ||
"create_time": 16089000000 | ||
}, | ||
"label_info": null, | ||
"extra": {}, | ||
"log_pb": {}, | ||
"status_code": 0, | ||
"status_msg": "Comment sent successfully" | ||
} | ||
} | ||
}, | ||
@@ -983,26 +828,12 @@ like: { | ||
params: { | ||
mediaId: { | ||
name: "media_id", | ||
media_id: { | ||
...p.videoId, | ||
required: true, | ||
validate: "^[0-9]+$", | ||
example: "6950501241915018501", | ||
help: "The video ID" | ||
example: exampleVideoId | ||
}, | ||
commentId: { | ||
name: "comment_id", | ||
comment_id: { | ||
...p.commentId, | ||
required: true, | ||
validate: "^[0-9]+$", | ||
help: "The comment ID", | ||
example: "6950502632121548805" | ||
example: exampleCommentId | ||
}, | ||
authorId: { | ||
name: 'author_id' | ||
}, | ||
authorUsername: { | ||
name: 'author_username' | ||
} | ||
}, | ||
example_response: { | ||
"status": "success", | ||
"message": "string", | ||
} | ||
@@ -1016,115 +847,64 @@ }, | ||
params: { | ||
mediaId: { | ||
name: "media_id", | ||
media_id: { | ||
...p.videoId, | ||
required: true, | ||
validate: "^[0-9]+$", | ||
example: "6950501241915018501", | ||
help: "The video ID" | ||
example: exampleVideoId | ||
}, | ||
commentId: { | ||
name: "comment_id", | ||
comment_id: { | ||
...p.commentId, | ||
required: true, | ||
validate: "^[0-9]+$", | ||
help: "The comment ID", | ||
example: "6950502632121548805" | ||
}, | ||
authorId: { | ||
name: 'author_id' | ||
}, | ||
authorUsername: { | ||
name: 'author_username' | ||
example: exampleCommentId | ||
} | ||
}, | ||
example_response: { | ||
"status": "success", | ||
"message": "string", | ||
} | ||
}, | ||
delete:{ | ||
path: "/user/comment/delete", | ||
help: "Delete a comment", | ||
comment: specialBadge, | ||
method: "POST", | ||
params:{ | ||
comment_id: { | ||
...p.commentId, | ||
required: true, | ||
example: exampleCommentId | ||
}, | ||
} | ||
} | ||
} | ||
}, | ||
conversations: { | ||
path: '/user/conversations', | ||
help: "Get user conversations", | ||
comment: premiumBadge + "Get a list of current user conversations including the latest messages", | ||
params: { | ||
cursor: { | ||
validate: "^[0-9]+$" | ||
} | ||
nextCursor: p.offset | ||
}, | ||
example_response: { | ||
"hasMore": false, | ||
"nextCursor": "1", | ||
"perUserCursor": "161830000000000", | ||
"conversations": [ | ||
{ | ||
"conversationType": 1, | ||
"favorite": 0, | ||
"id": "0:1:684574219823xxxxxxx:694024352038xxxxxxx", | ||
"inboxType": 0, | ||
"isParticipant": true, | ||
"messages": [ | ||
{ | ||
"content": { | ||
"aweType": 0 | ||
}, | ||
"createTime": "1618000000000", | ||
"senderSecUid": "MS4wLjABAAAA77.....", | ||
"senderUid": "684574219xxxxxxxxx", | ||
"status": 0, | ||
"text": "Hello!", | ||
"version": "0" | ||
}, | ||
{ | ||
"content": { | ||
"aweType": 700, | ||
"isDefault": false, | ||
"is_card": false, | ||
"mSendStartTime": 1618260000000, | ||
"msgHint": "", | ||
"type": 0 | ||
}, | ||
"createTime": "16182628000000", | ||
"senderSecUid": "MS4wLjABAAAA77.......", | ||
"senderUid": "684574219xxxxxxxx", | ||
"status": 0, | ||
"text": "hi, whatsup", | ||
"version": "0" | ||
} | ||
$other:{ | ||
openapi: { | ||
...iterationCodeSamples('nextCursor'), | ||
fields:{ | ||
tags: [ | ||
"Messages" | ||
], | ||
"mute": 0, | ||
"notice": "", | ||
"ownerSecUid": "MS4wLjABAAAAg.......", | ||
"ownerUid": "694024352xxxxxx", | ||
"participantsCount": 2, | ||
"participantsUid": [ | ||
"684574219xxxxxxxx", | ||
"694024352xxxxxxxx" | ||
], | ||
"short_id": "694024514xxxxxxx", | ||
"ticket": "z5fP0jzMCTIoG......" | ||
} | ||
], | ||
"error_desc": "OK", | ||
"inbox_type": 0, | ||
"log_id": "202104171926xxxxxxxxx", | ||
"message": "", | ||
"sequence_id": "0", | ||
"status": "success", | ||
"status_code": 0 | ||
security: userSecurity(['view_messages']), | ||
}, | ||
} | ||
} | ||
}, | ||
messages: { | ||
path: '/user/messages', | ||
help: "Get user messages", | ||
comment: premiumBadge + "Get full messages list of a conversation", | ||
params: { | ||
conversationId: { | ||
required: true | ||
conversation_id: { | ||
help: "The conversation ID", | ||
required: true, | ||
example: "0:1:684574219823284956:69402435203845897564" | ||
}, | ||
conversationShortId: { | ||
required: true | ||
conversation_short_id: { | ||
help: "The additional conversation short ID (TikTok uses two different ID's for some reason)", | ||
required: true, | ||
example: "6940245147502654884" | ||
}, | ||
cursor: { | ||
validate: "^[0-9]+$" | ||
}, | ||
nextCursor: p.cursor, | ||
limit: { | ||
@@ -1134,86 +914,90 @@ validate: "^[0-9]{1,2}$" | ||
}, | ||
example_response: { | ||
"hasMore": true, | ||
"nextCursor": 161590272500000, | ||
"messages": [ | ||
{ | ||
"text": "heeey", | ||
"createTime": 1615900000000, | ||
"isStranger": true, | ||
"senderSecUid": "MS4wLjABAAA...", | ||
"senderUid": "69402435......", | ||
"status": 0, | ||
"type": 7, | ||
"clientMessageId": "8046dd57...", | ||
"content": { | ||
"aweType": 700, | ||
"isDefault": true, | ||
"is_card": true, | ||
"mSendStartTime": 1615900000000, | ||
"msgHint": null, | ||
"type": 0 | ||
} | ||
} | ||
], | ||
"status": "success", | ||
"message": null, | ||
"error_desc": "OK", | ||
"inbox_type": 0, | ||
"log_id": "20210414132....", | ||
"sequence_id": 10005, | ||
"status_code": 0 | ||
$other:{ | ||
openapi: { | ||
...iterationCodeSamples('nextCursor'), | ||
fields:{ | ||
tags: [ | ||
"Messages" | ||
], | ||
security: userSecurity(['view_messages']), | ||
}, | ||
} | ||
} | ||
}, | ||
sendMessage:{ | ||
path: '/user/message/send', | ||
help: 'Send a message', | ||
comment: premiumBadge + specialBadge, | ||
method: "POST", | ||
params: { | ||
text:{ | ||
required: true, | ||
type: "string", | ||
help: "The message text", | ||
example: "Hey! How you doing?" | ||
}, | ||
conversation_id: { | ||
help: "The conversation ID", | ||
required: true, | ||
type: "string", | ||
example: "0:1:684574219823284956:69402435203845897564" | ||
}, | ||
conversation_short_id: { | ||
help: "The additional conversation short ID (TikTok uses two different ID's for some reason)", | ||
required: true, | ||
type: "string", | ||
example: "6940245147502654884" | ||
}, | ||
ticket:{ | ||
help: "The conversation ticket", | ||
required: true, | ||
type: "string", | ||
example: "3M8IlBpABq00h2aNB1B5JJ2ne0DTnGLLAFjGQQGMf4BKWJxEYxf7RAE0KaD2EjkQkWiJalT4xj36JGWa1ZmQg7SgQfHLoXffNFYLkIJhe1HVyiPXitoxWFyuzlX1xvBCYhZxkQALHE4gx9AaXBPEZjks7jC" | ||
} | ||
}, | ||
$other:{ | ||
openapi: { | ||
fields:{ | ||
tags: [ | ||
"Messages" | ||
], | ||
security: userSecurity(['send_messages']), | ||
}, | ||
} | ||
} | ||
}, | ||
live: { | ||
$options:{ | ||
$other:{ | ||
openapi: { | ||
fields:{ | ||
tags: [ | ||
"Live" | ||
], | ||
security: userSecurity(['live']), | ||
}, | ||
} | ||
} | ||
}, | ||
permissions:{ | ||
help: "Check live permissions", | ||
comment: "Check current user live permissions. You can use this to check if the user has third_party streaming enabled.", | ||
path: "/user/live/info" | ||
}, | ||
start: { | ||
help: 'Start a live video', | ||
help: 'Start live video', | ||
path: '/user/live/start', | ||
method: 'POST', | ||
enctype: 'json', | ||
comment: premiumBadge + `Start a live video, if the user has live enabled. | ||
The live is closed automatically after stream ends.`, | ||
params: { | ||
title: { | ||
required: true, | ||
example: "Check out my live!" | ||
} | ||
}, | ||
example_response: { | ||
"status": "success", | ||
"message": null, | ||
"room": { | ||
"cover": { | ||
"avg_color": null, | ||
"height": 0, | ||
"image_type": 0, | ||
"is_animated": true, | ||
"open_web_url": null, | ||
"uri": "tiktok-obj/db20c99f44182xxxxxxxxxxxxxx", | ||
"url_list": [ | ||
"https://p16-webcast.tiktokcdn.com/img/alisg/tiktok-obj/db20c99f44182ab54cca90de8xxxxxx~tplv-obj.image" | ||
], | ||
"width": 0 | ||
}, | ||
"create_time": 1618500000000, | ||
"id": "6951455042083xxxxxx", | ||
"share_url": "https://m.tiktok.com/share/live/6951455042083xxxxx/?language=en&u_code=dd8i6568e8a8e8", | ||
"status": 1 | ||
example: "Check out my live!", | ||
help: "The live room header title" | ||
}, | ||
"stream": { | ||
"id": "29909202465xxxxx", | ||
"pull": { | ||
"default_resolution": "FULL_HD1", | ||
"flv": { | ||
"FULL_HD1": "https://pull-f5-va01.tiktokcdn.com/game/stream-29909202465xxxxx_uhd.flv", | ||
"HD1": "https://pull-f5-va01.tiktokcdn.com/game/stream-29909202465647xxxx_hd.flv", | ||
"SD1": "https://pull-f5-va01.tiktokcdn.com/game/stream-29909202465647xxxxxx_ld.flv", | ||
"SD2": "https://pull-f5-va01.tiktokcdn.com/game/stream-29909202465647xxxxxxx_sd.flv" | ||
}, | ||
"hls": "https://pull-hls-f16-va01.tiktokcdn.com/game/stream-2990920246564xxxxxxx/index.m3u8", | ||
"rtmp": "https://pull-f5-va01.tiktokcdn.com/game/stream-2990920246564xxxxxxx.flv" | ||
}, | ||
"push": { | ||
"key": "stream-299092024xxxxxxx?expire=1619116601&sign=3c61ba05715befe6xxxxxxxxxxxxxx", | ||
"server": "rtmp://push-rtmp-f5-va01.tiktokcdn.com/game", | ||
"url": "rtmp://push-rtmp-f5-va01.tiktokcdn.com/game/stream-299092024656xxxxxxx?expire=1619116601&sign=3c61ba05715befe6xxxxxxxxxxxxxx" | ||
} | ||
third_party: { | ||
default: true, | ||
help: "TikTok has a special gateway for invite only users. Only if this is enabled you can do third party streaming." | ||
} | ||
@@ -1223,160 +1007,101 @@ } | ||
stop: { | ||
help: 'Stop a live video', | ||
help: 'Stop live video', | ||
comment: premiumBadge, | ||
path: '/user/live/stop', | ||
method: 'POST', | ||
enctype: 'json', | ||
example_response: { | ||
"status": "success", | ||
"message": "" | ||
} | ||
enctype: 'json' | ||
}, | ||
info: { | ||
help: 'Get a live video information', | ||
help: 'Get live information', | ||
comment: `Get information about a live video. <br/>You can use this for any user | ||
that has an open live video. There is a \`roomId\` parameter included when | ||
fetching profile information about users.`, | ||
path: '/user/live/check', | ||
params: { | ||
roomId: { | ||
name: 'room_id', | ||
required: true | ||
} | ||
room_id: { | ||
...p.roomId, | ||
required: true, | ||
}, | ||
}, | ||
example_response: "{...}" | ||
}, | ||
recommend: { | ||
help: 'Get recommended live videos based on a live video', | ||
help: 'Get recommended live videos', | ||
path: '/user/live/recommend', | ||
comment: "Get a list of recommended live videos, related with a live video.", | ||
params: { | ||
roomId: { | ||
name: 'room_id', | ||
required: true | ||
} | ||
room_id: { | ||
...p.roomId, | ||
required: true, | ||
}, | ||
}, | ||
example_response: "{...}" | ||
}, | ||
stats: { | ||
help: 'Get a ended live video statistics', | ||
help: 'Get live statistics', | ||
comment: "Get statistics for the current user live video, after it has ended.", | ||
path: '/user/live/stats', | ||
params: { | ||
roomId: { | ||
name: 'room_id', | ||
required: true | ||
} | ||
}, | ||
example_response: { | ||
"status": "success", | ||
"message": null, | ||
"data": { | ||
"period_stats": { | ||
"decimal_num": 2, | ||
"stats_type": 0, | ||
"value": 4493 | ||
}, | ||
"room_stats": { | ||
"live_comment_ucnt": 0, | ||
"live_consume_ucnt": 0, | ||
"live_end_time": "2021-04-17T19:30:44.386Z", | ||
"live_like_cnt": 0, | ||
"live_new_fans_ucnt": 0, | ||
"live_pause_duration": 0, | ||
"live_start_time": "2021-04-17T19:30:44.386Z", | ||
"live_watch_ucnt": 4, | ||
"room_id": '695140311xxxxxxxxx', | ||
"total_score": 0 | ||
} | ||
room_id: { | ||
...p.roomId, | ||
required: true, | ||
}, | ||
"extra": { | ||
"now": 161850000000000 | ||
}, | ||
"status_code": 0 | ||
} | ||
}, | ||
enter: { | ||
path: '/user/live/enter', | ||
params: { | ||
roomId: { | ||
name: 'room_id', | ||
required: true | ||
chat:{ | ||
help: "Get live chat and gifts", | ||
comment: premiumBadge + "Get real-time live chat, gifts, and other events for any live video.", | ||
path: "/user/live/chat", | ||
params:{ | ||
room_id: { | ||
...p.roomId, | ||
required: true, | ||
}, | ||
nextCursor: { | ||
type: "string", | ||
help: "Returned in each response, should be included in the next requests to get the next chat events." | ||
} | ||
}, | ||
example_response: '{...}' | ||
} | ||
}, | ||
search: { | ||
help: "Search for users", | ||
path: '/user/search', | ||
params: { | ||
query: { | ||
required: true, | ||
example: 'lilyachty' | ||
$other:{ | ||
openapi:{ | ||
...iterationCodeSamples('nextCursor'), | ||
fields:{ | ||
security: userSecurity(['live','send_messages']), | ||
}, | ||
} | ||
} | ||
} | ||
}, | ||
analytics: { | ||
$help: "Get analytics for creator accounts", | ||
overview: { | ||
path: "/creator/analytics/overview", | ||
params: { | ||
days: { | ||
default: 7, | ||
validate: "^[0-9]+$" | ||
} | ||
}, | ||
example_response: "{...}" | ||
}, | ||
videos: { | ||
path: "/creator/analytics/videos", | ||
sendChat: { | ||
help: "Send a message to a live chat", | ||
comment: premiumBadge + specialBadge + "Send a chat message to any live video", | ||
path: "/user/live/chat/send", | ||
method: "POST", | ||
params: { | ||
days: { | ||
default: 7, | ||
validate: "^[0-9]+$" | ||
room_id: { | ||
...p.roomId, | ||
required: true, | ||
}, | ||
text:{ | ||
required: true, | ||
type: "string", | ||
help: "The chat text message", | ||
example: "A mí me gusta" | ||
} | ||
}, | ||
example_response: "{...}" | ||
}, | ||
followers: { | ||
path: "/creator/analytics/followers", | ||
params: { | ||
days: { | ||
default: 7, | ||
validate: "^[0-9]+$" | ||
} | ||
}, | ||
example_response: "{...}" | ||
}, | ||
live: { | ||
path: "/creator/analytics/live", | ||
params: { | ||
days: { | ||
default: 7, | ||
validate: "^[0-9]+$" | ||
} | ||
}, | ||
example_response: "{...}" | ||
} | ||
} | ||
}, | ||
} | ||
}; | ||
const api = function (apiKey) { | ||
if(!apiKey) { | ||
throw new Error("A valid API Key is required."); | ||
} | ||
return Wrape(endpoints, { | ||
base: "https://api.tikapi.io", | ||
params: { | ||
apiKey: { | ||
name: "X-API-KEY", | ||
required: true, | ||
location: "headers", | ||
validate: "^[a-zA-Z0-9]{10,}$", | ||
example: 'myAPIKey' | ||
}, | ||
}, | ||
key: { | ||
path: '/key/info', | ||
help: 'Get information about your API Key', | ||
$other: { | ||
openapi:{ | ||
fields:{ | ||
tags: [ | ||
"Key" | ||
] | ||
} | ||
} | ||
}, | ||
values: { | ||
apiKey: apiKey | ||
} | ||
}); | ||
} | ||
} | ||
}); | ||
module.exports = api; | ||
export default API; |
{ | ||
"name": "tikapi", | ||
"version": "2.0.11", | ||
"description": "An fully managed unofficial TikTok app with OAuth capabilities", | ||
"main": "api.js", | ||
"version": "3.0.0", | ||
"description": "A fully managed unofficial TikTok app with OAuth capabilities", | ||
"main": "./index.js", | ||
"type": "module", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"build": "npm run build-python && tsc && npm run build-types && node after_build.js", | ||
"build-types": "rests api.js -t ./api.d.ts --types_template ./template.ts", | ||
"build-python": "rests api.js -p ./python-api/tikapi/api.py --python_template ./python-api/tikapi/template.py", | ||
"tests": "echo \" no tests specified\"", | ||
"prepublish": "npm run build && npm run tests && git add . && git commit -am \"publish v%npm_package_version%\" && git push" | ||
}, | ||
@@ -36,8 +41,12 @@ "repository": { | ||
"bugs": { | ||
"url": "https://github.com/tikapi-io/tiktok-api/issues" | ||
"url": "https://tikapi.io" | ||
}, | ||
"homepage": "https://github.com/tikapi-io/tiktok-api#readme", | ||
"homepage": "https://tikapi.io", | ||
"devDependencies": { | ||
"https-proxy-agent": "^5.0.1", | ||
"typescript": "^4.7.4" | ||
}, | ||
"dependencies": { | ||
"wrape": "^1.2.7" | ||
"rests": "^1.0.6" | ||
} | ||
} |
1750
README.md
# Unofficial TikTok API | ||
A fully managed hassle-free TikTok API solution with OAuth capabilities. | ||
You can get started instantly, all you need is an API Key. | ||
Get one at https://tikapi.io | ||
Get started by getting an API Key at https://www.tikapi.io | ||
*Note: Spam/Abuse/Follower selling services are strictly not allowed.* | ||
*Note: Spam/Abuse and other use cases that are against community guidelines are forbidden.* | ||
## Installation | ||
`npm i tikapi` | ||
Node.js | ||
## Usage | ||
```javascript | ||
const api = require("tikapi")("myApiKey"); | ||
await api.public.user({ | ||
username: 'lilyachty' | ||
}); | ||
```bash | ||
npm i tikapi | ||
``` | ||
## Reference | ||
Python 3 | ||
SDK And Documentation made with https://github.com/elis-k/wrape | ||
- [public](#api-public) | ||
- [user](#api-public-user) | ||
- [explore](#api-public-explore) | ||
- [posts](#api-public-posts) | ||
- [liked](#api-public-likes) | ||
- [video](#api-public-video) | ||
- [discover](#api-public-discover) | ||
- [users](#api-public-discover-users) | ||
- [music](#api-public-discover-music) | ||
- [hashtags](#api-public-discover-hashtags) | ||
- [hashtag](#api-public-hashtag) | ||
- [user](#api-user) | ||
- [profile](#api-user-profile) | ||
- [info](#api-user-profile-info) | ||
- [edit](#api-user-profile-edit) | ||
- [notifications](#api-user-notifications) | ||
- [followers](#api-user-followers) | ||
- [following](#api-user-following) | ||
- [follow](#api-user-follow) | ||
- [unfollow](#api-user-unfollow) | ||
- [feed](#api-user-feed) | ||
- [likes](#api-user-likes) | ||
- [explore](#api-user-explore) | ||
- [posts](#api-user-posts) | ||
- [info](#api-user-posts-info) | ||
- [like](#api-user-posts-like) | ||
- [unlike](#api-user-posts-unlike) | ||
- [comments](#api-user-posts-comments) | ||
- [list](#api-user-posts-comments-list) | ||
- [replies](#api-user-posts-comments-replies) | ||
- [make](#api-user-posts-comments-make) | ||
- [like](#api-user-posts-comments-like) | ||
- [unlike](#api-user-posts-comments-unlike) | ||
- [conversations](#api-user-conversations) | ||
- [messages](#api-user-messages) | ||
- [live](#api-user-live) | ||
- [start](#api-user-live-start) | ||
- [stop](#api-user-live-stop) | ||
- [info](#api-user-live-info) | ||
- [recommend](#api-user-live-recommend) | ||
- [stats](#api-user-live-stats) | ||
- [enter](#api-user-live-enter) | ||
- [search](#api-user-search) | ||
- [analytics](#api-user-analytics) | ||
- [overview](#api-user-analytics-overview) | ||
- [videos](#api-user-analytics-videos) | ||
- [followers](#api-user-analytics-followers) | ||
- [live](#api-user-analytics-live) | ||
<h2 id="api-public">Public</h2> | ||
Public endpoints do not require an user authorization | ||
<h3 id="api-public-user">User</h3> | ||
Get user profile information | ||
```javascript | ||
api.public.user({ | ||
username: "lilyachty", //required | ||
//secUid: "<any>", //optional | Validate: ^(.*?){30,}$ | ||
}) | ||
```bash | ||
pip3 install tikapi | ||
``` | ||
<details> | ||
<summary>Request</summary> | ||
**GET** /public/check | ||
|Parameter|Location|Required|Description| | ||
|--|--|--|--| | ||
username|query|true|The TikTok account username | ||
secUid|query|false|The TikTok user secUid | ||
</details> | ||
<details> | ||
<summary>Response</summary> | ||
```json | ||
{ | ||
"status": "success", | ||
"message": "string", | ||
"statusCode": 0, | ||
"userInfo": { | ||
"user": { | ||
"id": 684574219000000000, | ||
"uniqueId": "lilyachty", | ||
"nickname": "lilyachty", | ||
"avatarThumb": "https://p16-sign-sg.tiktokcdn.com/aweme/100x100/tiktok-obj/db20c99f44182ab54cca90de85f673bf.jpeg?x-expires=1606165200&x-signature=pw%2BueamaONA9LQMd7h0Pyyb0%2FAY%3D", | ||
"avatarMedium": "https://p16-sign-sg.tiktokcdn.com/aweme/720x720/tiktok-obj/db20c99f44182ab54cca90de85f673bf.jpeg?x-expires=1606165200&x-signature=8FzlgFpqsP8ZPLJhxDKmqHyJ0N0%3D", | ||
"avatarLarger": "https://p16-sign-sg.tiktokcdn.com/aweme/1080x1080/tiktok-obj/db20c99f44182ab54cca90de85f673bf.jpeg?x-expires=1606165200&x-signature=SYNT1mnTj7VipZCFrh8FrmVsRJU%3D", | ||
"signature": null, | ||
"verified": true, | ||
"secUid": "MS4wLjABAAAA77...........", | ||
"secret": true, | ||
"ftc": true, | ||
"relation": 0, | ||
"openFavorite": true, | ||
"commentSetting": 0, | ||
"duetSetting": 0, | ||
"stitchSetting": 0, | ||
"privateAccount": true | ||
}, | ||
"stats": { | ||
"followingCount": 0, | ||
"followerCount": 0, | ||
"heartCount": 0, | ||
"videoCount": 0, | ||
"diggCount": 0, | ||
"heart": 0 | ||
}, | ||
"shareMeta": { | ||
"title": "lilyachty on TikTok", | ||
"desc": "@lilyachty 0 Followers 0 Following 0 Likes - Watch awesome short videos created by lilyachty" | ||
} | ||
} | ||
} | ||
``` | ||
</details> | ||
<h3 id="api-public-explore">Explore</h3> | ||
Get recommended posts | ||
```javascript | ||
api.public.explore({ | ||
//count: 5, //optional | Validate: ^[0-9]{1,2}$ | ||
}) | ||
``` | ||
<details> | ||
<summary>Request</summary> | ||
**GET** /public/explore | ||
|Parameter|Location|Required|Description| | ||
|--|--|--|--| | ||
count|query|false| | ||
</details> | ||
<h3 id="api-public-posts">Posts</h3> | ||
Get posts of an user | ||
```javascript | ||
api.public.posts({ | ||
secUid: "MS4wLjABAAAAsHntXC3s0AvxcecggxsoVa4eAiT8OVafVZ4OQXxy-9htpnUi0sOYSr0kGGD1Loud", //required | Validate: ^(.*?){30,}$ | ||
//count: 5, //optional | Validate: ^[0-9]{1,2}$ | ||
//cursor: "<any>", //optional | Validate: ^[0-9]+$ | ||
}) | ||
``` | ||
<details> | ||
<summary>Request</summary> | ||
**GET** /public/posts | ||
|Parameter|Location|Required|Description| | ||
|--|--|--|--| | ||
secUid|query|true|The user secUid | ||
count|query|false| | ||
cursor|query|false| | ||
</details> | ||
<details> | ||
<summary>Response</summary> | ||
```json | ||
{ | ||
"status": "success", | ||
"message": "string", | ||
"statusCode": 0, | ||
"itemList": [ | ||
{ | ||
"id": 6932268218690145000, | ||
"desc": "The way he dives into the ball pit 😂😂😂 TYSM to Sarah and Rock Dodd from NY! 🥰", | ||
"createTime": 1614044487, | ||
"video": { | ||
"id": 6932268218690145000, | ||
"height": 1024, | ||
"width": 576, | ||
"duration": 58, | ||
"ratio": "720p", | ||
"cover": "https://p16-sign-sg.tiktokcdn.com/tos-maliva-p-0068/7a9f49ac001748bc8c807b74805696a0~tplv-dmt-logom:tos-maliva-p-0000/147eca0bbe4a4320adf3a754500753b6.image?x-expires=1614106800&x-signature=TwoCAwb61y6S5WgzE6qLvqSZ9UI%3D", | ||
"originCover": "https://p16-sign-sg.tiktokcdn.com/obj/tos-maliva-p-0068/e66f4a91f7344027a1d810669e9ae36e_1614044489?x-expires=1614106800&x-signature=dcw8cAWMrxpkRQ3VK%2FuQfcpP1f8%3D", | ||
"dynamicCover": "https://p16-sign-sg.tiktokcdn.com/obj/tos-maliva-p-0068/50a86c1ff6244894b5d7a7e524265b52_1614044493?x-expires=1614106800&x-signature=WIxlVRaftMgyJgJB8UBKo6r1yOI%3D", | ||
"playAddr": "https://v16-web.tiktok.com/video/tos/useast2a/tos-useast2a-pve-0068/5bf7260ddb454770a69af5504005ca8c/?a=1988&br=4138&bt=2069&cd=0%7C0%7C1&ch=0&cr=0&cs=0&cv=1&dr=0&ds=3&er=&expire=1614107310&l=202102231307320101902092161F0FE04F&lr=tiktok_m&mime_type=video_mp4&pl=0&policy=2&qs=0&rc=M3g3d3E1Ozk4MzMzOjczM0ApOGY6Mzg8OWU5Nzo3ZDs4M2dsa29kc24ybm5gLS1iMTZzc2BfLzUzYjA2L18uMzEtMTE6Yw%3D%3D&signature=7db7b85f595129f501618fc50d7408fe&tk=tt_webid_v2&vl=&vr=", | ||
"downloadAddr": "https://v16-web.tiktok.com/video/tos/useast2a/tos-useast2a-pve-0068/5bf7260ddb454770a69af5504005ca8c/?a=1988&br=4138&bt=2069&cd=0%7C0%7C1&ch=0&cr=0&cs=0&cv=1&dr=0&ds=3&er=&expire=1614107310&l=202102231307320101902092161F0FE04F&lr=tiktok_m&mime_type=video_mp4&pl=0&policy=2&qs=0&rc=M3g3d3E1Ozk4MzMzOjczM0ApOGY6Mzg8OWU5Nzo3ZDs4M2dsa29kc24ybm5gLS1iMTZzc2BfLzUzYjA2L18uMzEtMTE6Yw%3D%3D&signature=7db7b85f595129f501618fc50d7408fe&tk=tt_webid_v2&vl=&vr=", | ||
"shareCover": [ | ||
null | ||
], | ||
"reflowCover": "https://p16-sign-sg.tiktokcdn.com/obj/tos-maliva-p-0068/9e209ac43d03422555230402d3f4cf07?x-expires=1614106800&x-signature=GC3FZC2q01W6gzUCx2SgLNkOGA0%3D" | ||
}, | ||
"author": { | ||
"id": 6658113054100652000, | ||
"uniqueId": "heresyourmonkeycontent", | ||
"nickname": "Georgie Boy", | ||
"avatarThumb": "https://p16-sign-va.tiktokcdn.com/musically-maliva-obj/1663367077635077~c5_100x100.jpeg?x-expires=1614171600&x-signature=ykouyuQyhAgJhAO%2FkNEIH1AcS50%3D", | ||
"avatarMedium": "https://p16-sign-va.tiktokcdn.com/musically-maliva-obj/1663367077635077~c5_720x720.jpeg?x-expires=1614171600&x-signature=Oo9ewQlRjJUH%2BVOPmKyDPAZvIeo%3D", | ||
"avatarLarger": "https://p16-sign-va.tiktokcdn.com/musically-maliva-obj/1663367077635077~c5_1080x1080.jpeg?x-expires=1614171600&x-signature=CXugf2YWO%2BJUEtUADeAE2Kj9zmI%3D", | ||
"signature": "👆YOUTUBE AND INSTA", | ||
"verified": true, | ||
"secUid": "MS4wLjABAAAA7CyNvLiT5-wfMyn7_KhW2jJM-QZZMgvDH9UjKnlgd2pCWpyI0PUewJn-f_hLOuMD", | ||
"secret": true, | ||
"ftc": true, | ||
"relation": 1, | ||
"openFavorite": true, | ||
"commentSetting": 0, | ||
"duetSetting": 0, | ||
"stitchSetting": 0, | ||
"privateAccount": true | ||
}, | ||
"music": { | ||
"id": 6932268233760509000, | ||
"title": "original sound", | ||
"playUrl": "https://sf16-ies-music-va.tiktokcdn.com/obj/musically-maliva-obj/6932268236901731077.mp3", | ||
"coverThumb": "https://p16-sign-va.tiktokcdn.com/musically-maliva-obj/1663367077635077~c5_100x100.jpeg?x-expires=1614171600&x-signature=ykouyuQyhAgJhAO%2FkNEIH1AcS50%3D", | ||
"coverMedium": "https://p16-sign-va.tiktokcdn.com/musically-maliva-obj/1663367077635077~c5_720x720.jpeg?x-expires=1614171600&x-signature=Oo9ewQlRjJUH%2BVOPmKyDPAZvIeo%3D", | ||
"coverLarge": "https://p16-sign-va.tiktokcdn.com/musically-maliva-obj/1663367077635077~c5_1080x1080.jpeg?x-expires=1614171600&x-signature=CXugf2YWO%2BJUEtUADeAE2Kj9zmI%3D", | ||
"authorName": "Georgie Boy", | ||
"original": true, | ||
"duration": 58, | ||
"album": null | ||
}, | ||
"challenges": [ | ||
{ | ||
"id": 22453, | ||
"title": "monkey", | ||
"desc": null, | ||
"profileThumb": null, | ||
"profileMedium": null, | ||
"profileLarger": null, | ||
"coverThumb": null, | ||
"coverMedium": null, | ||
"coverLarger": null, | ||
"isCommerce": true | ||
} | ||
], | ||
"stats": { | ||
"diggCount": 16000, | ||
"shareCount": 612, | ||
"commentCount": 393, | ||
"playCount": 80200 | ||
}, | ||
"duetInfo": { | ||
"duetFromId": 0 | ||
}, | ||
"originalItem": true, | ||
"officalItem": true, | ||
"textExtra": [ | ||
{ | ||
"awemeId": null, | ||
"start": 82, | ||
"end": 89, | ||
"hashtagName": "monkey", | ||
"hashtagId": null, | ||
"type": 1, | ||
"userId": null, | ||
"isCommerce": true, | ||
"userUniqueId": null, | ||
"secUid": null | ||
} | ||
], | ||
"secret": true, | ||
"forFriend": true, | ||
"digged": true, | ||
"itemCommentStatus": 0, | ||
"showNotPass": true, | ||
"vl1": true, | ||
"itemMute": true, | ||
"authorStats": { | ||
"followingCount": 282, | ||
"followerCount": 12900000, | ||
"heartCount": 142600000, | ||
"videoCount": 455, | ||
"diggCount": 1443, | ||
"heart": 142600000 | ||
}, | ||
"privateItem": true, | ||
"duetEnabled": true, | ||
"stitchEnabled": true, | ||
"shareEnabled": true, | ||
"stickersOnItem": [ | ||
{ | ||
"stickerType": 0 | ||
} | ||
], | ||
"isAd": true | ||
} | ||
], | ||
"cursor": 1611774375000, | ||
"hasMore": true | ||
} | ||
``` | ||
</details> | ||
<h3 id="api-public-likes">Liked</h3> | ||
Get liked posts of an user | ||
```javascript | ||
api.public.likes({ | ||
secUid: "MS4wLjABAAAAsHntXC3s0AvxcecggxsoVa4eAiT8OVafVZ4OQXxy-9htpnUi0sOYSr0kGGD1Loud", //required | Validate: ^(.*?){30,}$ | ||
//count: 5, //optional | Validate: ^[0-9]{1,2}$ | ||
//cursor: "<any>", //optional | Validate: ^[0-9]+$ | ||
}) | ||
``` | ||
<details> | ||
<summary>Request</summary> | ||
**GET** /public/likes | ||
|Parameter|Location|Required|Description| | ||
|--|--|--|--| | ||
secUid|query|true|The user secUid | ||
count|query|false| | ||
cursor|query|false| | ||
</details> | ||
<h3 id="api-public-video">Video</h3> | ||
Get a video information/ Download a video | ||
```javascript | ||
api.public.video({ | ||
id: "6950501241915018501", //required | Validate: ^[0-9]+$ | ||
//username: "lilyachty", //optional | ||
//download: "<any>", //optional | Allowed: 0, 1 | ||
}) | ||
``` | ||
<details> | ||
<summary>Request</summary> | ||
**GET** /public/video | ||
|Parameter|Location|Required|Description| | ||
|--|--|--|--| | ||
id|query|true|The video ID | ||
username|query|false|The author username | ||
download|query|false|Set this to `1` to get a mp4 file | ||
</details> | ||
<h3 id="api-public-discover">Discover</h3> | ||
Search users, music, hashtags | ||
<h4 id="api-public-discover-users">Users</h4> | ||
```javascript | ||
api.public.discover.users({ | ||
//keyword: "<any>", //optional | ||
//count: 30, //optional | Validate: ^[0-9]{1,2}$ | ||
//cursor: "<any>", //optional | Validate: ^[0-9]+$ | ||
}) | ||
``` | ||
<details> | ||
<summary>Request</summary> | ||
**GET** /public/discover/users | ||
|Parameter|Location|Required|Description| | ||
|--|--|--|--| | ||
keyword|query|false| | ||
count|query|false| | ||
cursor|query|false| | ||
</details> | ||
<h4 id="api-public-discover-music">Music</h4> | ||
```javascript | ||
api.public.discover.music({ | ||
//keyword: "lilyachty", //optional | ||
//count: 30, //optional | Validate: ^[0-9]{1,2}$ | ||
//cursor: "<any>", //optional | Validate: ^[0-9]+$ | ||
}) | ||
``` | ||
<details> | ||
<summary>Request</summary> | ||
**GET** /public/discover/music | ||
|Parameter|Location|Required|Description| | ||
|--|--|--|--| | ||
keyword|query|false| | ||
count|query|false| | ||
cursor|query|false| | ||
</details> | ||
<details> | ||
<summary>Response</summary> | ||
```json | ||
{ | ||
"status": "success", | ||
"message": null, | ||
"musicInfoList": [ | ||
{ | ||
"music": { | ||
"album": "Hey Julie! (feat. Lil Yachty)", | ||
"authorName": "KYLE", | ||
"coverLarge": "https://p16-sg.tiktokcdn.com/aweme/720x720/tos-alisg-i-0000/d03864babe5c4c1ea2106db77909807e.jpeg", | ||
"coverMedium": "https://p16-sg.tiktokcdn.com/aweme/200x200/tos-alisg-i-0000/d03864babe5c4c1ea2106db77909807e.jpeg", | ||
"coverThumb": "https://p16-sg.tiktokcdn.com/aweme/100x100/tos-alisg-i-0000/d03864babe5c4c1ea2106db77909807e.jpeg", | ||
"duration": 33, | ||
"id": 6659459073378995000, | ||
"original": true, | ||
"playUrl": "https://sf16-ies-music-sg.tiktokcdn.com/obj/tiktok-obj/030aee3fc6cf3eecf1b97b08c344d392.mp3", | ||
"title": "Hey Julie! (feat. Lil Yachty)" | ||
}, | ||
"stats": { | ||
"videoCount": 5600000 | ||
} | ||
} | ||
], | ||
"offset": 10, | ||
"statusCode": 0 | ||
} | ||
``` | ||
</details> | ||
<h4 id="api-public-discover-hashtags">Hashtags</h4> | ||
```javascript | ||
api.public.discover.hashtags({ | ||
//keyword: "lilyachty", //optional | ||
//count: 30, //optional | Validate: ^[0-9]{1,2}$ | ||
//cursor: "<any>", //optional | Validate: ^[0-9]+$ | ||
}) | ||
``` | ||
<details> | ||
<summary>Request</summary> | ||
**GET** /public/discover/hashtag | ||
|Parameter|Location|Required|Description| | ||
|--|--|--|--| | ||
keyword|query|false| | ||
count|query|false| | ||
cursor|query|false| | ||
</details> | ||
<details> | ||
<summary>Response</summary> | ||
```json | ||
{} | ||
``` | ||
</details> | ||
<h3 id="api-public-hashtag">Hashtag</h3> | ||
Get posts by hashtag ID (You can find it using Discover endpoint) | ||
```javascript | ||
api.public.hashtag({ | ||
id: "<any>", //required | Validate: ^[0-9]+$ | ||
//count: 30, //optional | Validate: ^[0-9]{1,2}$ | ||
//cursor: "<any>", //optional | Validate: ^[0-9]+$ | ||
}) | ||
``` | ||
<details> | ||
<summary>Request</summary> | ||
**GET** /public/hashtag | ||
|Parameter|Location|Required|Description| | ||
|--|--|--|--| | ||
id|query|true|The hashtag ID | ||
count|query|false| | ||
cursor|query|false|The starting point of items list | ||
</details> | ||
<details> | ||
<summary>Response</summary> | ||
```json | ||
{ | ||
"status": "success", | ||
"message": "string", | ||
"itemStruct": { | ||
"cursor": 60, | ||
"hasMore": true, | ||
"itemList": [ | ||
{ | ||
"author": { | ||
"avatarLarger": "https://p16-sign-va.tiktokcdn.com/musically-maliva-obj/ed46bcdd5e318d4670f26aec440e2052~c5_1080x1080.jpeg?x-expires=1618480800&x-signature=tKuHC7eXYB343bslQKrw41UN%2FIo%3D", | ||
"avatarMedium": "https://p16-sign-va.tiktokcdn.com/musically-maliva-obj/ed46bcdd5e318d4670f26aec440e2052~c5_720x720.jpeg?x-expires=1618480800&x-signature=OjnTsyKRskBVTj%2Fi2spU%2F%2FEEgvA%3D", | ||
"avatarThumb": "https://p16-sign-va.tiktokcdn.com/musically-maliva-obj/ed46bcdd5e318d4670f26aec440e2052~c5_100x100.jpeg?x-expires=1618480800&x-signature=Bq6J1aq3O248fvPcZZXyj5uI6JI%3D", | ||
"commentSetting": 0, | ||
"duetSetting": 0, | ||
"ftc": true, | ||
"id": "6743547525321xxxxx", | ||
"nickname": "RAP", | ||
"openFavorite": true, | ||
"privateAccount": true, | ||
"relation": 0, | ||
"secUid": "MS4wLjABAAAAyZX6.", | ||
"secret": true, | ||
"signature": "Link in bio", | ||
"stitchSetting": 0, | ||
"uniqueId": "rap", | ||
"verified": true | ||
}, | ||
"authorStats": { | ||
"diggCount": 5795, | ||
"followerCount": 5400000, | ||
"followingCount": 434, | ||
"heart": 200100000, | ||
"heartCount": 200100000, | ||
"videoCount": 2405 | ||
}, | ||
"challenges": [ | ||
{ | ||
"coverLarger": null, | ||
"coverMedium": null, | ||
"coverThumb": null, | ||
"desc": null, | ||
"id": 656, | ||
"isCommerce": true, | ||
"profileLarger": null, | ||
"profileMedium": null, | ||
"profileThumb": null, | ||
"title": "bobbyshmurda" | ||
} | ||
], | ||
"createTime": 1615085843, | ||
"desc": null, | ||
"digged": true, | ||
"duetEnabled": true, | ||
"duetInfo": { | ||
"duetFromId": 0 | ||
}, | ||
"forFriend": true, | ||
"id": 6936740859383680000, | ||
"isAd": true, | ||
"itemCommentStatus": 0, | ||
"itemMute": true, | ||
"music": { | ||
"album": null, | ||
"authorName": "RAP", | ||
"coverLarge": "https://p16-sign-va.tiktokcdn.com/musically-maliva-obj/ed46bcdd5e318d4670f26aec440e2052~c5_1080x1080.jpeg?x-expires=1618480800&x-signature=tKuHC7eXYB343bslQKrw41UN%2FIo%3D", | ||
"coverMedium": "https://p16-sign-va.tiktokcdn.com/musically-maliva-obj/ed46bcdd5e318d4670f26aec440e2052~c5_720x720.jpeg?x-expires=1618480800&x-signature=OjnTsyKRskBVTj%2Fi2spU%2F%2FEEgvA%3D", | ||
"coverThumb": "https://p16-sign-va.tiktokcdn.com/musically-maliva-obj/ed46bcdd5e318d4670f26aec440e2052~c5_100x100.jpeg?x-expires=1618480800&x-signature=Bq6J1aq3O248fvPcZZXyj5uI6JI%3D", | ||
"duration": 15, | ||
"id": 6936740754928717000, | ||
"original": true, | ||
"playUrl": "https://sf16-ies-music-va.tiktokcdn.com/obj/musically-maliva-obj/6936740824692558597.mp3", | ||
"title": "original sound" | ||
}, | ||
"officalItem": true, | ||
"originalItem": true, | ||
"privateItem": true, | ||
"secret": true, | ||
"shareEnabled": true, | ||
"showNotPass": true, | ||
"stats": { | ||
"commentCount": 5270, | ||
"diggCount": 232700, | ||
"playCount": 2100000, | ||
"shareCount": 2957 | ||
}, | ||
"stickersOnItem": [ | ||
{ | ||
"stickerText": [ | ||
"Bobby Shmurda pulling up to All Star weekend🔥" | ||
], | ||
"stickerType": 4 | ||
} | ||
], | ||
"stitchEnabled": true, | ||
"textExtra": [ | ||
{ | ||
"awemeId": null, | ||
"end": 13, | ||
"hashtagId": 656, | ||
"hashtagName": "bobbyshmurda", | ||
"isCommerce": true, | ||
"secUid": null, | ||
"start": 0, | ||
"type": 1, | ||
"userId": null, | ||
"userUniqueId": null | ||
} | ||
], | ||
"video": { | ||
"cover": "https://p16-sign-va.tiktokcdn.com/obj/tos-maliva-p-0068/43bdcd4b086446f68ece8ec7289845fc?x-expires=1618416000&x-signature=rMQAUzfMneoP%2B8bHXKGSfwIfxTU%3D", | ||
"downloadAddr": "https://v16-web.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068c003/3f83725baa75439ea8ba764a2ab6dd75/?a=1988&br=3120&bt=1560&cd=0%7C0%7C1&ch=0&cr=0&cs=0&cv=1&dr=0&ds=3&er=&expire=1618419556&l=202104141059010101890531331400A966&lr=tiktok_m&mime_type=video_mp4&net=0&pl=0&policy=2&qs=0&rc=anc4Zjw4aDY3NDMzOTczM0ApOTNlOmQ0Nzw7NzZoZjY2ZWdrLTJgcTYxLy9gLS1iMTZzczQuYl8uMGE2MTYvMmEzM2I6Yw%3D%3D&signature=5c842ee10fd13d7947cc6f52a0c04d82&tk=tt_webid_v2&vl=&vr=", | ||
"duration": 15, | ||
"dynamicCover": "https://p16-sign-va.tiktokcdn.com/obj/tos-maliva-p-0068/def4c536e245468ba0404da490337aeb_1615085845?x-expires=1618416000&x-signature=NTiyZa3N5mddjNvoFtDyznzRH6A%3D", | ||
"height": 1024, | ||
"id": 6936740859383680000, | ||
"originCover": "https://p16-sign-va.tiktokcdn.com/obj/tos-maliva-p-0068/28baaa197b1440fdb0aa9795106b8825_1615085845?x-expires=1618416000&x-signature=veEGB6CU9nZIDTFaEwOOU0gHbjY%3D", | ||
"playAddr": "https://v16-web.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068c003/3f83725baa75439ea8ba764a2ab6dd75/?a=1988&br=3120&bt=1560&cd=0%7C0%7C1&ch=0&cr=0&cs=0&cv=1&dr=0&ds=3&er=&expire=1618419556&l=202104141059010101890531331400A966&lr=tiktok_m&mime_type=video_mp4&net=0&pl=0&policy=2&qs=0&rc=anc4Zjw4aDY3NDMzOTczM0ApOTNlOmQ0Nzw7NzZoZjY2ZWdrLTJgcTYxLy9gLS1iMTZzczQuYl8uMGE2MTYvMmEzM2I6Yw%3D%3D&signature=5c842ee10fd13d7947cc6f52a0c04d82&tk=tt_webid_v2&vl=&vr=", | ||
"ratio": "720p", | ||
"reflowCover": "https://p16-sign-va.tiktokcdn.com/obj/tos-maliva-p-0068/43bdcd4b086446f68ece8ec7289845fc?x-expires=1618416000&x-signature=rMQAUzfMneoP%2B8bHXKGSfwIfxTU%3D", | ||
"shareCover": [ | ||
null | ||
], | ||
"width": 576 | ||
}, | ||
"vl1": true | ||
} | ||
], | ||
"message": null, | ||
"status": "success", | ||
"statusCode": 0 | ||
} | ||
} | ||
``` | ||
</details> | ||
<h2 id="api-user">User</h2> | ||
The user endpoints require an `accountKey` | ||
```javascript | ||
const user = new api.user.set({ | ||
accountKey: "myAccountKey", //required | Validate: ^[a-zA-Z0-9]{10,}$ | ||
}) | ||
``` | ||
<h3 id="api-user-profile">Profile</h3> | ||
<h4 id="api-user-profile-info">Info</h4> | ||
Get current user profile information | ||
```javascript | ||
user.profile.info({ | ||
}) | ||
``` | ||
<details> | ||
<summary>Request</summary> | ||
**GET** /user/info | ||
|Parameter|Location|Required|Description| | ||
|--|--|--|--| | ||
</details> | ||
<details> | ||
<summary>Response</summary> | ||
```json | ||
{ | ||
"status": "success", | ||
"message": "string", | ||
"statusCode": 0, | ||
"userInfo": { | ||
"user": { | ||
"id": 684574219000000000, | ||
"uniqueId": "lilyachty", | ||
"nickname": "lilyachty", | ||
"avatarThumb": "https://p16-sign-sg.tiktokcdn.com/aweme/100x100/tiktok-obj/db20c99f44182ab54cca90de85f673bf.jpeg?x-expires=1606165200&x-signature=pw%2BueamaONA9LQMd7h0Pyyb0%2FAY%3D", | ||
"avatarMedium": "https://p16-sign-sg.tiktokcdn.com/aweme/720x720/tiktok-obj/db20c99f44182ab54cca90de85f673bf.jpeg?x-expires=1606165200&x-signature=8FzlgFpqsP8ZPLJhxDKmqHyJ0N0%3D", | ||
"avatarLarger": "https://p16-sign-sg.tiktokcdn.com/aweme/1080x1080/tiktok-obj/db20c99f44182ab54cca90de85f673bf.jpeg?x-expires=1606165200&x-signature=SYNT1mnTj7VipZCFrh8FrmVsRJU%3D", | ||
"signature": null, | ||
"verified": true, | ||
"secUid": "MS4wLjABAAAA77...........", | ||
"secret": true, | ||
"ftc": true, | ||
"relation": 0, | ||
"openFavorite": true, | ||
"commentSetting": 0, | ||
"duetSetting": 0, | ||
"stitchSetting": 0, | ||
"privateAccount": true | ||
}, | ||
"stats": { | ||
"followingCount": 0, | ||
"followerCount": 0, | ||
"heartCount": 0, | ||
"videoCount": 0, | ||
"diggCount": 0, | ||
"heart": 0 | ||
}, | ||
"shareMeta": { | ||
"title": "lilyachty on TikTok", | ||
"desc": "@lilyachty 0 Followers 0 Following 0 Likes - Watch awesome short videos created by lilyachty" | ||
} | ||
} | ||
} | ||
``` | ||
</details> | ||
<h4 id="api-user-profile-edit">Edit</h4> | ||
Edit the user profile | ||
```javascript | ||
user.profile.edit({ | ||
//nickname: "<any>", //optional | ||
//username: "<any>", //optional | ||
//bio: "My new bio", //optional | ||
//privacy: "<any>", //optional | Validate: ^[0-1]$ | ||
}) | ||
``` | ||
<details> | ||
<summary>Request</summary> | ||
**POST** /user/edit | ||
|Parameter|Location|Required|Description| | ||
|--|--|--|--| | ||
nickname|body|false| | ||
username|body|false| | ||
bio|body|false| | ||
privacy|body|false| | ||
</details> | ||
<details> | ||
<summary>Response</summary> | ||
```json | ||
{ | ||
"status": "success", | ||
"message": null, | ||
"extra": { | ||
"fatal_item_ids": [], | ||
"logid": "202104141323300101901...", | ||
"now": 1618406620418 | ||
}, | ||
"log_pb": { | ||
"impr_id": "202104141323300101..." | ||
}, | ||
"status_code": 0, | ||
"user": { | ||
"apple_account": 0, | ||
"avatar_larger": { | ||
"uri": "tiktok-obj/db20c99f44182ab54cca90de85f673bf", | ||
"url_list": [ | ||
"https://p16-sign-sg.tiktokcdn.com..." | ||
] | ||
}, | ||
"avatar_medium": { | ||
"uri": "tiktok-obj/db20c99f44182ab54cca90de85f673bf", | ||
"url_list": [ | ||
"https://p16-sign-sg.tiktokcdn.com..." | ||
] | ||
}, | ||
"avatar_thumb": { | ||
"uri": "tiktok-obj/db20c99f44182ab54cca90de85f673bf", | ||
"url_list": [ | ||
"https://p16-sign-sg.tiktokcdn.com..." | ||
] | ||
}, | ||
"google_account": null, | ||
"ins_id": null, | ||
"nickname": "demoapi", | ||
"secret": 0, | ||
"self_visible_avatar_larger": { | ||
"uri": "1080x1080/tiktok-obj/db20c99f44182ab54cca90de85f673bf", | ||
"url_list": [ | ||
"https://p16-sign-sg.tiktokcdn.com..." | ||
] | ||
}, | ||
"self_visible_avatar_medium": { | ||
"uri": "720x720/tiktok-obj/db20c99f44182ab54cca90de85f673bf", | ||
"url_list": [ | ||
"https://p16-sign-sg.tiktokcdn..." | ||
] | ||
}, | ||
"self_visible_avatar_thumb": { | ||
"uri": "100x100/tiktok-obj/db20c99f44182ab54cca90de85f673bf", | ||
"url_list": [ | ||
"https://p16-sign-sg..." | ||
] | ||
}, | ||
"share_qrcode_uri": null, | ||
"short_id": 0, | ||
"signature": "My new bio!", | ||
"twitter_id": null, | ||
"twitter_name": null, | ||
"uid": "6845742198232xxxxxx", | ||
"unique_id": "demoapi", | ||
"verification_type": 0, | ||
"video_icon": { | ||
"uri": null, | ||
"url_list": [] | ||
}, | ||
"youtube_channel_id": null, | ||
"youtube_channel_title": null | ||
} | ||
} | ||
``` | ||
</details> | ||
<h3 id="api-user-notifications">Notifications</h3> | ||
Get user notifications | ||
```javascript | ||
user.notifications({ | ||
//filter: "all", //optional | Allowed: all, likes, comments, mentions, followers | ||
//count: 20, //optional | Max: 20 | Validate: ^[0-9]{1,2}$ | ||
//maxTime: "<any>", //optional | Validate: ^[0-9]+$ | ||
//minTime: "<any>", //optional | Validate: ^[0-9]+$ | ||
}) | ||
``` | ||
<details> | ||
<summary>Request</summary> | ||
**GET** /user/notifications | ||
|Parameter|Location|Required|Description| | ||
|--|--|--|--| | ||
filter|query|false| | ||
count|query|false| | ||
max_time|query|false| | ||
min_time|query|false| | ||
</details> | ||
<h3 id="api-user-followers">Followers</h3> | ||
Get followers list | ||
```javascript | ||
user.followers({ | ||
//count: 30, //optional | Validate: ^[0-9]{1,2}$ | ||
//maxTime: "<any>", //optional | Validate: ^[0-9]+$ | ||
//minTime: "<any>", //optional | Validate: ^[0-9]+$ | ||
}) | ||
``` | ||
<details> | ||
<summary>Request</summary> | ||
**GET** /user/followers | ||
|Parameter|Location|Required|Description| | ||
|--|--|--|--| | ||
count|query|false| | ||
max_time|query|false| | ||
min_time|query|false| | ||
</details> | ||
<h3 id="api-user-following">Following</h3> | ||
Get following list | ||
```javascript | ||
user.following({ | ||
//count: 30, //optional | Validate: ^[0-9]{1,2}$ | ||
//cursor: "<any>", //optional | Validate: ^[0-9]+$ | ||
}) | ||
``` | ||
<details> | ||
<summary>Request</summary> | ||
**GET** /user/following | ||
|Parameter|Location|Required|Description| | ||
|--|--|--|--| | ||
count|query|false| | ||
cursor|query|false| | ||
</details> | ||
<h3 id="api-user-follow">Follow</h3> | ||
Follow an user | ||
```javascript | ||
user.follow({ | ||
username: "lilyachty", //required | ||
userId: "6569595380449902597", //required | ||
}) | ||
``` | ||
<details> | ||
<summary>Request</summary> | ||
**POST** /user/follow | ||
|Parameter|Location|Required|Description| | ||
|--|--|--|--| | ||
username|body|true| | ||
user_id|body|true| | ||
</details> | ||
<details> | ||
<summary>Response</summary> | ||
```json | ||
{ | ||
"status": "success", | ||
"message": "string" | ||
} | ||
``` | ||
</details> | ||
<h3 id="api-user-unfollow">Unfollow</h3> | ||
Unfollows an user | ||
```javascript | ||
user.unfollow({ | ||
username: "lilyachty", //required | ||
userId: "6569595380449902597", //required | ||
}) | ||
``` | ||
<details> | ||
<summary>Request</summary> | ||
**POST** /user/follow | ||
|Parameter|Location|Required|Description| | ||
|--|--|--|--| | ||
username|body|true| | ||
user_id|body|true|The user ID | ||
</details> | ||
<details> | ||
<summary>Response</summary> | ||
```json | ||
{ | ||
"status": "success", | ||
"message": "string" | ||
} | ||
``` | ||
</details> | ||
<h3 id="api-user-feed">Feed</h3> | ||
Get user feed posts | ||
```javascript | ||
user.feed({ | ||
//count: 30, //optional | Validate: ^[0-9]{1,2}$ | ||
//cursor: "<any>", //optional | Validate: ^[0-9]+$ | ||
//secUid: "<any>", //optional | Validate: ^(.*?){30,}$ | ||
}) | ||
``` | ||
<details> | ||
<summary>Request</summary> | ||
**GET** /user/feed | ||
|Parameter|Location|Required|Description| | ||
|--|--|--|--| | ||
count|query|false| | ||
cursor|query|false| | ||
secUid|query|false| | ||
</details> | ||
<h3 id="api-user-likes">Likes</h3> | ||
Get user liked posts | ||
```javascript | ||
user.likes({ | ||
//count: 30, //optional | Validate: ^[0-9]{1,2}$ | ||
//id: "<any>", //optional | Validate: ^[0-9]+$ | ||
//secUid: "<any>", //optional | Validate: ^(.*?){30,}$ | ||
//maxTime: "<any>", //optional | Validate: ^[0-9]+$ | ||
//minTime: "<any>", //optional | Validate: ^[0-9]+$ | ||
}) | ||
``` | ||
<details> | ||
<summary>Request</summary> | ||
**GET** /user/likes | ||
|Parameter|Location|Required|Description| | ||
|--|--|--|--| | ||
count|query|false| | ||
id|query|false| | ||
secUid|query|false| | ||
max_time|query|false| | ||
min_time|query|false| | ||
</details> | ||
<h3 id="api-user-explore">Explore</h3> | ||
Get recommended posts | ||
```javascript | ||
user.explore({ | ||
//count: 30, //optional | Validate: ^[0-9]{1,2}$ | ||
}) | ||
``` | ||
<details> | ||
<summary>Request</summary> | ||
**GET** /user/explore | ||
|Parameter|Location|Required|Description| | ||
|--|--|--|--| | ||
count|query|false| | ||
</details> | ||
<h3 id="api-user-posts">Posts</h3> | ||
<h4 id="api-user-posts-info">Info</h4> | ||
Get video information/Download video | ||
```javascript | ||
user.posts.info({ | ||
id: "6950501241915018501", //required | Validate: ^[0-9]+$ | ||
//download: "<any>", //optional | Allowed: 0, 1 | ||
}) | ||
``` | ||
<details> | ||
<summary>Request</summary> | ||
**GET** /public/video | ||
|Parameter|Location|Required|Description| | ||
|--|--|--|--| | ||
id|query|true|The video ID | ||
download|query|false| | ||
</details> | ||
<h4 id="api-user-posts-like">Like</h4> | ||
Like a video | ||
```javascript | ||
user.posts.like({ | ||
mediaId: "6950501241915018501", //required | Validate: ^[0-9]+$ | ||
}) | ||
``` | ||
<details> | ||
<summary>Request</summary> | ||
**POST** /user/like | ||
|Parameter|Location|Required|Description| | ||
|--|--|--|--| | ||
media_id|body|true|The video ID | ||
</details> | ||
<details> | ||
<summary>Response</summary> | ||
```json | ||
{ | ||
"status": "success", | ||
"message": "string" | ||
} | ||
``` | ||
</details> | ||
<h4 id="api-user-posts-unlike">Unlike</h4> | ||
Unlike a video | ||
```javascript | ||
user.posts.unlike({ | ||
mediaId: "6950501241915018501", //required | Validate: ^[0-9]+$ | ||
}) | ||
``` | ||
<details> | ||
<summary>Request</summary> | ||
**POST** /user/like | ||
|Parameter|Location|Required|Description| | ||
|--|--|--|--| | ||
media_id|body|true|The video ID | ||
</details> | ||
<details> | ||
<summary>Response</summary> | ||
```json | ||
{ | ||
"status": "success", | ||
"message": "string" | ||
} | ||
``` | ||
</details> | ||
<h4 id="api-user-posts-comments">Comments</h4> | ||
<h5 id="api-user-posts-comments-list">List</h5> | ||
Get a video comments list | ||
```javascript | ||
user.posts.comments.list({ | ||
mediaId: "6950501241915018501", //required | Validate: ^[0-9]+$ | ||
//count: 20, //optional | Min: 20 | Validate: ^[0-9]{1,2}$ | ||
//cursor: "<any>", //optional | Validate: ^[0-9]+$ | ||
//authorId: "<any>", //optional | ||
//authorUsername: "<any>", //optional | ||
}) | ||
``` | ||
<details> | ||
<summary>Request</summary> | ||
**GET** /comment/list | ||
|Parameter|Location|Required|Description| | ||
|--|--|--|--| | ||
media_id|query|true|The video ID | ||
count|query|false| | ||
cursor|query|false| | ||
author_id|query|false| | ||
author_username|query|false| | ||
</details> | ||
<h5 id="api-user-posts-comments-replies">Replies</h5> | ||
Get a comment reply list | ||
```javascript | ||
user.posts.comments.replies({ | ||
mediaId: "6950501241915018501", //required | Validate: ^[0-9]+$ | ||
commentId: "6950502632121548805", //required | Validate: ^[0-9]+$ | ||
//count: 20, //optional | Validate: ^[0-9]{1,2}$ | ||
}) | ||
``` | ||
<details> | ||
<summary>Request</summary> | ||
**GET** /comment/reply/list | ||
|Parameter|Location|Required|Description| | ||
|--|--|--|--| | ||
media_id|query|true|The video ID | ||
comment_id|query|true|The comment ID | ||
count|query|false| | ||
</details> | ||
<h5 id="api-user-posts-comments-make">Make</h5> | ||
Post a new comment | ||
```javascript | ||
user.posts.comments.make({ | ||
mediaId: "6950501241915018501", //required | Validate: ^[0-9]+$ | ||
text: "That's cool", //required | ||
//commentId: "<any>", //optional | Validate: ^[0-9]+$ | ||
//has_tags: "<any>", //optional | ||
//authorId: "<any>", //optional | ||
//authorUsername: "<any>", //optional | ||
}) | ||
``` | ||
<details> | ||
<summary>Request</summary> | ||
**POST** /user/comment | ||
|Parameter|Location|Required|Description| | ||
|--|--|--|--| | ||
media_id|body|true|The video ID | ||
text|body|true| | ||
reply_comment_id|body|false|You can reply to a comment by including a comment ID | ||
has_tags|body|false| | ||
author_id|body|false| | ||
author_username|body|false| | ||
</details> | ||
<details> | ||
<summary>Response</summary> | ||
```json | ||
{ | ||
"status": "success", | ||
"message": "string", | ||
"comment": { | ||
"text": "Thats cool", | ||
"aweme_id": 69095729000000000, | ||
"digg_count": 0, | ||
"user": {}, | ||
"reply_id": 0, | ||
"text_extra": [], | ||
"reply_to_reply_id": 0, | ||
"cid": 69102083240000000, | ||
"status": 7, | ||
"user_digged": 0, | ||
"reply_comment": [], | ||
"label_list": "string", | ||
"create_time": 16089000000 | ||
}, | ||
"label_info": null, | ||
"extra": {}, | ||
"log_pb": {}, | ||
"status_code": 0, | ||
"status_msg": "Comment sent successfully" | ||
} | ||
``` | ||
</details> | ||
<h5 id="api-user-posts-comments-like">Like</h5> | ||
Like a comment | ||
```javascript | ||
user.posts.comments.like({ | ||
mediaId: "6950501241915018501", //required | Validate: ^[0-9]+$ | ||
commentId: "6950502632121548805", //required | Validate: ^[0-9]+$ | ||
//authorId: "<any>", //optional | ||
//authorUsername: "<any>", //optional | ||
}) | ||
``` | ||
<details> | ||
<summary>Request</summary> | ||
**POST** /user/comment/like | ||
|Parameter|Location|Required|Description| | ||
|--|--|--|--| | ||
media_id|body|true|The video ID | ||
comment_id|body|true|The comment ID | ||
author_id|body|false| | ||
author_username|body|false| | ||
</details> | ||
<details> | ||
<summary>Response</summary> | ||
```json | ||
{ | ||
"status": "success", | ||
"message": "string" | ||
} | ||
``` | ||
</details> | ||
<h5 id="api-user-posts-comments-unlike">Unlike</h5> | ||
Unlike a comment | ||
```javascript | ||
user.posts.comments.unlike({ | ||
mediaId: "6950501241915018501", //required | Validate: ^[0-9]+$ | ||
commentId: "6950502632121548805", //required | Validate: ^[0-9]+$ | ||
//authorId: "<any>", //optional | ||
//authorUsername: "<any>", //optional | ||
}) | ||
``` | ||
<details> | ||
<summary>Request</summary> | ||
**POST** /user/comment/unlike | ||
|Parameter|Location|Required|Description| | ||
|--|--|--|--| | ||
media_id|body|true|The video ID | ||
comment_id|body|true|The comment ID | ||
author_id|body|false| | ||
author_username|body|false| | ||
</details> | ||
<details> | ||
<summary>Response</summary> | ||
```json | ||
{ | ||
"status": "success", | ||
"message": "string" | ||
} | ||
``` | ||
</details> | ||
<h3 id="api-user-conversations">Conversations</h3> | ||
Get user conversations | ||
```javascript | ||
user.conversations({ | ||
//cursor: "<any>", //optional | Validate: ^[0-9]+$ | ||
}) | ||
``` | ||
<details> | ||
<summary>Request</summary> | ||
**GET** /user/conversations | ||
|Parameter|Location|Required|Description| | ||
|--|--|--|--| | ||
cursor|query|false| | ||
</details> | ||
<details> | ||
<summary>Response</summary> | ||
```json | ||
{ | ||
"hasMore": false, | ||
"nextCursor": "1", | ||
"perUserCursor": "161830000000000", | ||
"conversations": [ | ||
{ | ||
"conversationType": 1, | ||
"favorite": 0, | ||
"id": "0:1:684574219823xxxxxxx:694024352038xxxxxxx", | ||
"inboxType": 0, | ||
"isParticipant": true, | ||
"messages": [ | ||
{ | ||
"content": { | ||
"aweType": 0 | ||
}, | ||
"createTime": "1618000000000", | ||
"senderSecUid": "MS4wLjABAAAA77.....", | ||
"senderUid": "684574219xxxxxxxxx", | ||
"status": 0, | ||
"text": "Hello!", | ||
"version": "0" | ||
}, | ||
{ | ||
"content": { | ||
"aweType": 700, | ||
"isDefault": false, | ||
"is_card": false, | ||
"mSendStartTime": 1618260000000, | ||
"msgHint": "", | ||
"type": 0 | ||
}, | ||
"createTime": "16182628000000", | ||
"senderSecUid": "MS4wLjABAAAA77.......", | ||
"senderUid": "684574219xxxxxxxx", | ||
"status": 0, | ||
"text": "hi, whatsup", | ||
"version": "0" | ||
} | ||
], | ||
"mute": 0, | ||
"notice": "", | ||
"ownerSecUid": "MS4wLjABAAAAg.......", | ||
"ownerUid": "694024352xxxxxx", | ||
"participantsCount": 2, | ||
"participantsUid": [ | ||
"684574219xxxxxxxx", | ||
"694024352xxxxxxxx" | ||
], | ||
"short_id": "694024514xxxxxxx", | ||
"ticket": "z5fP0jzMCTIoG......" | ||
} | ||
], | ||
"error_desc": "OK", | ||
"inbox_type": 0, | ||
"log_id": "202104171926xxxxxxxxx", | ||
"message": "", | ||
"sequence_id": "0", | ||
"status": "success", | ||
"status_code": 0 | ||
} | ||
``` | ||
</details> | ||
<h3 id="api-user-messages">Messages</h3> | ||
Get user messages | ||
```javascript | ||
user.messages({ | ||
conversationId: "<any>", //required | ||
conversationShortId: "<any>", //required | ||
//cursor: "<any>", //optional | Validate: ^[0-9]+$ | ||
//limit: "<any>", //optional | Validate: ^[0-9]{1,2}$ | ||
}) | ||
``` | ||
<details> | ||
<summary>Request</summary> | ||
**GET** /user/messages | ||
|Parameter|Location|Required|Description| | ||
|--|--|--|--| | ||
conversationId|query|true| | ||
conversationShortId|query|true| | ||
cursor|query|false| | ||
limit|query|false| | ||
</details> | ||
<details> | ||
<summary>Response</summary> | ||
```json | ||
{ | ||
"hasMore": true, | ||
"nextCursor": 161590272500000, | ||
"messages": [ | ||
{ | ||
"text": "heeey", | ||
"createTime": 1615900000000, | ||
"isStranger": true, | ||
"senderSecUid": "MS4wLjABAAA...", | ||
"senderUid": "69402435......", | ||
"status": 0, | ||
"type": 7, | ||
"clientMessageId": "8046dd57...", | ||
"content": { | ||
"aweType": 700, | ||
"isDefault": true, | ||
"is_card": true, | ||
"mSendStartTime": 1615900000000, | ||
"msgHint": null, | ||
"type": 0 | ||
} | ||
} | ||
], | ||
"status": "success", | ||
"message": null, | ||
"error_desc": "OK", | ||
"inbox_type": 0, | ||
"log_id": "20210414132....", | ||
"sequence_id": 10005, | ||
"status_code": 0 | ||
} | ||
``` | ||
</details> | ||
<h3 id="api-user-live">Live</h3> | ||
<h4 id="api-user-live-start">Start</h4> | ||
Start a live video | ||
```javascript | ||
user.live.start({ | ||
title: "Check out my live!", //required | ||
}) | ||
``` | ||
<details> | ||
<summary>Request</summary> | ||
**POST** /user/live/start | ||
|Parameter|Location|Required|Description| | ||
|--|--|--|--| | ||
title|body|true| | ||
</details> | ||
<details> | ||
<summary>Response</summary> | ||
```json | ||
{ | ||
"status": "success", | ||
"message": null, | ||
"room": { | ||
"cover": { | ||
"avg_color": null, | ||
"height": 0, | ||
"image_type": 0, | ||
"is_animated": true, | ||
"open_web_url": null, | ||
"uri": "tiktok-obj/db20c99f44182xxxxxxxxxxxxxx", | ||
"url_list": [ | ||
"https://p16-webcast.tiktokcdn.com/img/alisg/tiktok-obj/db20c99f44182ab54cca90de8xxxxxx~tplv-obj.image" | ||
], | ||
"width": 0 | ||
}, | ||
"create_time": 1618500000000, | ||
"id": "6951455042083xxxxxx", | ||
"share_url": "https://m.tiktok.com/share/live/6951455042083xxxxx/?language=en&u_code=dd8i6568e8a8e8", | ||
"status": 1 | ||
}, | ||
"stream": { | ||
"id": "29909202465xxxxx", | ||
"pull": { | ||
"default_resolution": "FULL_HD1", | ||
"flv": { | ||
"FULL_HD1": "https://pull-f5-va01.tiktokcdn.com/game/stream-29909202465xxxxx_uhd.flv", | ||
"HD1": "https://pull-f5-va01.tiktokcdn.com/game/stream-29909202465647xxxx_hd.flv", | ||
"SD1": "https://pull-f5-va01.tiktokcdn.com/game/stream-29909202465647xxxxxx_ld.flv", | ||
"SD2": "https://pull-f5-va01.tiktokcdn.com/game/stream-29909202465647xxxxxxx_sd.flv" | ||
}, | ||
"hls": "https://pull-hls-f16-va01.tiktokcdn.com/game/stream-2990920246564xxxxxxx/index.m3u8", | ||
"rtmp": "https://pull-f5-va01.tiktokcdn.com/game/stream-2990920246564xxxxxxx.flv" | ||
}, | ||
"push": { | ||
"key": "stream-299092024xxxxxxx?expire=1619116601&sign=3c61ba05715befe6xxxxxxxxxxxxxx", | ||
"server": "rtmp://push-rtmp-f5-va01.tiktokcdn.com/game", | ||
"url": "rtmp://push-rtmp-f5-va01.tiktokcdn.com/game/stream-299092024656xxxxxxx?expire=1619116601&sign=3c61ba05715befe6xxxxxxxxxxxxxx" | ||
} | ||
} | ||
} | ||
``` | ||
</details> | ||
<h4 id="api-user-live-stop">Stop</h4> | ||
Stop a live video | ||
```javascript | ||
user.live.stop({ | ||
}) | ||
``` | ||
<details> | ||
<summary>Request</summary> | ||
**POST** /user/live/stop | ||
|Parameter|Location|Required|Description| | ||
|--|--|--|--| | ||
</details> | ||
<details> | ||
<summary>Response</summary> | ||
```json | ||
{ | ||
"status": "success", | ||
"message": "" | ||
} | ||
``` | ||
</details> | ||
<h4 id="api-user-live-info">Info</h4> | ||
Get a live video information | ||
```javascript | ||
user.live.info({ | ||
roomId: "<any>", //required | ||
}) | ||
``` | ||
<details> | ||
<summary>Request</summary> | ||
**GET** /user/live/check | ||
|Parameter|Location|Required|Description| | ||
|--|--|--|--| | ||
room_id|query|true| | ||
</details> | ||
<details> | ||
<summary>Response</summary> | ||
```json | ||
{...} | ||
``` | ||
</details> | ||
<h4 id="api-user-live-recommend">Recommend</h4> | ||
Get recommended live videos based on a live video | ||
```javascript | ||
user.live.recommend({ | ||
roomId: "<any>", //required | ||
}) | ||
``` | ||
<details> | ||
<summary>Request</summary> | ||
**GET** /user/live/recommend | ||
|Parameter|Location|Required|Description| | ||
|--|--|--|--| | ||
room_id|query|true| | ||
</details> | ||
<details> | ||
<summary>Response</summary> | ||
```json | ||
{...} | ||
``` | ||
</details> | ||
<h4 id="api-user-live-stats">Stats</h4> | ||
Get a ended live video statistics | ||
```javascript | ||
user.live.stats({ | ||
roomId: "<any>", //required | ||
}) | ||
``` | ||
<details> | ||
<summary>Request</summary> | ||
**GET** /user/live/stats | ||
|Parameter|Location|Required|Description| | ||
|--|--|--|--| | ||
room_id|query|true| | ||
</details> | ||
<details> | ||
<summary>Response</summary> | ||
```json | ||
{ | ||
"status": "success", | ||
"message": null, | ||
"data": { | ||
"period_stats": { | ||
"decimal_num": 2, | ||
"stats_type": 0, | ||
"value": 4493 | ||
}, | ||
"room_stats": { | ||
"live_comment_ucnt": 0, | ||
"live_consume_ucnt": 0, | ||
"live_end_time": "2021-04-17T19:30:44.386Z", | ||
"live_like_cnt": 0, | ||
"live_new_fans_ucnt": 0, | ||
"live_pause_duration": 0, | ||
"live_start_time": "2021-04-17T19:30:44.386Z", | ||
"live_watch_ucnt": 4, | ||
"room_id": "695140311xxxxxxxxx", | ||
"total_score": 0 | ||
} | ||
}, | ||
"extra": { | ||
"now": 161850000000000 | ||
}, | ||
"status_code": 0 | ||
} | ||
``` | ||
</details> | ||
<h4 id="api-user-live-enter">Enter</h4> | ||
```javascript | ||
user.live.enter({ | ||
roomId: "<any>", //required | ||
}) | ||
``` | ||
<details> | ||
<summary>Request</summary> | ||
**GET** /user/live/enter | ||
|Parameter|Location|Required|Description| | ||
|--|--|--|--| | ||
room_id|query|true| | ||
</details> | ||
<details> | ||
<summary>Response</summary> | ||
```json | ||
{...} | ||
``` | ||
</details> | ||
<h3 id="api-user-search">Search</h3> | ||
Search for users | ||
```javascript | ||
user.search({ | ||
query: "lilyachty", //required | ||
}) | ||
``` | ||
<details> | ||
<summary>Request</summary> | ||
**GET** /user/search | ||
|Parameter|Location|Required|Description| | ||
|--|--|--|--| | ||
query|query|true| | ||
</details> | ||
<h3 id="api-user-analytics">Analytics</h3> | ||
Get analytics for creator accounts | ||
<h4 id="api-user-analytics-overview">Overview</h4> | ||
```javascript | ||
user.analytics.overview({ | ||
//days: 7, //optional | Validate: ^[0-9]+$ | ||
}) | ||
``` | ||
<details> | ||
<summary>Request</summary> | ||
**GET** /creator/analytics/overview | ||
|Parameter|Location|Required|Description| | ||
|--|--|--|--| | ||
days|query|false| | ||
</details> | ||
<details> | ||
<summary>Response</summary> | ||
```json | ||
{...} | ||
``` | ||
</details> | ||
<h4 id="api-user-analytics-videos">Videos</h4> | ||
```javascript | ||
user.analytics.videos({ | ||
//days: 7, //optional | Validate: ^[0-9]+$ | ||
}) | ||
``` | ||
<details> | ||
<summary>Request</summary> | ||
**GET** /creator/analytics/videos | ||
|Parameter|Location|Required|Description| | ||
|--|--|--|--| | ||
days|query|false| | ||
</details> | ||
<details> | ||
<summary>Response</summary> | ||
```json | ||
{...} | ||
``` | ||
</details> | ||
<h4 id="api-user-analytics-followers">Followers</h4> | ||
```javascript | ||
user.analytics.followers({ | ||
//days: 7, //optional | Validate: ^[0-9]+$ | ||
}) | ||
``` | ||
<details> | ||
<summary>Request</summary> | ||
**GET** /creator/analytics/followers | ||
|Parameter|Location|Required|Description| | ||
|--|--|--|--| | ||
days|query|false| | ||
</details> | ||
<details> | ||
<summary>Response</summary> | ||
```json | ||
{...} | ||
``` | ||
</details> | ||
<h4 id="api-user-analytics-live">Live</h4> | ||
```javascript | ||
user.analytics.live({ | ||
//days: 7, //optional | Validate: ^[0-9]+$ | ||
}) | ||
``` | ||
<details> | ||
<summary>Request</summary> | ||
**GET** /creator/analytics/live | ||
|Parameter|Location|Required|Description| | ||
|--|--|--|--| | ||
days|query|false| | ||
</details> | ||
<details> | ||
<summary>Response</summary> | ||
```json | ||
{...} | ||
``` | ||
</details> | ||
## Legal | ||
This code is in no way affiliated with, authorized, maintained, sponsored or endorsed by TikTok or any of its affiliates or subsidiaries. This is an independent and unofficial API. Use at your own risk. | ||
## Documentation | ||
https://www.tikapi.io/documentation/ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
7
2460
0
Yes
60270
2
25
1
+ Addedrests@^1.0.6
+ Added@types/node@17.0.45(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@2.0.1(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addedform-data@3.0.2(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedgetarg@0.0.5(transitive)
+ Addedglob@8.1.0(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedminimatch@5.1.6(transitive)
+ Addednode-fetch@2.7.0(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedrests@1.1.1(transitive)
+ Addedtr46@0.0.3(transitive)
+ Addedtypescript@4.9.5(transitive)
+ Addedwebidl-conversions@3.0.1(transitive)
+ Addedwhatwg-url@5.0.0(transitive)
+ Addedwrappy@1.0.2(transitive)
+ Addedyaml@2.7.0(transitive)
- Removedwrape@^1.2.7