# TikTok Video Discovery Engine (`badruddeen/tiktok-video-discovery-engine`) Actor

Discover related TikTok videos using any public video URL.
Provide a TikTok video link and get recommended videos and creators from TikTok’s discovery feed. Ideal for content discovery, niche research, and competitor analysis.

- **URL**: https://apify.com/badruddeen/tiktok-video-discovery-engine.md
- **Developed by:** [Badruddeen Naseem](https://apify.com/badruddeen) (community)
- **Categories:** Videos, Social media, Developer tools
- **Features:** Limited permissions
- **Stats:** 12 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $30.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 Video Discovery Engine

**Description:**\
Discover related TikTok videos using any public video URL. Provide a TikTok video link and get recommended videos and creators from TikTok’s discovery feed. Ideal for content discovery, niche research, and competitor analysis.

***

### Features

- Scrape related TikTok videos from a single video URL.
- Extract metadata including likes, comments, shares, bookmarks, views, hashtags, music, and more.
- Dynamic crawling with concurrency support for faster scraping.
- Session pool to reuse IPs and avoid frequent proxy rotations.
- Works with Apify Proxy or custom proxies.
- Fully asynchronous and fault-tolerant with retries.

***

### Input

Provide a JSON object to the actor:

```json
{
  "profileUrl": "https://www.tiktok.com/@username/video/1234567890123456789",
  "maxVideos": 10,
  "proxy": {
    "groups": ["RESIDENTIAL"],
    "countryCode": "US"
  }
}
```

***

### Input Fields

| Field        | Type    | Required | Description                                                      |
| ------------ | ------- | -------- | ---------------------------------------------------------------- |
| `profileUrl` | string  | ✅        | TikTok video URL to start crawling from. Must include `/video/`. |
| `maxVideos`  | integer | ❌        | Maximum number of related videos to scrape (default `10`).       |
| `proxy`      | object  | ❌        | Proxy configuration. Defaults to Apify Residential US proxy.     |

***

### Output

The actor produces a flat array of objects with the following structure:

```json
[
  {
    "seedVideoUrl": "https://www.tiktok.com/@username/video/1234567890123456789",
    "seedUsername": "username",
    "relatedVideoUrl": "https://www.tiktok.com/@creator/video/9876543210987654321",
    "relatedCreator": "creator",
    "relatedScrapedAt": "2026-02-03T02:55:00.000Z",
    "authorHandle": "creator",
    "authorName": "Creator Name",
    "description": "Video description",
    "hashtags": ["#funny", "#dance"],
    "likes": 1234,
    "comments": 56,
    "shares": 78,
    "bookmarks": 9,
    "views": 10000,
    "music": "Song Name",
    "pageTitle": "TikTok Page Title",
    "metadataScrapedAt": "2026-02-03T02:55:00.000Z"
  }
]
```

***

### Demo Video

[![Demo](https://i.imgur.com/EoIzKB8.png)](https://i.imgur.com/HlUixta.mp4)

***

### How It Works

Crawl Related Videos

The crawler navigates to the provided TikTok video URL using PlaywrightCrawler.

Extracts links to related videos from TikTok’s discovery feed.

Ensures unique creators and avoids duplicates.

### Fetch Metadata

Calls the secondary actor badruddeen/tiktok-video-insights-extractor for detailed stats.

Retrieves likes, comments, shares, bookmarks, views, hashtags, music, and more.

Flatten Results

Combines the related video info and metadata into a single output array.

***

### Configuration Tips

Concurrency:
maxConcurrency: 3 – up to 3 pages can be scraped in parallel. Adjust carefully to avoid TikTok rate limits.

Session Pool:
Sessions last up to 3600 seconds. Avoid persistState to reduce session conflicts and blocks.

Retries & Timeout:
Each request retries up to 5 times (maxRequestRetries: 5) and allows 300 seconds (requestHandlerTimeoutSecs: 300) to handle slow responses.

***

### Installation & Running Locally

```
git clone <repo_url>
cd tiktok-video-discovery-engine
npm install
```

#### Run locally with:

```
APIFY_TOKEN=<your_token> node src/main.js
```

\*\* Or deploy as an Apify actor and provide input via the web interface. \*\*

***

### Pricing Notes

Each result represents **one fully enriched TikTok video**, including:

- Engagement metrics (likes, bookmarks, comments, shares, views)
- Creator information
- Hashtags & music metadata
- Discovery context

This actor uses **real browser automation and residential proxies**, which ensures high accuracy and reliability, but also incurs higher operational costs.

#### In test mode, the actor runs in validation mode and does not scrape real TikTok data.

# Actor input Schema

## `testMode` (type: `boolean`):

Internal fast-run mode used for automated validation.

## `runFullPipeline` (type: `boolean`):

If enabled, the actor will also fetch detailed statistics (likes, views, comments, shares, etc.) for each discovered video. This increases runtime.

## `profileUrl` (type: `string`):

Paste any public TikTok video URL to discover related videos from TikTok’s discovery feed (e.g. https://www.tiktok.com/@overtime/video/7576031263010737422).

## `maxVideos` (type: `number`):

Maximum number of related videos to discover from the seed video.

## Actor input object example

```json
{
  "testMode": true,
  "runFullPipeline": false,
  "profileUrl": "https://www.tiktok.com/@overtime/video/7576031263010737422",
  "maxVideos": 1
}
```

# Actor output Schema

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

No description

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("badruddeen/tiktok-video-discovery-engine").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("badruddeen/tiktok-video-discovery-engine").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 '{}' |
apify call badruddeen/tiktok-video-discovery-engine --silent --output-dataset

```

## MCP server setup

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

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/RDakiPYfSAaq1W6gj/builds/55UtTY6y1ikG56MVl/openapi.json
