🎵 TikTok Explorer avatar

🎵 TikTok Explorer

Try for free

7 days trial then $30.00/month - No credit card required now

View all Actors
🎵 TikTok Explorer

🎵 TikTok Explorer

jupri/tiktok
Try for free

7 days trial then $30.00/month - No credit card required now

Explore TikTok.com

Welcome to TikTok Scraper

dont be sad readme is here

🎵 About TikTok.com

TikTok, whose mainland Chinese counterpart is Douyin,[a][3] is a short-form video hosting service owned by Chinese internet company ByteDance. It hosts user-submitted videos, which can range in duration from three seconds to 10 minutes.[4] It can be accessed with a smart phone app.

Since its launch, TikTok has become one of the world's most popular social media platforms, using recommendation algorithms that were better than alternative apps at connecting content creators with new audiences.[5] Many of its users are young, of Generation Z. In April 2020, TikTok surpassed two billion mobile downloads worldwide.[6] Cloudflare ranked TikTok the most popular website of 2021, surpassing Google.[7] The popularity of TikTok has allowed viral trends in food and music to take off and increase the platform's cultural impact worldwide.[8]

🎵 About This Actor

All-in-One general purpose TikTok Scraper

Features :

  • ⭐search videos, users, live.
  • ⭐search by hashtag.
  • ⭐search by place.
  • ⭐search music.
  • ⭐access user specific data: info, followers, following, videos, playlist (mix)
  • ⭐autodetect tiktok.com URL (aka. Starting URL) input.
  • ⭐minimal inputs.
  • ⭐directly open media/video/music URLs (via browser/cookie synchronize) or download individual video (watermarked or unwatermarked) to key-value storage.
  • ⭐directly access tiktok.com web internal API, no browser emulation, fast and small memory usage.
  • ⭐multiple queries in single request.
  • ⭐small docker file size (only 100 mb), fast loading.

🎵 IMPORTANT NOTES

To be able to view media file URLs (covers, videos, etc.), you need to synchronize your browser's Internal Values (cookies) with this Actor, Otherwise, you won’t be able to open the media URLs provided by the Actor results. There are 3 cookies needed from tiktok.com domain :

  • 🆔ttwid
  • 🆔tt_chain_token
  • 🆔tt_csrf_token

This process doesn't requires your login info. You can first Log Out from TikTok if you want or use new fresh Chrome Incognito window.

Please visit https://www.tiktok.com and find these 3 cookie values from your browser (device) and copy paste here:

Advanced Options

enter image description here

🎵 Video Download

To open video URLs directly from your browser, you can synchronize your browser with the Actor (recommended, see above), or download individual video to default Key-Value storage.

example:

{ "query": ["7112413115530104090/download"] }

The resulting data will same as normal, except link to video URL will be replaced with link to Key-Value storage URLs.

example:

1{
2	"id": "7112413115530104090",
3	...
4    "video": {
5	    # watermarked
6        "downloadAddr": "https://api.apify.com/v2/key-value-stores/...",
7        ...
8        # no-watermarked
9        "playAddr": "https://api.apify.com/v2/key-value-stores/...",
10    }
11    ...
12}

🎵 Quick Guide

TikTok Query Language

