# TikTok Scraper (`codenest/tiktok-scraper`) Actor

Input hashtags, video URLs, or profile URLs with configurable video and comment limits. Outputs full video data: download URLs, likes, comments, shares, saves, plays, hashtags, music info, plus profile stats and mined comments with authors and engagement.

- **URL**: https://apify.com/codenest/tiktok-scraper.md
- **Developed by:** [CodeNest](https://apify.com/codenest) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 scraped tiktok videos

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## 🎵 TikTok Scraper - Ultimate Video, Profile & Hashtag Data Extractor

**Effortlessly scrape TikTok videos, profiles, hashtags, and comments with our powerful **TikTok Scraper**! This Apify actor enables bulk extraction of video data, profile analytics, hashtag discovery, and comment mining.**

***

### 📋 Overview

Need to analyze viral TikTok trends, build influencer databases, or mine engagement data? This **TikTok Scraper** delivers:

- 🎬 **Video Data Extraction** - Complete video metadata, download URLs, and engagement metrics
- 👤 **Profile Scraping** - Full profile analytics including followers, hearts, and video counts
- 🔥 **Hashtag Discovery** - Scrape videos by hashtag with configurable limits
- 💬 **Comment Mining** - Extract comments with likes, replies, and author info
- 🎵 **Music Metadata** - Sound/music details including play URLs and durations

Perfect for social media marketers 📈, content creators 🎭, trend analysts 📊, and data researchers 🔬!

***

### ⭐ Core Capabilities of TikTok Scraper

#### 🎬 Video Extraction

- **Complete Video Metadata** - Titles, durations, and upload timestamps
- **Download URLs** - Direct video download links (multiple formats)
- **Engagement Metrics** - Likes, comments, shares, saves, and play counts
- **Thumbnail Extraction** - High-quality video thumbnails
- **Hashtag Detection** - Extracted hashtags from video titles
- **Mention Detection** - Extracted @mentions from titles

#### 👤 Profile Data Mastery

- **Complete Profile Info** - Username, nickname, and signature/bio
- **Follower Statistics** - Followers, following, hearts, and video counts
- **Verification Status** - Detect verified accounts
- **Bio Link Extraction** - External URL from profile
- **Account Type Detection** - Private, organization, commerce, and seller flags
- **Friend & Digg Counts** - Social interaction metrics

#### 🔥 Hashtag Scraping

- **Multi-Hashtag Support** - Scrape videos from multiple hashtags
- **Configurable Limits** - Set max videos per hashtag
- **Trend Discovery** - Find viral content by hashtag
- **Cross-Hashtag Analysis** - Compare performance across hashtags

#### 💬 Comment Mining

- **Comment Extraction** - Full comment text and metadata
- **Engagement Metrics** - Comment likes and reply counts
- **Author Information** - Commenter usernames, nicknames, and avatars
- **Timestamps** - Comment creation dates
- **Configurable Limits** - Set max comments per video

#### 🎵 Music Metadata

- **Sound Information** - Music/sound ID, title, and author
- **Play URLs** - Direct audio playback links
- **Duration Detection** - Sound duration in seconds

***

### ⚙️ Input Configuration

Simply enter hashtags, video URLs, or profile URLs, configure limits, and click "Start". Input looks like this:

```json
{
  "hashtags": [
    "viral",
    "video"
  ],
  "max_videos_per_hashtag": 50,
  "max_videos_per_profile": 50,
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  },
  "scrape_comments": true,
  "scrape_profile_videos": true,
  "video_urls": [
    {
      "url": "https://www.tiktok.com/@md.sayed9096/video/7682293503098948882?is_from_webapp=1&sender_device=pc"
    },
    {
      "profile url": "https://www.tiktok.com/@tupon_drama"
    }
  ],
  "max_comments": 50
}
```

#### 📝 Input Specifications

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `hashtags` | Array | ❌ No | \[] | Hashtags to scrape videos from |
| `video_urls` | Array | ❌ No | \[] | Video URLs or profile URLs to scrape |
| `max_videos_per_hashtag` | Integer | ❌ No | 50 | Max videos per hashtag |
| `max_videos_per_profile` | Integer | ❌ No | 50 | Max videos per profile |
| `max_comments` | Integer | ❌ No | 50 | Max comments per video |
| `scrape_comments` | Boolean | ❌ No | true | Enable comment extraction |
| `scrape_profile_videos` | Boolean | ❌ No | true | Enable profile video scraping |
| `proxy.useApifyProxy` | Boolean | ❌ No | true | Enable Apify proxy |
| `proxy.apifyProxyGroups` | Array | ❌ No | \["RESIDENTIAL"] | Proxy groups |

***

### 📤 Output Structure

Your **TikTok Scraper** produces comprehensive data for profiles, videos, and comments:

#### 👤 Profile Data Output

```json
{
  "type": "profile",
  "source_url": "https://www.tiktok.com/@tupon_drama",
  "id": "7521732984211670023",
  "username": "tupon_drama",
  "nickname": "⎯⃝ TUPON_DRAMA⋆⃝⛎",
  "signature": "নাটক প্রমোশন 35+ Active ID...",
  "bio_link": "https://youtube.com/@tupon_drama",
  "avatar": "https://p16-common-sign.tiktokcdn.com/...",
  "avatar_thumb": "https://p16-common-sign.tiktokcdn.com/...",
  "verified": false,
  "sec_uid": "MS4wLjABAAAAzHk6xWvYhLjjS0oK3jP...",
  "private_account": false,
  "follower_count": 566000,
  "following_count": 4,
  "heart_count": 12800000,
  "video_count": 454,
  "digg_count": 0,
  "friend_count": 11,
  "language": "en",
  "create_time": 1751289963,
  "created_at": "2025-06-30 13:26:03",
  "is_organization": false,
  "commerce_user": false,
  "tt_seller": false
}
```

#### 🎬 Video Data Output

```json
{
  "type": "video",
  "id": "7692695890653383956",
  "source_url": "https://www.tiktok.com/@tupon_drama/video/7692695890653383956",
  "download_url": "https://v16m.tiktokcdn-us.com/...",
  "direct_url": "https://v16m.tiktokcdn-us.com/...",
  "video_url": "https://v16m.tiktokcdn-us.com/...",
  "title": "বিলপে না করেই এখানে আসছে |🖤 #natok_lover #foryou...",
  "duration": 209,
  "uploader": "⎯⃝ TUPON_DRAMA⋆⃝⛎",
  "like_count": 418600,
  "comment_count": 12600,
  "save_count": 61600,
  "share_count": 7725,
  "play_count": 4000000,
  "thumbnail": "https://p19-common-sign.tiktokcdn-us.com/...",
  "hashtags": ["natok_lover", "foryou", "foryoupage", "tupon_drama", "unfrezzmyaccount"],
  "mentions": [],
  "author": {
    "id": "7521732984211670023",
    "username": "tupon_drama",
    "nickname": "⎯⃝ TUPON_DRAMA⋆⃝⛎",
    "avatar": "https://p16-common-sign.tiktokcdn.com/...",
    "verified": false
  },
  "music": {
    "id": "7692695987316083476",
    "title": "original sound - ⎯⃝ TUPON_DRAMA⋆⃝⛎",
    "author": "⎯⃝ TUPON_DRAMA⋆⃝⛎",
    "play_url": "https://v16-webapp-prime.us.tiktok.com/...",
    "duration": 209
  },
  "comments": [
    {
      "id": "7692715161569198900",
      "text": "কোটিপাতি বফ কই পাওয়া যাবে🙂🙏",
      "like_count": 1013,
      "reply_count": 82,
      "create_time": 1791100141,
      "created_at": "2026-10-04 07:49:01",
      "author_username": "nusrat99524015618757",
      "author_nickname": "🐸 7 বেডার বউ ♡🌚👌🔪",
      "author_avatar": "https://p19-common-sign.tiktokcdn-us.com/..."
    }
  ]
}
```

#### 📖 Output Field Documentation

**🔹 Profile Fields**
| Field | Description |
|-------|-------------|
| `type` | Output type ("profile") |
| `id` | TikTok user ID |
| `username` | TikTok handle |
| `nickname` | Display name |
| `signature` | Profile bio/signature |
| `bio_link` | External link from bio |
| `avatar` | Full-size profile picture |
| `avatar_thumb` | Thumbnail profile picture |
| `verified` | Verification status |
| `private_account` | Private account flag |
| `follower_count` | Total followers |
| `following_count` | Total following |
| `heart_count` | Total hearts/likes received |
| `video_count` | Total videos posted |
| `friend_count` | Friend count |
| `language` | Account language |
| `created_at` | Account creation date |
| `is_organization` | Organization account flag |
| `commerce_user` | Commerce account flag |
| `tt_seller` | TikTok Shop seller flag |

**🔹 Video Fields**
| Field | Description |
|-------|-------------|
| `type` | Output type ("video") |
| `id` | TikTok video ID |
| `source_url` | Original video URL |
| `download_url` | Direct download URL |
| `direct_url` | Alternative direct URL |
| `video_url` | Video playback URL |
| `title` | Video title/caption |
| `duration` | Video duration in seconds |
| `uploader` | Uploader nickname |
| `like_count` | Total likes |
| `comment_count` | Total comments |
| `save_count` | Total saves |
| `share_count` | Total shares |
| `play_count` | Total plays/views |
| `thumbnail` | Video thumbnail URL |
| `hashtags` | Extracted hashtags |
| `mentions` | Extracted @mentions |

**🔹 Author Fields**
| Field | Description |
|-------|-------------|
| `author.id` | Author user ID |
| `author.username` | Author handle |
| `author.nickname` | Author display name |
| `author.avatar` | Author profile picture |
| `author.verified` | Author verification status |

**🔹 Music Fields**
| Field | Description |
|-------|-------------|
| `music.id` | Music/sound ID |
| `music.title` | Music title |
| `music.author` | Music author |
| `music.play_url` | Audio playback URL |
| `music.duration` | Audio duration |

**🔹 Comment Fields**
| Field | Description |
|-------|-------------|
| `comments.id` | Comment ID |
| `comments.text` | Comment text |
| `comments.like_count` | Comment likes |
| `comments.reply_count` | Reply count |
| `comments.created_at` | Comment date |
| `comments.author_username` | Commenter handle |
| `comments.author_nickname` | Commenter display name |
| `comments.author_avatar` | Commenter avatar |

***

### 🎨 Key Features of This TikTok Scraper

#### 🎬 Complete Video Intelligence

- **Multiple Download URLs** - Redundant links for reliability
- **Full Engagement Metrics** - Likes, comments, shares, saves, plays
- **Hashtag & Mention Extraction** - Automatic parsing from titles
- **Duration Detection** - Precise video length

#### 👤 Deep Profile Analytics

- **Comprehensive Stats** - Followers, hearts, videos, friends
- **Account Classification** - Organization, commerce, seller flags
- **Bio Link Extraction** - External website links
- **Verification Detection** - Verified account identification

#### 🔥 Hashtag Discovery

- **Multi-Hashtag Scraping** - Process multiple hashtags
- **Trend Analysis** - Find viral content by hashtag
- **Configurable Limits** - Control extraction depth

#### 💬 Comment Mining

- **Full Comment Data** - Text, likes, and replies
- **Author Information** - Usernames, nicknames, avatars
- **Engagement Metrics** - Like and reply counts
- **Temporal Analysis** - Comment timestamps

#### 🎵 Music Metadata

- **Sound Identification** - Music ID and title
- **Play URLs** - Direct audio links
- **Duration Tracking** - Sound length

***

### 💡 Use Cases for TikTok Scraper

- **📈 Social Media Marketing** - Analyze viral trends and competitors
- **🎬 Content Creation** - Research trending content and sounds
- **📊 Influencer Discovery** - Build creator databases
- **🔬 Trend Research** - Study viral patterns and hashtags
- **💰 Brand Partnerships** - Identify potential collaborators
- **📱 Content Strategy** - Analyze top-performing videos
- **🎯 Audience Research** - Understand comment sentiment
- **📋 Market Analysis** - Track industry trends

***

### ✨ Why Choose Our TikTok Scraper?

- **⚡ High Performance** - Concurrent scraping with proxy rotation
- **🎯 100% Accurate** - Preserves all data without alteration
- **📦 Complete Data** - Videos, profiles, comments, and music
- **🔄 Regular Updates** - Adapts to TikTok platform changes
- **🛡️ Production Ready** - Battle-tested with thousands of videos
- **💰 Cost Efficient** - Optimized for minimal compute time
- **🔒 Privacy Focused** - No personal data stored or shared

***

### ⚠️ Limitations

- Only works with public TikTok content
- Private accounts are not accessible
- Download URLs may expire after a certain period
- Rate limits may apply for high-volume scraping
- Comment extraction adds additional processing time

***

### 📧 Need Custom Features for Your TikTok Scraper?

Want **additional data fields**, **specific hashtag filters**, **custom output formats**, **advanced analytics**, or **automated reporting**?

✉️ Email **<codenest2.0@gmail.com>** for tailored enterprise solutions!

***

# Actor input Schema

## `video_urls` (type: `array`):

List of TikTok profile URLs (e.g. https://www.tiktok.com/@hussnain_edits25) or video URLs (e.g. https://www.tiktok.com/@scout2015/video/6718335390845095173).

## `hashtags` (type: `array`):

List of TikTok hashtags to scrape videos from (e.g. 'cat', '#dance', 'comedy' or TikTok tag URLs).

## `scrape_profile_videos` (type: `boolean`):

Turn ON to scrape videos from the given TikTok profiles (up to Max Videos per Profile). Turn OFF to scrape only complete profile metadata and statistics without videos.

## `max_videos_per_profile` (type: `integer`):

Maximum number of videos to scrape from each TikTok profile (e.g. 50, 100). Default is 100.

## `max_videos_per_hashtag` (type: `integer`):

Maximum number of videos to scrape per hashtag (up to 100+ videos supported via automatic pagination).

## `scrape_comments` (type: `boolean`):

Toggle ON to scrape and include video comments in the output. When turned OFF, comments will not be extracted.

## `max_comments` (type: `integer`):

Maximum number of comments to scrape per TikTok video when comments are enabled.

## `proxy` (type: `object`):

Apify Proxy configuration. US Residential proxies are used by default to bypass blocks and IP restrictions.

## Actor input object example

```json
{
  "hashtags": [
    "cat"
  ],
  "scrape_profile_videos": true,
  "max_videos_per_profile": 100,
  "max_videos_per_hashtag": 100,
  "scrape_comments": false,
  "max_comments": 50,
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

Tabular overview of scraped TikTok videos with stats, direct links, and thumbnails.

## `profilesView` (type: `string`):

Scraped TikTok user profiles with follower count, heart count, video count, bio, and avatar.

## `commentsView` (type: `string`):

View of scraped video comments with author details and like counts.

## `allResults` (type: `string`):

Complete dataset containing all profile, video, and hashtag metadata, stats, comments, and media links.

## `outputRecord` (type: `string`):

Consolidated JSON array of all scraped TikTok results stored in the default Key-Value Store.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "hashtags": [
        "cat"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("codenest/tiktok-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "hashtags": ["cat"] }

# Run the Actor and wait for it to finish
run = client.actor("codenest/tiktok-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "hashtags": [
    "cat"
  ]
}' |
apify call codenest/tiktok-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,codenest/tiktok-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/pRMUbMwftnZpgv27J/builds/hdZLL2B2PGGDboK0c/openapi.json
