Scraping TikTok content used to require complex API integrations or browser automation. This command-line scraper simplifies the process—pull videos from users, hashtags, trending feeds, or music IDs with straightforward commands. Whether you're archiving content, analyzing trends, or building datasets, this tool handles bulk downloads and watermark removal without browser overhead.
The tiktok-scraper is a Node.js command-line utility that pulls video metadata and downloads content directly from TikTok. You point it at a username, hashtag, or video URL, and it fetches the data—no GUI, no manual clicking.
Basic Usage Pattern:
$ tiktok-scraper [target] [options]
Instead of opening TikTok in a browser and saving videos one by one, you run a single command and let it grab 50, 100, or however many posts you need.
User Scraping
$ tiktok-scraper user USERNAME -d -n 100
Pulls videos from a specific user's profile. Just enter their username (no @ symbol needed). The -d flag downloads the videos, -n sets the count.
Hashtag Scraping
$ tiktok-scraper hashtag HASHTAG_NAME -d -n 100
Grabs posts tagged with a specific hashtag. Enter the hashtag without the # symbol. Useful for tracking campaigns or trending topics.
Trending Content
$ tiktok-scraper trend -d -n 100
Scrapes whatever's currently trending on TikTok's main feed. No target needed—just run the command.
Music-Based Collection
$ tiktok-scraper music MUSIC_ID -d -n 50
Finds all videos using a particular audio track. You'll need the music ID number from TikTok's URL structure.
Single Video Download
$ tiktok-scraper video https://www.tiktok.com/@tiktok/video/6807491984882765062 -d
Downloads one specific video. Paste the full TikTok URL.
Session Handling
--session sid_tt=dae32131231
TikTok sometimes requires authentication tokens to access certain content. The session flag lets you pass your browser's session cookie. You can also use --session-file to load multiple sessions from a text file.
When dealing with session management at scale or bypassing common access restrictions, tools like 👉 ScraperAPI handle session rotation and anti-bot detection automatically, which can save you from manually updating cookie values every few hours.
Proxy Support
--proxy http://username:password@proxy-server:port
--proxy-file proxies.txt
Route requests through a proxy server. The --proxy-file option randomizes proxies from a list—one per line in your text file.
Rate Limiting
--timeout 1000
Sets milliseconds between requests. 1000 = 1 second. Helps avoid rate limits if you're scraping large batches.
Download Control
--number 0 # Scrape all available posts
--since 1609459200 # Only posts after this timestamp
--asyncDownload 5 # Concurrent download threads
The --number flag with 0 scrapes everything available. The --since option filters by publication date (Unix timestamp). Async downloads speed up bulk operations.
Standard Watermark Removal:
--noWaterMark
Downloads videos without TikTok's watermark overlay. Recent updates include watermark-free URLs by default for user/trend/music feeds. You mainly need this flag for hashtag scraping.
HD Quality:
--hd
Grabs higher resolution versions. File sizes jump 5-10x larger, which slows down the scraper. Only works with the -w watermark flag.
File Formats:
--filetype json # Saves metadata as JSON
--filetype csv # Saves metadata as CSV
--filetype all # Both formats
--filename custom_name # Custom output filename
Storage Location:
--filepath /path/to/save/folder
By default, files save to your current directory. Use --filepath to specify a custom location.
ZIP Compression:
--zip
Automatically compresses all downloaded videos into a single ZIP file after scraping completes.
Enable History:
--store
The scraper maintains a history file in your system's temp folder (or a custom path via --historypath). On subsequent runs, it skips previously downloaded content—useful for ongoing monitoring.
View History:
$ tiktok-scraper history
Delete History Records:
$ tiktok-scraper history -r user:bob # Remove specific user history
$ tiktok-scraper history -r all # Clear everything
$ tiktok-scraper from-file batch.txt 5 -d
Create a text file with one target per line (usernames, hashtags, music IDs, or video URLs). The scraper processes each entry. The 5 sets concurrent async tasks.
Example batch.txt:
user:someusername
hashtag:viral
music:123456789
video:https://www.tiktok.com/@user/video/123
--webHookUrl https://yourapi.com/endpoint
--method POST
Sends scraping results to your own API endpoint as HTTP requests. Useful for integrating with data pipelines or notification systems.
Content Archiving: Download all videos from a creator before they delete their account.
Trend Analysis: Scrape hashtag feeds daily to track how memes spread.
Dataset Building: Collect thousands of videos for machine learning training data.
Competitive Research: Monitor competitor accounts or industry hashtags automatically.
Watermark-Free Backups: Save clean copies of your own content without TikTok branding.
Session Expiry: TikTok sessions don't last forever. If scraping stops working, grab a fresh cookie from your browser.
Rate Limits: Aggressive scraping triggers temporary blocks. Use --timeout and proxies to pace your requests.
HD Performance: The --hd flag significantly slows downloads. Only use it when quality matters more than speed.
Hashtag Watermarks: Despite recent updates, hashtag scraping still needs --noWaterMark for clean videos.
This scraper turns hours of manual downloading into single-command operations. Whether you're building a dataset of 10,000 videos or just backing up a creator's catalog, the tool handles the repetitive work while you focus on what to do with the data.
For larger projects where you're juggling proxies, session management, and rate limits, consider whether building this infrastructure yourself is worth the time versus 👉 using a managed scraping solution that handles the complexity. Sometimes the right tool isn't the one you build—it's the one that lets you skip the setup and get straight to results.