[ [ <COMMAND:> | # | @ ] [ <NAME> | <ID> | <KEYWORD> ] [ / <SECTION> ] | <URL> ]

Possible Query Values

FormatExamplesDescription
KEYWORDSsearch termsSearch anything
top:KEYWORDStop:square pantsSearch TOP contents
users:KEYWORDSusers:joefreeSearch users
videos:KEYWORDSvideos:yellow catSearch videos
music:KEYWORDSmusic:sundaSearch music
live:KEYWORDSlive:cat showSearch live
EXPLOREExplore Categories
:homeexplore:homeExplore Home
:CATEGORY_IDexplore:119Explore video by category ID
:CATEGORY_NAMEexplore:comedyExplore video by category name
#HASHTAG#musicExploring Hashtag (Challenge)
/info#music/infoHashtag info and stats
/videos#music/videosHashtag videos
@USER@elonmuskScraping User Info
/info@elonmusk/infoUser info
/videos@elonmusk/videosUser videos
/reposts@elonmusk/repostsUser reposts videos
/liked@elonmusk/likedUser liked videos
/playlist@elonmusk/playlistUser playlist
/following@elonmusk/followingUser following
/followers@elonmusk/followersUser followers
/suggested@elonmusk/suggestedSuggested users
VIDEO_ID7112413115530104090Scraping Video Data
/info7112413115530104090/infoVideo info
/comments7112413115530104090/commentsVideo comments
/related7112413115530104090/relatedRelated videos
/download7112413115530104090/downloadDownload videos
playlist:PLAYLIST_IDUser Playlist (Mix)
playlist:PLAYLIST_IDplaylist:XXXXXXXXXXXXXXPlaylist videos (see: @user/playlist)
channel:CHANNEL_IDExploring Channels
channel:CHANNEL_IDchannel:food_and_drinkChannel videos
music:MUSIC_IDScraping Music Data
/infomusic:7112413142386297627/infoMusic info
/videosmusic:7112413142386297627/videosVideos using this music
place:PLACE_IDScraping a Place Related Videos
/infoplace:22535865204947327/infoPlace info (Boston)
/videosplace:22535865204947327/videosVideos related to place
https:URLhttps://www.tiktok.comStarting URL
/search?q=<KEYWORD>top:KEYWORD or only KEYWORD
/search/video?q=<KEYWORD>video:KEYWORD
/search/user?q=<KEYWORD>user:KEYWORD
/search/live?q=<KEYWORD>live:KEYWORD
/tag/<HASHTAG>#HASHTAG
/place/place-name-<PLACE_ID>place:PLACE_ID
/music/music-name-<MUSIC_ID>music:MUSIC_ID
/channel/<CHANNEL_NAME>channel:CHANNEL_NAME
/<USERNAME>@USERNAME
/<USERNAME>/video/<VIDEO_ID>VIDEO_ID
/exploreexplore:CATEGORY_ID_OR_NAME

Category List

QUERY explore:CATEGORY_ID_OR_NAME

IDNameDescription
100anime_comicsAnime & Comics
101showsShows
102beauty_careBeauty Care
103gamesGames
104comedyComedy
105daily_lifeDaily Life
106familyFamily
107relationshipRelationship
108dramaDrama
109outfitOutfit
110lipsyncLipsync
111foodFood
112sportsSports
113animalsAnimals
114societySociety
115carsCars
116educationEducation
117fitness_healthFitness & Health
118technologyTechnology
119singing_dancingSinging & Dancing

🎵 Tutorial

Running Actor via JavaScript Fetch :

TODO: Apify Platform should have example on how to run actor using JS Fetch

1const APIFY_TOKEN = "YOUR_APIFY_TOKEN"
2
3var run_inputs  = {"query": ["square pants"], "limit": 50}
4var url = "https://api.apify.com/v2/acts/"
5	+ "jupri~tiktok/run-sync-get-dataset-items?token=" 
6	+ APIFY_TOKEN
7
8var headers     = { "content-type": "application/json" }
9var options     = { method: "POST", headers, body: JSON.stringify(run_inputs) }
10
11var response = await fetch(url, options).then(res => res.json())

Example #1: Searching for Video

{ "query": ["square pants"], "limit": 50 }

Example #2: Searching on Category

1# category by id (104 for "Comedy")	
2{ "query": ["explore:104"], "limit": 50 }
3
4# category by name
5{ "query": ["explore:comedy"], "limit": 50 }

Example #3: Searching for #hashtag

1# hastag videos
2{ "query": ["#music"], "limit": 50 }
3
4# hastag info (statistics)
5{ "query": ["#music/info"] }

Example #4: User Info

1# user videos
2{ "query": ["@elonmusk"], "limit": 50 }			
3{ "query": ["@elonmusk/videos"], "limit": 50 }
4
5# user info (statistics)
6{ "query": ["@elonmusk/info"] }

Example #5: Multiple Queries

Warning: This is just an example. Different query may have different fields/attributes set. When you request multiple queries, makes sure all have same type of query.

1{ 
2	# different type of query is OK, but not recommended!
3	"query": [
4		"square pants",
5		"explore:comedy",
6		"#music/info",
7		"#music",
8		"@elonmusk/info",
9		"@elonmusk/videos"
10	], 
11	"limit": 50 # limit per query
12}

Other Examples

... almmost there (just follow your insting for now) ...

🎵 ToolTips

❓QUERY :

FormatSection / CommandsExample
KEYWORDStop: users: videos: music: live:videos:square pants
explore:home CATEGORY_ID CATEGORY_NAMEexplore:comedy
#HASHTAG/info /videos#music/videos
@USER/info /videos /playlist /following /followers@elonmusk/videos
VIDEO_ID/info /comments /related /download7112413115530104090/comments
playlist:PLAYLIST_IDplaylist:XXXXXXXXXXXXXX
channel:CHANNEL_IDchannel:dance
music:MUSIC_ID/info /videosmusic:7112413142386297627/videos
place:PLACE_ID/info /videosplace:22535865204947327/videos
URLhttps://www.tiktok.com/search?q=square pants
Developer
Maintained by Community
Actor metrics
  • 5 monthly users
  • 2 stars
  • 90.6% runs succeeded
  • Created in May 2024
  • Modified 4 months ago