App Logo

Official scripts

Explore our curated collection of scripts

tiktok.com

Save (Favourite) TikTok Video

Adds a public TikTok video to this account's Favourites. Idempotent — already-saved videos are reported, not re-saved.

tiktok.com

Search TikTok videos

Search TikTok videos by keyword, newest-relevance order, up to `count`.

tiktok.com

Like a TikTok video

Like a TikTok video (as the logged-in account) by URL or id. Safe to repeat: it does nothing if you already liked it.

tiktok.com

TikTok whoami (signed-in account)

Report which TikTok account this browser is signed in as: the @username, nickname and user id. Being signed out is reported as a normal answer (loggedIn false), not an error, so it can be used to check a session before running other TikTok scripts.

tiktok.com

Follow a TikTok user

Follow a TikTok user (as the logged-in account) by @username. Safe to repeat: it does nothing if you already follow them.

tiktok.com

Unlike a TikTok video

Remove your like from a TikTok video (as the logged-in account) by URL or id. Safe to repeat: it does nothing if you haven't liked it.

tiktok.com

TikTok login (Google SSO)

Log into TikTok with Continue with Google, picking the given Google account in Google's sign-in window. Returns straight away if already signed in, and reports the TikTok @username that is signed in. Needs a browser that is already signed in to that Google account, and the Google account must already be linked to a TikTok account.

tiktok.com

Like TikTok Comment

Likes a top-level comment on a public TikTok video, matched by its exact text. Idempotent — already-liked comments are reported, not re-liked.

tiktok.com

Get TikTok profile

Get a TikTok user's profile (bio, stats, verified, secUid) by @username.

tiktok.com

Search TikTok users

Search TikTok accounts by keyword. Returns the top ~10 matches (TikTok web caps user search; not deeply paginable).

tiktok.com

Get TikTok video

Get a TikTok video's caption, stats, author, music, hashtags and metadata by URL or video id.

tiktok.com

Get TikTok video comments

List the top-level comments on a TikTok video, given its URL or id, in newest-relevance order.

tiktok.com

Unfollow a TikTok user

Unfollow a TikTok user (as the logged-in account) by @username. Safe to repeat: it does nothing if you don't follow them.

tiktok.com

Get TikTok related videos

Get the “you may like” related-video recommendations shown next to a TikTok video (a single ~12-item snapshot, not a paginable list).

tiktok.com

Get TikTok search suggestions

Get TikTok's search autocomplete suggestions for a query (the dropdown TikTok shows as you type). Some suggestions are hashtags (marked isHashtag) — pipe those into get_hashtag_info for stats. TikTok web has no hashtag-search results page, so this autocomplete is the only keyword-to-hashtag discovery surface.

tiktok.com

Get TikTok user videos

List a TikTok user's videos (newest first) by @username, up to `count`.

tiktok.com

Get TikTok user reposts

List the videos a TikTok user has reposted (from their Reposts tab), by @username, up to `count`.

tiktok.com

Post photos to TikTok

Publish a photo post with a caption on the signed-in TikTok account, through TikTok Studio. Runs in practice mode by default: it uploads the image and fills the caption, then stops before Post. Pass dryRun:false to publish for real; it then re-reads your profile and returns the new post's id and URL. Posting is public and immediate, so show the exact image and caption to the person and get their confirmation first. Use the delete-post script to remove it.

tiktok.com

Get TikTok sound/music videos

List videos that use a given TikTok sound, by music id, up to `count`.

tiktok.com

Download TikTok video (mp4)

Download a TikTok video's mp4 bytes by URL or id, returned as base64 (caller decodes to a file). Pick a quality to control size.

tiktok.com

Delete a TikTok post

Delete one of your own TikTok posts (video or photo), given its URL or id, from the TikTok Studio posts list. Runs in practice mode by default: it finds the post and opens its Delete option, then stops. Pass dryRun:false to delete for real; it confirms the dialog, then reloads the list to prove the post is gone. If the post isn't in your list, it reports alreadyAbsent instead of failing, so repeating it is safe. TikTok keeps deleted posts in Recently deleted for 30 days.

tiktok.com

Switch TikTok display language

Change the logged-in TikTok account's display language via the account menu (More > Language), given the language's own native name (e.g. "Français", "Deutsch", "English (US)", "Italiano", "Español") as shown in TikTok's own language picker. Returns the resulting page language code so the caller can confirm the switch took effect.

tiktok.com

Get TikTok comment replies

List the replies to a TikTok comment, given the parent comment id and the video id.

tiktok.com

Get TikTok music info

Get a TikTok sound's metadata by music id: title, author, duration, video count, original/commercial flags, cover and play URL. Complements get_music_videos (which lists the videos using the sound).

tiktok.com

Get TikTok post analytics

Read the TikTok Studio analytics for one of your own posts (video or photo), given its URL or id. Returns views, likes, comments, shares, saves, total play time, average watch time, finish rate, new followers and traffic sources (For You, Follow, Search…). Metrics TikTok hasn't computed yet (it needs more views) come back as null. Read-only. It fails with a clear error if the post isn't on the signed-in account.