# TikTok Ultimate Scraper (`khnaami/actor-tiktok-scraper`) Actor

Scrape TikTok videos with direct play links, photo slideshows, creator verified emails, trending sounds, comments, and hashtag search without login.

- **URL**: https://apify.com/khnaami/actor-tiktok-scraper.md
- **Developed by:** [khalid naami](https://apify.com/khnaami) (community)
- **Features:** Limited permissions
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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 Ultimate All-in-One Scraper (Enterprise Edition)

The most comprehensive, high-speed, and stealthy **TikTok Intelligence & Data Scraper** on Apify.\
Built with **JavaScript (Node.js), Crawlee, and Playwright**, featuring automatic Rehydration JSON state extraction, **Photo Slideshows (Photo Reels) extraction**, and full B2B Lead discovery.

***

### 🌟 Modules & Features Supported

1. **Profiles & Influencer Leads**: Nickname, @username, verified badge, followers count, following count, total hearts/likes count, total videos, bio, external link, **direct business email and phone number extraction**.
2. **Standard Videos**: Direct video play URLs, cover thumbnails, views (`playCount`), likes (`diggCount`), comments count, share count, and collect/save count.
3. **Photo Slideshows (TikTok Photo Reels)**: Full carousel of high-definition photo URLs in multi-image TikTok posts.
4. **Comments & Replies**: Comment text, author handles, timestamps, and comment like counts.
5. **Sounds & Trending Music**: Music track title, artist name, and original audio indicators.
6. **Hashtags & Challenges**: Total hashtag view volume and grid of top videos.
7. **Keyword Search**: Discovers trending videos and creators by keyword queries.

***

### 📥 Input Configuration

| Parameter | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `scrapeMode` | Select | `"AUTO_DETECT"` | Options: `AUTO_DETECT`, `PROFILES`, `VIDEOS`, `PHOTO_SLIDES`, `COMMENTS`, `MUSIC_SOUNDS`, `HASHTAGS`, `KEYWORD_SEARCH`, `TIKTOK_SHOP`, `LIVE_METADATA`. |
| `targetUrls` | Array | Required | Profile links, video links, photo slides, or handles (e.g. `https://www.tiktok.com/@tiktok`). |
| `searchKeywords` | Array | `[]` | Keywords or hashtags to search. |
| `maxItems` | Integer | `20` | Maximum items to extract. |
| `maxCommentsPerVideo` | Integer | `15` | Max comments per video. |
| `extractEmailAndPhone` | Boolean | `true` | Extract emails and phone numbers from bios. |
| `proxyConfiguration` | Object | `RESIDENTIAL` | Apify Residential Proxy configuration. |
| `customCookies` | String | `""` | Optional TikTok session cookies (`sessionid`, `ttwid`). |

***

### 📤 Sample Output (Photo Slideshow Reel)

```json
{
  "type": "PHOTO_SLIDES",
  "url": "https://www.tiktok.com/@creator/video/...",
  "id": "7420000000000000000",
  "desc": "Check out these 5 aesthetic photography spots! #photography #travel",
  "isPhotoSlide": true,
  "photoUrls": [
    "https://p16-sign.tiktokcdn-us.com/tos-useast5...jpg",
    "https://p16-sign.tiktokcdn-us.com/tos-useast5...jpg",
    "https://p16-sign.tiktokcdn-us.com/tos-useast5...jpg"
  ],
  "authorUsername": "creator",
  "playCount": 450000,
  "diggCount": 38000,
  "commentCount": 850,
  "musicTitle": "Original Sound - Creator",
  "scrapedAt": "2026-10-09T09:55:00.000Z"
}
```

***

### 🛡️ Anti-Block & Compliance

- Automatic dismissal of login overlays & app installation prompts.
- Emulates Chrome desktop browser client headers.
- Uses Residential Proxy rotation by default.

***

### 📄 License

Apache-2.0

# Actor input Schema

## `scrapeMode` (type: `string`):

Select the TikTok data module, or choose AUTO_DETECT to automatically identify each URL type. Selecting VIDEOS or PHOTO_SLIDES on a profile, hashtag, sound, or search URL extracts matching items from that feed.

## `targetUrls` (type: `array`):

Profiles, video URLs, photo slides, or handles (e.g. https://www.tiktok.com/@tiktok, @khaby.lame, or https://www.tiktok.com/@.../video/...).

## `searchKeywords` (type: `array`):

Keywords to search on TikTok (e.g. 'e-commerce products', 'travel vlog', 'fitness routine').

## `maxItems` (type: `integer`):

Maximum number of videos, photo slides, or search results to extract.

## `maxCommentsPerVideo` (type: `integer`):

Maximum comments to extract per video.

## `extractEmailAndPhone` (type: `boolean`):

Automatically parses user bios to extract business emails and phone numbers.

## `proxyConfiguration` (type: `object`):

Apify Proxy settings. Residential proxies are recommended for TikTok to prevent captcha challenges.

## `customCookies` (type: `string`):

Optional TikTok cookies (JSON array or 'sessionid=...; ttwid=...' format) for scraping restricted regions or logged-in data.

## Actor input object example

```json
{
  "scrapeMode": "AUTO_DETECT",
  "targetUrls": [
    {
      "url": "https://www.tiktok.com/@tiktok"
    },
    {
      "url": "https://www.tiktok.com/tag/viral"
    }
  ],
  "searchKeywords": [],
  "maxItems": 20,
  "maxCommentsPerVideo": 15,
  "extractEmailAndPhone": true,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `results` (type: `string`):

Scraped TikTok records (Profiles, Videos, Photo Slideshows, Comments, Sounds, Hashtags, Shop Items)

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

High-level summary report and execution metrics stored in 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 = {
    "targetUrls": [
        {
            "url": "https://www.tiktok.com/@tiktok"
        },
        {
            "url": "https://www.tiktok.com/tag/viral"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("khnaami/actor-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 = { "targetUrls": [
        { "url": "https://www.tiktok.com/@tiktok" },
        { "url": "https://www.tiktok.com/tag/viral" },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("khnaami/actor-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 '{
  "targetUrls": [
    {
      "url": "https://www.tiktok.com/@tiktok"
    },
    {
      "url": "https://www.tiktok.com/tag/viral"
    }
  ]
}' |
apify call khnaami/actor-tiktok-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,khnaami/actor-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/7kBJboR61HGKLHP2p/builds/mFnjcPddi5m91j05l/openapi.json
