Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
T

tiktok-api

> 编程语言
Open source

Unofficial API wrapper for TikTok

1.3K stars0 likes1 views
WebsiteGitHub

About

Unofficial API wrapper for TikTok

Unofficial TikTok/Musical.ly API

This project is no longer maintained.


A reverse-engineered implementation of the TikTok (previously musical.ly) app's API.

Installation

bash
npm i tiktok-api

Usage

Creating an instance

…

Instance methods

  • .loginWithEmail(email, password)
  • .loginWithUsername(username, password)
  • .getUser(id)
  • .searchUsers(params)
  • .getQRCode(id, [schemaType])
  • .getPost(id)
  • .listPosts(params)
  • .listFollowers(params)
  • .listFollowing(params)
  • .follow(id)
  • .unfollow(id)
  • .listReceivedFollowRequests(params)
  • .approveFollowRequest(id)
  • .rejectFollowRequest(id)
  • .likePost(id)
  • .unlikePost(id)
  • .listComments(params)
  • .postComment(postId, text, [tags])
  • .listCategories(params)
  • .searchHashtags(params)
  • .listPostsInHashtag(params)
  • .listForYouFeed([params])
  • .listFollowingFeed([params])
  • .getSticker(id)
  • .getStickers([ids])
  • .listPostsBySticker(params)
  • .joinLiveStream(id)
  • .leaveLiveStream(id)
  • .canStartLiveStream()
  • .startLiveStream(title, [contactsAuthorized])
  • .endLiveStream(roomId, streamId)
  • .createLiveStreamRoom(title, [contactsAuthorized])
  • .updateLiveStreamStatus(params)

.loginWithEmail(email, password)

Authenticates you with the API and stores your session data in a cookie jar. Subsequent requests will include these cookies.

javascript
api.loginWithEmail('', '')
  .then(res => console.log(res.data))
  .catch(console.log)

// Outputs:
// { email: '', session_key: '123456', user_id: '123456', ... }

See the login types for the response data.

.loginWithUsername(username, password)

Authenticates you with the API and stores your session data in a cookie jar. Subsequent requests will include these cookies.

javascript
api.loginWithUsername('', '')
  .then(res => console.log(res.data))
  .catch(console.log)

// Outputs:
// { username: '', session_key: '123456', user_id: '123456', ... }

See the login types for the response data.

.getUser(id)

Gets a user's profile.

javascript
api.getUser('')
  .then(res => console.log(res.data.user))
  .catch(console.log);

// Outputs:
// { aweme_count: 1000, nickname: 'example', unique_id: 'musername', ... }

See the user types for the response data.

.searchUsers(params)

Searches for users.

javascript
api.searchUsers({
  keyword: 'example',
  count: 10,
  cursor: 0,
})
  .then(res => console.log(res.data.user_list))
  .catch(console.log);

// Outputs:
// [{ user_info: {...}, position: [], uniqposition: [] }, ...]

See the search types for the complete request/response objects.

.getQRCode(id, [schemaType])

Gets the QR code for a user.

javascript
api.getQRCode('')
  .then(res => console.log(res.data.qrcode_url.url_list[0]))
  .catch(console.log);

// Outputs:
// 'http://p16.muscdn.com/img/musically-qrcode/1111111111111111111~c5_720x720.image'

See the QR code types for the complete request/response objects.

.getPost(id)

Gets a post.

javascript
api.getPost('')
  .then(res => console.log(res.data.aweme_detail))
  .catch(console.log);

// Outputs:
// { author: {...}, aweme_id: '999', desc: 'description', music: {...}, statistics: {...}, video: {...}, ... }

See the post types for the complete response object.

.listPosts(params)

Lists a user's posts.

javascript
api.listPosts({
  user_id: '',
  max_cursor: 0,
})
  .then(res => console.log(res.data.aweme_list))
  .catch(console.log);

// Outputs:
// [{ author: {...}, aweme_id: '999', desc: 'description', music: {...}, statistics: {...}, video: {...} }, ...]

See the post types for the complete request/response objects.

.listFollowers(params)

Lists the users that follow the specified user.

javascript
api.listFollowers({
  user_id: '',
  max_time: Math.floor(new Date().getTime() / 1000),
})
  .then(res => console.log(res.data.followers))
  .catch(console.log);

// Outputs:
// [{ unique_id: 'follower1' }, { unique_id: 'follower2' }, ...]

See the follower types for the complete request/response objects.

.listFollowing(params)

Lists the users that the specified user follows.

javascript
api.listFollowing({
  user_id: '',
  max_time: Math.floor(new Date().getTime() / 1000),
})
  .then(res => console.log(res.data.followings))
  .catch(console.log);

// Outputs:
// [{ unique_id: 'following1' }, { unique_id: 'following2' }, ...]

See the following types for the complete request/response objects.

.follow(id)

Follows a user.

javascript
api.follow('')
  .then(res => console.log(res.data.follow_status))
  .catch(console.log);

// Outputs:
// 1

See the follow types for the response data.

.unfollow(id)

Stops following a user.

javascript
api.unfollow('')
  .then(res => console.log(res.data.follow_status))
  .catch(console.log);

// Outputs:
// 0

See the follow types for the response data.

.listReceivedFollowRequests(params)

Lists the users that have requested to follow the logged in user.

