# TrendPilot — TikTok Scraper & Creator Leads (`orbitai/trend-pilot-tiktok-scraper`) Actor

Extract TikTok videos, hashtags, profiles, comments, sounds, and search results with automated lead, viral, and brand fit scoring.

- **URL**: https://apify.com/orbitai/trend-pilot-tiktok-scraper.md
- **Developed by:** [Daniel Lozano](https://apify.com/orbitai) (community)
- **Categories:** Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 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/platform/actors/running/actors-in-store#pay-per-usage

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## TrendPilot — TikTok Scraper & Creator Leads

TrendPilot is a premium, outcome-oriented TikTok scraper and B2B intelligence engine designed for marketing agencies, outbound sales teams, e-commerce operators, and brand managers. 

Unlike generic scrapers that output simple, unstructured text and numbers, TrendPilot packages extraction, B2B data cleaning, and algorithmic scoring to deliver ready-to-use business outcomes.

---

### ⚙️ How It Works

TrendPilot extracts and processes creator leads using a robust 4-step execution pipeline:

1. **Target Ingestion**: The Actor enqueues target search terms, hashtags, or profile URLs based on the selected `runMode`.
2. **Browser-Based Crawling (Playwright & Cheerio)**: In native mode, the crawler opens headless browser instances using Playwright and Crawlee to navigate TikTok pages, bypassing bot detection, and fetches profile bios, hashtag pages, video feeds, and comments.
3. **Data Cleaning & Scrapers Integration**:
   * It extracts contact details (like emails and websites) directly from bio text.
   * If a native request is blocked, TrendPilot automatically queries external fallback actors via the Apify API (`Actor.call`) to guarantee uninterrupted uptime.
4. **Algorithmic Scoring & Storage**: It runs internal scoring models (Virality Score, Lead Score, Creator Score), saves video/cover assets to the Key-Value Store, and outputs cleaned, structured B2B lead objects to the default dataset.

---

### 🚀 Features

- **Guided Run Templates (`runMode`)**:
  * **Creator Lead List**: Isolates profile bios, contact emails, and computes a Lead Score.
  * **Viral Video Report**: Identifies breakout viral content ideas using view-to-follower ratios.
  * **Competitor Monitoring**: Audits brand profile performance and interaction density.
  * **Content Calendar Planner**: Analyzes captions/comments to draft content angles.
- **Proprietary Scoring Models (0-100)**: Virality Score, Creator Score, Brand Fit Score, Lead Score, and Music Momentum.
- **Asset Downloads & Archiving**: Saves MP4 videos, cover JPGs, and avatars natively into the Key-Value Store.
- **Legacy Compatibility Mode**: Auto-maps fields to preserve integrations for migration-safe legacy schemas.

---

### 📝 Input Parameters

- **runMode** (Select, default: `"creatorLeadList"`): Select the target report preset.
- **searchTerms** (Array): Keywords, hashtags, or creator usernames to prospect.
- **maxResults** (Integer, default: `20`): Maximum videos or profiles to scrape.
- **legacyCompatibilityMode** (Boolean, default: `false`): Output fields matching legacy Apify TikTok scraper schemas.
- **saveVideos** (Boolean, default: `false`): Save extracted MP4 video streams to the Key-Value Store.

---

### 📦 Output Format

TrendPilot delivers output structured according to the selected run template:

#### Creator Lead List Preset Output Example
```json
{
  "creatorUsername": "scale_with_growth",
  "creatorNickname": "Growth Consultant",
  "bio": "Scale your agency. Contact: hello@agency.com",
  "followers": 142000,
  "engagementRate": 6.84,
  "email": "hello@agency.com",
  "profileUrl": "https://www.tiktok.com/@scale_with_growth",
  "leadScore": 95
}
````

***

### 🛠 How to Integrate

You can trigger TrendPilot programmatically using the official Apify client libraries:

#### JavaScript/TypeScript Client

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

const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

const input = {
    "runMode": "creatorLeadList",
    "searchTerms": ["#marketingagency"],
    "maxResults": 10
};

const run = await client.actor("orbitai/trend-pilot-tiktok-scraper").call(input);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

#### Python Client

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_API_TOKEN>")

run_input = {
    "runMode": "creatorLeadList",
    "searchTerms": ["#marketingagency"],
    "maxResults": 10
}

run = client.actor("orbitai/trend-pilot-tiktok-scraper").call(run_input=run_input)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

***

### ⚖️ Legal & Compliance

This tool utilizes web scrapers to access publicly available TikTok data. Users are responsible for complying with TikTok's Terms of Service and ensuring that outbound pitches or lead lists compiled using this Actor adhere to local data collection laws and anti-spam regulations (GDPR, CAN-SPAM, CCPA).

# Actor input Schema

## `runMode` (type: `string`):

Select the B2B outcome template. Maps to preconfigured filters and outputs.

## `legacyCompatibilityMode` (type: `boolean`):

If active, output will mimic legacy scraper output structures.

## `preserveLegacyFields` (type: `boolean`):

If true, legacy fields are preserved alongside enriched fields.

## `outputPreset` (type: `string`):

Output layout format (rawCompatible, rawPlusInsights, creatorLeadList, viralVideoReport, competitorReport, contentCalendar, agencyClientReport, commentInsights, trendRadar).

## `startUrls` (type: `array`):

TikTok URLs (profiles, hashtags, videos, search queries) to start crawling.

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

List of hashtags to scrape (without '#').

## `profiles` (type: `array`):

List of TikTok profile usernames (without '@').

## `searchQueries` (type: `array`):

List of search terms to query on TikTok.

## `searchSection` (type: `string`):

Select whether to scrape Top results, Videos, or Profiles for search queries.

## `maxProfilesPerQuery` (type: `integer`):

Number of profiles to extract per search query.

## `searchSort` (type: `string`):

Sort order of search results.

## `searchDate` (type: `string`):

Filter search results by upload date range.

## `postURLs` (type: `array`):

Direct URLs to TikTok posts to scrape.

## `musicURLs` (type: `array`):

Direct music/sound URLs to scrape.

## `soundIDs` (type: `array`):

List of TikTok Sound IDs.

## `profileScrapeSections` (type: `array`):

Profile tab sections to scrape (supported values: posts, liked, bookmarked).

## `profileSorting` (type: `string`):

Sort order of posts collected from profiles.

## `excludePinnedPosts` (type: `boolean`):

If true, pinned posts will be ignored.

## `limitPerPage` (type: `integer`):

Number of videos to scrape per profile, hashtag, or search query.

## `dateFilterStart` (type: `string`):

Scrape profile videos published after this date (YYYY-MM-DD).

## `dateFilterEnd` (type: `string`):

Scrape profile videos published before this date (YYYY-MM-DD).

## `minHearts` (type: `integer`):

Only scrape videos with hearts (likes) greater than or equal to this.

## `maxHearts` (type: `integer`):

Only scrape videos with hearts (likes) less than this.

## `maxFollowers` (type: `integer`):

Maximum number of followers to fetch.

## `maxFollowing` (type: `integer`):

Maximum number of following profiles to fetch.

## `scrapeRelatedVideos` (type: `boolean`):

Collect related/recommended videos from the sidebar of target video URLs.

## `maxRelatedVideosPerPost` (type: `integer`):

Limit of related videos to crawl per post.

## `scrapeFollowers` (type: `boolean`):

Collect followers of target profiles where publicly visible.

## `scrapeFollowing` (type: `boolean`):

Collect following lists of target profiles where publicly visible.

## `maxFollowersPerProfile` (type: `integer`):

Limit followers to fetch per profile.

## `maxFollowingPerProfile` (type: `integer`):

Limit following list to fetch per profile.

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

Overall maximum items to return in default dataset.

## `maxCommentsPerPost` (type: `integer`):

Maximum comments to fetch per video post.

## `minViews` (type: `integer`):

Exclude videos with views below this count.

## `minLikes` (type: `integer`):

Exclude videos with likes below this count.

## `scrapeComments` (type: `boolean`):

Enables comment extraction.

## `scrapeCommentReplies` (type: `boolean`):

Enables extracting replies to top-level comments.

## `maxRepliesPerComment` (type: `integer`):

Maximum replies to collect for each parent comment.

## `maxTopLevelCommentsPerPost` (type: `integer`):

Limit top-level comments fetched per post (excluding reply threads).

## `includeCommentAuthors` (type: `boolean`):

Includes username/nickname of comment authors.

## `includeCommentSentiment` (type: `boolean`):

Calculates sentiment labels for comments.

## `extractPainPoints` (type: `boolean`):

Extract B2B pain points from user comments.

## `extractBuyingSignals` (type: `boolean`):

Extract B2B buying signals from comments.

## `extractQuestions` (type: `boolean`):

Extract questions asked in comments.

## `viralityWeight` (type: `number`):

Weight of play velocity in scoring (0 to 1).

## `creatorWeight` (type: `number`):

Weight of creator followers and verification (0 to 1).

## `brandSafetyThreshold` (type: `number`):

Exclude videos with safety scores below this (0 to 1).

## `audienceKeywords` (type: `array`):

Audience keyword filters.

## `shouldDownloadVideos` (type: `boolean`):

If true, saves video files to Key-Value Store.

## `shouldDownloadCovers` (type: `boolean`):

Save post covers to Key-Value Store.

## `shouldDownloadAvatars` (type: `boolean`):

Save author avatars to Key-Value Store.

## `shouldDownloadMusicCovers` (type: `boolean`):

Save music track covers to Key-Value Store.

## `shouldDownloadSlideshowImages` (type: `boolean`):

Save slideshow image slides to Key-Value Store.

## `maxVideoDurationSecs` (type: `integer`):

Maximum video length in seconds.

## `mediaStoragePrefix` (type: `string`):

Namespace folder name for downloaded media keys.

## `shouldDownloadSubtitles` (type: `boolean`):

Save public subtitle tracks to Key-Value Store.

## `extractTranscripts` (type: `boolean`):

Normalize subtitle tracks into paragraph transcripts.

## `transcriptLanguage` (type: `string`):

Language code to target for transcripts.

## `includeTranscriptInOutput` (type: `boolean`):

Add the raw transcript text directly to dataset items.

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

Apify proxy settings.

## `proxyCountryCode` (type: `string`):

ISO 2-letter country code for targeted proxies.

## `useApifyProxy` (type: `boolean`):

Enable default Apify proxy allocation.

## `scraperEngine` (type: `string`):

Scraping engine option.

## `fallbackActorId` (type: `string`):

Actor slug/id to call for fallback.

## `fallbackOnFailure` (type: `boolean`):

If true, falls back to fallbackActorId if native extraction fails.

## `customActorId` (type: `string`):

Custom actor ID.

## `maxRetries` (type: `integer`):

Maximum number of page download retries.

## `debugMode` (type: `boolean`):

Enables verbose logging.

## `llmProvider` (type: `string`):

Select LLM provider for analysis.

## `openAiApiKey` (type: `string`):

OpenAI API key.

## `anthropicApiKey` (type: `string`):

Anthropic API key.

## `googleApiKey` (type: `string`):

Gemini API key.

## Actor input object example

```json
{
  "runMode": "custom",
  "legacyCompatibilityMode": false,
  "preserveLegacyFields": true,
  "outputPreset": "rawCompatible",
  "startUrls": [],
  "hashtags": [],
  "profiles": [],
  "searchQueries": [],
  "searchSection": "top",
  "maxProfilesPerQuery": 10,
  "searchSort": "relevance",
  "searchDate": "all",
  "postURLs": [],
  "musicURLs": [],
  "soundIDs": [],
  "profileScrapeSections": [
    "posts"
  ],
  "profileSorting": "latest",
  "excludePinnedPosts": false,
  "limitPerPage": 100,
  "dateFilterStart": "",
  "dateFilterEnd": "",
  "minHearts": 0,
  "maxHearts": 0,
  "maxFollowers": 0,
  "maxFollowing": 0,
  "scrapeRelatedVideos": false,
  "maxRelatedVideosPerPost": 20,
  "scrapeFollowers": false,
  "scrapeFollowing": false,
  "maxFollowersPerProfile": 100,
  "maxFollowingPerProfile": 100,
  "maxItems": 20,
  "maxCommentsPerPost": 50,
  "minViews": 0,
  "minLikes": 0,
  "scrapeComments": false,
  "scrapeCommentReplies": false,
  "maxRepliesPerComment": 10,
  "maxTopLevelCommentsPerPost": 0,
  "includeCommentAuthors": true,
  "includeCommentSentiment": false,
  "extractPainPoints": false,
  "extractBuyingSignals": false,
  "extractQuestions": false,
  "viralityWeight": 0.4,
  "creatorWeight": 0.3,
  "brandSafetyThreshold": 0.5,
  "audienceKeywords": [],
  "shouldDownloadVideos": false,
  "shouldDownloadCovers": false,
  "shouldDownloadAvatars": false,
  "shouldDownloadMusicCovers": false,
  "shouldDownloadSlideshowImages": false,
  "maxVideoDurationSecs": 60,
  "mediaStoragePrefix": "trendpilot",
  "shouldDownloadSubtitles": false,
  "extractTranscripts": false,
  "transcriptLanguage": "auto",
  "includeTranscriptInOutput": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "proxyCountryCode": "",
  "useApifyProxy": true,
  "scraperEngine": "trendPilot",
  "fallbackActorId": "",
  "fallbackOnFailure": true,
  "customActorId": "",
  "maxRetries": 3,
  "debugMode": false,
  "llmProvider": "openai"
}
```

# Actor output Schema

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

Default dataset items containing B2B lead scores, virality metadata, contact details, transcripts, and video data.

# 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("orbitai/trend-pilot-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 = {}

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

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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 orbitai/trend-pilot-tiktok-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=orbitai/trend-pilot-tiktok-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "TrendPilot — TikTok Scraper & Creator Leads",
        "description": "Extract TikTok videos, hashtags, profiles, comments, sounds, and search results with automated lead, viral, and brand fit scoring.",
        "version": "1.0",
        "x-build-id": "ZQ8tCsQFvguPZZjec"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/orbitai~trend-pilot-tiktok-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-orbitai-trend-pilot-tiktok-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/orbitai~trend-pilot-tiktok-scraper/runs": {
            "post": {
                "operationId": "runs-sync-orbitai-trend-pilot-tiktok-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/orbitai~trend-pilot-tiktok-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-orbitai-trend-pilot-tiktok-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "runMode",
                    "startUrls"
                ],
                "properties": {
                    "runMode": {
                        "title": "Run Mode",
                        "enum": [
                            "creatorLeads",
                            "viralReport",
                            "competitorMonitoring",
                            "contentCalendar",
                            "custom"
                        ],
                        "type": "string",
                        "description": "Select the B2B outcome template. Maps to preconfigured filters and outputs.",
                        "default": "custom"
                    },
                    "legacyCompatibilityMode": {
                        "title": "Legacy Compatibility Mode",
                        "type": "boolean",
                        "description": "If active, output will mimic legacy scraper output structures.",
                        "default": false
                    },
                    "preserveLegacyFields": {
                        "title": "Preserve Legacy Fields",
                        "type": "boolean",
                        "description": "If true, legacy fields are preserved alongside enriched fields.",
                        "default": true
                    },
                    "outputPreset": {
                        "title": "Output Preset Layout",
                        "enum": [
                            "rawCompatible",
                            "rawPlusInsights",
                            "creatorLeadList",
                            "viralVideoReport",
                            "competitorReport",
                            "contentCalendar",
                            "agencyClientReport",
                            "commentInsights",
                            "trendRadar"
                        ],
                        "type": "string",
                        "description": "Output layout format (rawCompatible, rawPlusInsights, creatorLeadList, viralVideoReport, competitorReport, contentCalendar, agencyClientReport, commentInsights, trendRadar).",
                        "default": "rawCompatible"
                    },
                    "startUrls": {
                        "title": "Start URLs",
                        "type": "array",
                        "description": "TikTok URLs (profiles, hashtags, videos, search queries) to start crawling.",
                        "default": [],
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL of a web page",
                                    "format": "uri"
                                }
                            }
                        }
                    },
                    "hashtags": {
                        "title": "Hashtags List",
                        "type": "array",
                        "description": "List of hashtags to scrape (without '#').",
                        "default": []
                    },
                    "profiles": {
                        "title": "Profiles List",
                        "type": "array",
                        "description": "List of TikTok profile usernames (without '@').",
                        "default": []
                    },
                    "searchQueries": {
                        "title": "Search Queries List",
                        "type": "array",
                        "description": "List of search terms to query on TikTok.",
                        "default": []
                    },
                    "searchSection": {
                        "title": "Search Tab Section",
                        "enum": [
                            "top",
                            "video",
                            "profile"
                        ],
                        "type": "string",
                        "description": "Select whether to scrape Top results, Videos, or Profiles for search queries.",
                        "default": "top"
                    },
                    "maxProfilesPerQuery": {
                        "title": "Max Profiles Per Query",
                        "type": "integer",
                        "description": "Number of profiles to extract per search query.",
                        "default": 10
                    },
                    "searchSort": {
                        "title": "Search Sorting Method",
                        "enum": [
                            "relevance",
                            "latest",
                            "likes"
                        ],
                        "type": "string",
                        "description": "Sort order of search results.",
                        "default": "relevance"
                    },
                    "searchDate": {
                        "title": "Search Date Range Filter",
                        "enum": [
                            "all",
                            "day",
                            "week",
                            "month",
                            "three_months",
                            "six_months"
                        ],
                        "type": "string",
                        "description": "Filter search results by upload date range.",
                        "default": "all"
                    },
                    "postURLs": {
                        "title": "Post/Video URLs",
                        "type": "array",
                        "description": "Direct URLs to TikTok posts to scrape.",
                        "default": []
                    },
                    "musicURLs": {
                        "title": "Music URLs",
                        "type": "array",
                        "description": "Direct music/sound URLs to scrape.",
                        "default": []
                    },
                    "soundIDs": {
                        "title": "Sound IDs",
                        "type": "array",
                        "description": "List of TikTok Sound IDs.",
                        "default": []
                    },
                    "profileScrapeSections": {
                        "title": "Profile Scrape Sections",
                        "type": "array",
                        "description": "Profile tab sections to scrape (supported values: posts, liked, bookmarked).",
                        "items": {
                            "type": "string"
                        },
                        "default": [
                            "posts"
                        ]
                    },
                    "profileSorting": {
                        "title": "Profile Post Sorting",
                        "enum": [
                            "latest",
                            "popular"
                        ],
                        "type": "string",
                        "description": "Sort order of posts collected from profiles.",
                        "default": "latest"
                    },
                    "excludePinnedPosts": {
                        "title": "Exclude Pinned Posts",
                        "type": "boolean",
                        "description": "If true, pinned posts will be ignored.",
                        "default": false
                    },
                    "limitPerPage": {
                        "title": "Limit Per Section",
                        "type": "integer",
                        "description": "Number of videos to scrape per profile, hashtag, or search query.",
                        "default": 100
                    },
                    "dateFilterStart": {
                        "title": "Date Filter Start",
                        "type": "string",
                        "description": "Scrape profile videos published after this date (YYYY-MM-DD).",
                        "default": ""
                    },
                    "dateFilterEnd": {
                        "title": "Date Filter End",
                        "type": "string",
                        "description": "Scrape profile videos published before this date (YYYY-MM-DD).",
                        "default": ""
                    },
                    "minHearts": {
                        "title": "Min Hearts (Likes)",
                        "type": "integer",
                        "description": "Only scrape videos with hearts (likes) greater than or equal to this.",
                        "default": 0
                    },
                    "maxHearts": {
                        "title": "Max Hearts (Likes)",
                        "type": "integer",
                        "description": "Only scrape videos with hearts (likes) less than this.",
                        "default": 0
                    },
                    "maxFollowers": {
                        "title": "Max Followers",
                        "type": "integer",
                        "description": "Maximum number of followers to fetch.",
                        "default": 0
                    },
                    "maxFollowing": {
                        "title": "Max Following Profiles",
                        "type": "integer",
                        "description": "Maximum number of following profiles to fetch.",
                        "default": 0
                    },
                    "scrapeRelatedVideos": {
                        "title": "Scrape Related Videos",
                        "type": "boolean",
                        "description": "Collect related/recommended videos from the sidebar of target video URLs.",
                        "default": false
                    },
                    "maxRelatedVideosPerPost": {
                        "title": "Max Related Videos Per Post",
                        "minimum": 0,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Limit of related videos to crawl per post.",
                        "default": 20
                    },
                    "scrapeFollowers": {
                        "title": "Scrape Profile Followers",
                        "type": "boolean",
                        "description": "Collect followers of target profiles where publicly visible.",
                        "default": false
                    },
                    "scrapeFollowing": {
                        "title": "Scrape Profile Following",
                        "type": "boolean",
                        "description": "Collect following lists of target profiles where publicly visible.",
                        "default": false
                    },
                    "maxFollowersPerProfile": {
                        "title": "Max Followers Per Profile",
                        "minimum": 0,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Limit followers to fetch per profile.",
                        "default": 100
                    },
                    "maxFollowingPerProfile": {
                        "title": "Max Following Per Profile",
                        "minimum": 0,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Limit following list to fetch per profile.",
                        "default": 100
                    },
                    "maxItems": {
                        "title": "Max Items To Scrape",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Overall maximum items to return in default dataset.",
                        "default": 20
                    },
                    "maxCommentsPerPost": {
                        "title": "Max Comments Per Post",
                        "minimum": 0,
                        "maximum": 5000,
                        "type": "integer",
                        "description": "Maximum comments to fetch per video post.",
                        "default": 50
                    },
                    "minViews": {
                        "title": "Minimum Video Views",
                        "type": "integer",
                        "description": "Exclude videos with views below this count.",
                        "default": 0
                    },
                    "minLikes": {
                        "title": "Minimum Video Likes",
                        "type": "integer",
                        "description": "Exclude videos with likes below this count.",
                        "default": 0
                    },
                    "scrapeComments": {
                        "title": "Scrape Comments",
                        "type": "boolean",
                        "description": "Enables comment extraction.",
                        "default": false
                    },
                    "scrapeCommentReplies": {
                        "title": "Scrape Comment Replies",
                        "type": "boolean",
                        "description": "Enables extracting replies to top-level comments.",
                        "default": false
                    },
                    "maxRepliesPerComment": {
                        "title": "Max Replies Per Comment",
                        "minimum": 0,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Maximum replies to collect for each parent comment.",
                        "default": 10
                    },
                    "maxTopLevelCommentsPerPost": {
                        "title": "Max Top-Level Comments Per Post",
                        "type": "integer",
                        "description": "Limit top-level comments fetched per post (excluding reply threads).",
                        "default": 0
                    },
                    "includeCommentAuthors": {
                        "title": "Include Comment Authors",
                        "type": "boolean",
                        "description": "Includes username/nickname of comment authors.",
                        "default": true
                    },
                    "includeCommentSentiment": {
                        "title": "Include Comment Sentiment",
                        "type": "boolean",
                        "description": "Calculates sentiment labels for comments.",
                        "default": false
                    },
                    "extractPainPoints": {
                        "title": "Extract Pain Points",
                        "type": "boolean",
                        "description": "Extract B2B pain points from user comments.",
                        "default": false
                    },
                    "extractBuyingSignals": {
                        "title": "Extract Buying Signals",
                        "type": "boolean",
                        "description": "Extract B2B buying signals from comments.",
                        "default": false
                    },
                    "extractQuestions": {
                        "title": "Extract User Questions",
                        "type": "boolean",
                        "description": "Extract questions asked in comments.",
                        "default": false
                    },
                    "viralityWeight": {
                        "title": "Virality Score Weight",
                        "minimum": 0,
                        "maximum": 1,
                        "type": "number",
                        "description": "Weight of play velocity in scoring (0 to 1).",
                        "default": 0.4
                    },
                    "creatorWeight": {
                        "title": "Creator Authority Weight",
                        "minimum": 0,
                        "maximum": 1,
                        "type": "number",
                        "description": "Weight of creator followers and verification (0 to 1).",
                        "default": 0.3
                    },
                    "brandSafetyThreshold": {
                        "title": "Brand Safety Threshold",
                        "minimum": 0,
                        "maximum": 1,
                        "type": "number",
                        "description": "Exclude videos with safety scores below this (0 to 1).",
                        "default": 0.5
                    },
                    "audienceKeywords": {
                        "title": "Niche/Audience Keywords",
                        "type": "array",
                        "description": "Audience keyword filters.",
                        "default": []
                    },
                    "shouldDownloadVideos": {
                        "title": "Download Videos",
                        "type": "boolean",
                        "description": "If true, saves video files to Key-Value Store.",
                        "default": false
                    },
                    "shouldDownloadCovers": {
                        "title": "Download Video Covers",
                        "type": "boolean",
                        "description": "Save post covers to Key-Value Store.",
                        "default": false
                    },
                    "shouldDownloadAvatars": {
                        "title": "Download Creator Avatars",
                        "type": "boolean",
                        "description": "Save author avatars to Key-Value Store.",
                        "default": false
                    },
                    "shouldDownloadMusicCovers": {
                        "title": "Download Music Covers",
                        "type": "boolean",
                        "description": "Save music track covers to Key-Value Store.",
                        "default": false
                    },
                    "shouldDownloadSlideshowImages": {
                        "title": "Download Slideshow Images",
                        "type": "boolean",
                        "description": "Save slideshow image slides to Key-Value Store.",
                        "default": false
                    },
                    "maxVideoDurationSecs": {
                        "title": "Max Video Duration (Seconds)",
                        "type": "integer",
                        "description": "Maximum video length in seconds.",
                        "default": 60
                    },
                    "mediaStoragePrefix": {
                        "title": "Media Storage Prefix",
                        "type": "string",
                        "description": "Namespace folder name for downloaded media keys.",
                        "default": "trendpilot"
                    },
                    "shouldDownloadSubtitles": {
                        "title": "Download Subtitles",
                        "type": "boolean",
                        "description": "Save public subtitle tracks to Key-Value Store.",
                        "default": false
                    },
                    "extractTranscripts": {
                        "title": "Extract Text Transcripts",
                        "type": "boolean",
                        "description": "Normalize subtitle tracks into paragraph transcripts.",
                        "default": false
                    },
                    "transcriptLanguage": {
                        "title": "Transcript Language Target",
                        "type": "string",
                        "description": "Language code to target for transcripts.",
                        "default": "auto"
                    },
                    "includeTranscriptInOutput": {
                        "title": "Include Transcript In Output",
                        "type": "boolean",
                        "description": "Add the raw transcript text directly to dataset items.",
                        "default": false
                    },
                    "proxyConfiguration": {
                        "title": "Proxy Configuration",
                        "type": "object",
                        "description": "Apify proxy settings.",
                        "default": {
                            "useApifyProxy": true
                        }
                    },
                    "proxyCountryCode": {
                        "title": "Proxy Country Target",
                        "type": "string",
                        "description": "ISO 2-letter country code for targeted proxies.",
                        "default": ""
                    },
                    "useApifyProxy": {
                        "title": "Use Apify Proxy",
                        "type": "boolean",
                        "description": "Enable default Apify proxy allocation.",
                        "default": true
                    },
                    "scraperEngine": {
                        "title": "Scraper Engine",
                        "enum": [
                            "trendPilot",
                            "legacyCompatible",
                            "externalFallback",
                            "customActor"
                        ],
                        "type": "string",
                        "description": "Scraping engine option.",
                        "default": "trendPilot"
                    },
                    "fallbackActorId": {
                        "title": "Fallback Actor ID",
                        "type": "string",
                        "description": "Actor slug/id to call for fallback.",
                        "default": ""
                    },
                    "fallbackOnFailure": {
                        "title": "Fallback On Failure",
                        "type": "boolean",
                        "description": "If true, falls back to fallbackActorId if native extraction fails.",
                        "default": true
                    },
                    "customActorId": {
                        "title": "Custom Actor ID",
                        "type": "string",
                        "description": "Custom actor ID.",
                        "default": ""
                    },
                    "maxRetries": {
                        "title": "Max Scraper Retries",
                        "type": "integer",
                        "description": "Maximum number of page download retries.",
                        "default": 3
                    },
                    "debugMode": {
                        "title": "Debug Mode",
                        "type": "boolean",
                        "description": "Enables verbose logging.",
                        "default": false
                    },
                    "llmProvider": {
                        "title": "AI LLM Provider",
                        "enum": [
                            "openai",
                            "anthropic",
                            "google"
                        ],
                        "type": "string",
                        "description": "Select LLM provider for analysis.",
                        "default": "openai"
                    },
                    "openAiApiKey": {
                        "title": "OpenAI API Key",
                        "type": "string",
                        "description": "OpenAI API key."
                    },
                    "anthropicApiKey": {
                        "title": "Anthropic API Key",
                        "type": "string",
                        "description": "Anthropic API key."
                    },
                    "googleApiKey": {
                        "title": "Google Gemini API Key",
                        "type": "string",
                        "description": "Gemini API key."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