javascript
api.listReceivedFollowRequests({
  max_time: Math.floor(new Date().getTime() / 1000),
  count: 10,
})
  .then(res => console.log(res.data.request_users))
  .catch(console.log);

// Outputs:
// [{ unique_id: 'user1' }, { unique_id: 'user2' }, ...]

See the follow types for the complete request/response objects.

.approveFollowRequest(id)

Approves a user's request to follow you.

javascript
api.approveFollowRequest('')
  .then(res => console.log(res.data.approve_status))
  .catch(console.log);

// Outputs:
// 0

See the follow types for the response data.

.rejectFollowRequest(id)

Rejects a user's request to follow you.

javascript
api.rejectFollowRequest('')
  .then(res => console.log(res.data.reject_status))
  .catch(console.log);

// Outputs:
// 0

See the follow types for the response data.

.likePost(id)

Likes a post.

javascript
api.likePost('')
  .then(res => console.log(res.data.is_digg))
  .catch(console.log);

// Outputs:
// 1

.unlikePost(id)

Unlikes a post.

javascript
api.unlikePost('')
  .then(res => console.log(res.data.is_digg))
  .catch(console.log);

// Outputs:
// 0

.listComments(params)

Lists comments for a post.

javascript
api.listComments({
  aweme_id: '',
  cursor: 0,
})
  .then(res => console.log(res.data.comments))
  .catch(console.log);

// Outputs:
// [{ text: 'first!', user: {...} }, { text: 'second!', user: {...} }, ...]

See the comment types for the response data.

.postComment(postId, text, [tags])

Comments on a post.

javascript
api.postComment('', 'first!')
  .then(res => console.log(res.data.comment))
  .catch(console.log);

// Outputs:
// { cid: '', text: 'first!', user: {...}, ... }

See the comment types for the response data.

.listCategories(params)

Lists popular categories/hashtags.

javascript
api.listCategories({
  count: 10,
  cursor: 0,
})
  .then(res => console.log(res.data.category_list))
  .catch(console.log);

// Outputs:
// [{ { challenge_info: { cha_name: 'posechallenge', cid: '123' }, desc: 'Trending Hashtag' }, ...]

See the category types for the complete request/response objects.

.searchHashtags(params)

Searches for hashtags.

javascript
api.searchHashtags({
  keyword: 'example',
  count: 10,
  cursor: 0,
})
  .then(res => console.log(res.data.challenge_list))
  .catch(console.log);

// Outputs:
// [{ challenge_info: {...}, position: [] }, ...]

See the search types for the complete request/response objects.

.listPostsInHashtag(params)

Lists posts in a hashtag.

javascript
api.listPostsInHashtag({
  ch_id: '',
})
  .then(res => console.log(res.data.aweme_list))
  .catch(console.log);

// Outputs:
// [{ author: {...}, aweme_id: '999', desc: 'description', music: {...}, statistics: {...}, video: {...} }, ...]

See the hashtag types for the complete request/response objects.

.listForYouFeed([params])

Lists posts in the For You feed.

javascript
api.listForYouFeed()
  .then(res => console.log(res.data.aweme_list))
  .catch(console.log);

// Outputs:
// [{ author: {...}, aweme_id: '999', desc: 'description', music: {...}, statistics: {...}, video: {...} }, ...]

See the feed types for the complete request/response objects.

.listFollowingFeed([params])

Lists posts in the Following feed.

javascript
api.listFollowingFeed()
  .then(res => console.log(res.data.aweme_list))
  .catch(console.log);

// Outputs:
// [{ author: {...}, aweme_id: '999', desc: 'description', music: {...}, statistics: {...}, video: {...} }, ...]

See the feed types for the complete request/response objects.

.getSticker(id)

Gets information about a sticker/effect.

javascript
api.getSticker('')
  .then(res => console.log(res.data.sticker_infos))
  .catch(console.log);

// Outputs:
// [{ id: '100000', name: 'cloned', owner_nickname: 'Effect Assistant', ...}]

See the sticker types for the complete response object.

.getStickers([ids])

Gets information about many stickers/effects.

javascript
api.getStickers(['', ''])
  .then(res => console.log(res.data.sticker_infos))
  .catch(console.log);

// Outputs:
// [{ id: '100000', name: 'cloned', owner_nickname: 'Effect Assistant', ...}, ...]

See the sticker types for the complete response object.

.listPostsBySticker(params)

Lists posts that use a sticker/effect.

javascript
api.listPostsBySticker({
  count: 20,
  cursor: 0,
  sticker_id: '100000',
})
  .then(res => console.log(res.data.aweme_list))
  .catch(console.log);

// Outputs:
// [{ author: {...}, aweme_id: '999', desc: 'description', music: {...}, statistics: {...}, video: {...} }, ...]

See the sticker types for the complete request/response object.

.joinLiveStream(id)

Joins a live stream.

The rtmp_pull_url value can be used with VLC's Open Network Stream option.

javascript
api.joinLiveStream('')
  .then(res => console.log(res.data.room))
  .catch(console.log);

// Outputs:
// { create_time: 1000000000, owner: {...}, stream_url: {...}, title: 'Example', user_count: 1000, ... }

See the live stream types for the response data.

.leaveLiveStream(id)

Leaves a live stream.

javascript
api.leaveLiveStream('')
  .then(res => console.log(res.data.status_code))
  .catch(console

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScriptlivelymusicallytiktok

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言