# TikTok Ultimate Scraper | Videos, Hashtags & Analytics (`rp_openpro.ai/tiktok-ultimate-scraper`) Actor

Scrape TikTok videos, profiles, hashtags, search, followers, Creative Center analytics and trends. Export views, likes, comments, music and author stats to JSON/CSV via Apify API.

- **URL**: https://apify.com/rp\_openpro.ai/tiktok-ultimate-scraper.md
- **Developed by:** [Rémi Pelloux](https://apify.com/rp_openpro.ai) (community)
- **Categories:** AI, Automation, Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.50 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## 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

## TikTok Ultimate Scraper — Videos, Profiles, Hashtags, Analytics & Trends

**The most complete TikTok scraper on Apify.** Extract videos, profiles, hashtags, search results, follower graphs, Creative Center hashtag analytics, and trending sounds/creators/videos — with full engagement metrics, author stats, music metadata, subtitles, and location data.

Built for marketers, researchers, agencies, and growth teams who need **structured TikTok data at scale** without maintaining fragile scrapers.

---

### Why choose this scraper?

| Feature | Basic TikTok scrapers | **TikTok Ultimate Scraper** |
| --- | --- | --- |
| Hashtag scraping | ✅ | ✅ |
| Profile videos | ✅ | ✅ |
| Search (video/user) | Limited | ✅ Full |
| Followers / following lists | ❌ | ✅ |
| Related videos | ❌ | ✅ |
| Direct video URL extraction | ✅ | ✅ |
| Creative Center hashtag analytics | ❌ | ✅ Audience age, interests, countries |
| Trend discovery (hashtags, sounds, creators, videos) | ❌ | ✅ |
| Author stats (followers, hearts, verified) | Partial | ✅ Full |
| Music & subtitle metadata | Partial | ✅ Full |
| Date filtering | ❌ | ✅ |
| Pinned post exclusion | ❌ | ✅ |
| Apify Proxy support | Varies | ✅ Recommended |
| Pay-per-result pricing | Varies | ✅ Transparent |

---

### What you can scrape

#### 🎬 Content scraping (`mode: scrape`)

- **Hashtags** — all public videos under a tag
- **Profiles** — videos, reposts, followers, following
- **Search** — keyword search (all, videos only, users only)
- **Video URLs** — single post metadata + optional related videos
- **Filters** — date range, exclude pinned posts, max results per query

#### 📊 Hashtag analytics (`mode: hashtagAnalytics`)

TikTok Creative Center data for any hashtag:

- Total views & post count
- Trend sparkline (7 / 30 / 120 days)
- Audience breakdown (age, interests, countries)
- Related hashtags & top videos
- Industry & longevity metrics

#### 🔥 Trend discovery (`mode: trendDiscovery`)

Discover what's trending on TikTok right now:

- Trending **hashtags** (with industry filter & new-on-board)
- Trending **sounds** (popular / surging, business-approved filter)
- Trending **creators** (sort by followers, engagement, avg views)
- Trending **videos** (sort by views, likes, comments, reposts)

---

### Output fields

Each dataset row includes rich metadata:

| Field | Description |
| --- | --- |
| `webVideoUrl` | Direct link to the TikTok video |
| `text` | Video caption / description |
| `playCount` | View count |
| `diggCount` | Like count |
| `commentCount` | Comment count |
| `shareCount` | Share count |
| `collectCount` | Save/bookmark count |
| `authorMeta` | Username, nickname, followers, verified, bio, avatar |
| `musicMeta` | Sound name, author, play URL, cover |
| `videoMeta` | Duration, resolution, cover, download URL, subtitles |
| `hashtags` | Hashtags used in the video |
| `mentions` | @mentions in caption |
| `locationMeta` | POI / geo data when available |
| `createTimeISO` | Publication timestamp |
| `isPinned` / `isSponsored` / `isAd` | Content flags |

Analytics & trend rows add fields like `videoViews`, `publishCnt`, `audienceAges`, `rank`, `trendingHistogram`, and more.

---

### Input parameters

| Parameter | Type | Default | Description |
| --- | --- | --- | --- |
| `mode` | string | `scrape` | `scrape`, `hashtagAnalytics`, or `trendDiscovery` |
| `hashtags` | string[] | — | Hashtags to scrape (no `#`) |
| `profiles` | string[] | — | TikTok usernames |
| `search` | string[] | — | Search keywords |
| `videoUrls` | string[] | — | Direct video URLs |
| `resultsPerPage` | integer | `20` | Max results per query (1–1000) |
| `maxProfilesPerQuery` | integer | `10` | Max profiles to process |
| `excludePinnedPosts` | boolean | `false` | Skip pinned videos |
| `scrapeRelatedVideos` | boolean | `false` | Fetch related videos for URL inputs |
| `profileScrapeSections` | string[] | `["videos"]` | `videos`, `reposts`, `followers`, `following` |
| `profileSorting` | string | `latest` | `latest`, `popular`, `oldest` |
| `oldestPostDateUnified` | string | — | Min date (`YYYY-MM-DD` or days) |
| `newestPostDate` | string | — | Max date (`YYYY-MM-DD`) |
| `searchSection` | string | `` | `""`, `video`, or `user` |
| `adsCountryCode` | string | `US` | Country for analytics/trends |
| `adsTimeRange` | string | `7` | `7`, `30`, or `120` days |
| `adsScrapeHashtags/Sounds/Creators/Videos` | boolean | varies | Trend discovery toggles |
| `proxyConfiguration` | object | Apify Proxy | **Strongly recommended** |

---

### Example output

```json
{
  "resultType": "video",
  "id": "7123456789012345678",
  "text": "3 marketing hacks that actually work #marketing #growth",
  "webVideoUrl": "https://www.tiktok.com/@brand/video/7123456789012345678",
  "createTimeISO": "2026-05-20T14:30:00.000Z",
  "playCount": 1250000,
  "diggCount": 98000,
  "commentCount": 4200,
  "shareCount": 15000,
  "collectCount": 8500,
  "authorMeta": {
    "name": "brand",
    "nickName": "Brand Official",
    "verified": true,
    "fans": 2500000,
    "following": 120,
    "heart": 45000000,
    "profileUrl": "https://www.tiktok.com/@brand"
  },
  "musicMeta": {
    "musicName": "original sound - Brand Official",
    "musicAuthor": "Brand Official",
    "musicOriginal": true
  },
  "hashtags": [
    { "name": "marketing" },
    { "name": "growth" }
  ],
  "succeeded": true
}
````

***

### Pricing

| Tier | Price | Limit |
| --- | --- | --- |
| **Free trial** | $0 | 10 results per run |
| **Pay-per-result** | Per video/result | Unlimited with subscription |

Billing event: **`video`** — one charge per dataset row (video, analytics item, or trend item).

Enable Pay-per-event monetization in Apify Console with the `video` custom event.

***

### Quick start

#### Apify Console

1. Open the actor and click **Start**
2. Set `hashtags: ["marketing"]` and `resultsPerPage: 20`
3. Enable **Apify Proxy**
4. Run and download JSON/CSV from the dataset

#### cURL

```bash
curl -X POST "https://api.apify.com/v2/acts/YOUR_ACTOR_ID/runs?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "mode": "scrape",
    "hashtags": ["fyp", "viral"],
    "resultsPerPage": 50,
    "proxyConfiguration": { "useApifyProxy": true }
  }'
```

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_TOKEN")
run = client.actor("YOUR_ACTOR_ID").call(run_input={
    "mode": "scrape",
    "profiles": ["nike", "adidas"],
    "resultsPerPage": 30,
    "profileScrapeSections": ["videos"],
    "proxyConfiguration": {"useApifyProxy": True},
})
items = client.dataset(run["defaultDatasetId"]).list_items().items
print(f"Scraped {len(items)} items")
```

#### JavaScript

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

const client = new ApifyClient({ token: 'YOUR_TOKEN' });
const run = await client.actor('YOUR_ACTOR_ID').call({
    mode: 'hashtagAnalytics',
    hashtags: ['skincare', 'beauty'],
    adsCountryCode: 'US',
    adsTimeRange: '30',
    proxyConfiguration: { useApifyProxy: true },
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

***

### Use cases

- **Social listening** — monitor brand mentions and hashtag campaigns
- **Competitor analysis** — track rival profiles, engagement rates, posting cadence
- **Influencer discovery** — find creators by niche, followers, and engagement
- **Trend research** — spot rising hashtags and sounds before they peak
- **Ad planning** — Creative Center analytics for audience targeting
- **Content repurposing** — collect metadata, captions, and music info
- **Academic research** — structured datasets for social media studies

***

### Integrations

Export results to your stack in one click:

- **Google Sheets** — Apify integration or webhook
- **Zapier / Make** — trigger workflows on run finish
- **Webhooks** — push dataset to your API
- **REST API** — poll runs and download JSON/CSV
- **Airbyte / custom ETL** — ingest into your data warehouse

***

### FAQ

**Do I need a proxy?**\
Yes, for production runs. TikTok rate-limits datacenter IPs. Apify Proxy with residential IPs gives the best results.

**Can I scrape private accounts?**\
No. Only publicly visible content is accessible.

**What's the free tier limit?**\
10 results per run without a paid Apify subscription.

**Does it download video files?**\
This actor returns metadata and media URLs. Download files separately using the `videoMeta.downloadAddr` or `mediaUrls` fields.

**Can I scrape comments?**\
Not in this version. Each row is a video, profile connection, analytics record, or trend item.

**How often should I run it?**\
For trend monitoring, daily runs with `mode: trendDiscovery` work well. For profile tracking, weekly is usually enough.

**Is this legal?**\
You are responsible for complying with TikTok's Terms of Service and applicable laws. Scrape only public data for legitimate purposes.

**What countries are supported for analytics?**\
Any ISO 2-letter country code supported by TikTok Creative Center (e.g. US, GB, FR, DE, BR).

***

### Tips for best results

1. **Always enable Apify Proxy** — set `useApifyProxy: true`
2. **Start small** — test with `resultsPerPage: 10` before scaling
3. **Use date filters** — `oldestPostDateUnified: "30"` for last 30 days only
4. **Combine modes** — run separate jobs for content vs analytics vs trends
5. **Monitor spend** — set Apify budget limits in Console

***

### Responsible use

This actor extracts **publicly available** TikTok data only. Users must:

- Respect TikTok's Terms of Service and robots directives
- Comply with GDPR, CCPA, and local privacy regulations
- Not use data for harassment, spam, or unauthorized surveillance
- Attribute data sources appropriately in published research

The actor owner provides tooling only — **you** are responsible for lawful use.

***

### Support

Questions or feature requests? Open an issue on the actor page or contact the developer through Apify Console.

**Keywords:** TikTok scraper, TikTok API, scrape TikTok videos, TikTok hashtag scraper, TikTok profile scraper, TikTok analytics, TikTok trend discovery, TikTok data extraction, social media scraper, TikTok Creative Center, TikTok influencer scraper, TikTok search scraper, export TikTok data, TikTok JSON scraper.

# Actor input Schema

## `mode` (type: `string`):

Choose what to scrape: standard TikTok content, hashtag analytics, or Creative Center trends.

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

Hashtags to scrape (without #). Used in scrape and hashtagAnalytics modes.

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

TikTok usernames to scrape (with or without @).

## `search` (type: `array`):

Keywords to search on TikTok.

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

Alias for search — both fields are merged.

## `videoUrls` (type: `array`):

Direct TikTok video URLs to extract.

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

Alias for videoUrls — both fields are merged.

## `resultsPerPage` (type: `integer`):

Maximum items to fetch per hashtag, profile, search, or URL.

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

Maximum number of profile usernames to process.

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

Skip pinned videos from profile results.

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

When scraping video URLs, also fetch related/recommended videos.

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

Which profile data to collect: videos, reposts, followers, following.

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

Sort order for profile video lists.

## `oldestPostDateUnified` (type: `string`):

Only include posts on or after this date. Use YYYY-MM-DD or number of days (e.g. 7 = last week).

## `newestPostDate` (type: `string`):

Only include posts on or before this date. Use YYYY-MM-DD.

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

Filter search results by type.

## `adsCountryCode` (type: `string`):

Country code for hashtag analytics and trend discovery (ISO 2-letter, e.g. US, FR, GB).

## `adsTimeRange` (type: `string`):

Lookback window for Creative Center analytics and trends.

## `adsScrapeHashtags` (type: `boolean`):

Fetch trending hashtags from Creative Center.

## `adsScrapeSounds` (type: `boolean`):

Fetch trending sounds from Creative Center.

## `adsScrapeCreators` (type: `boolean`):

Fetch trending creators from Creative Center.

## `adsScrapeVideos` (type: `boolean`):

Fetch trending videos from Creative Center.

## `adsHashtagIndustry` (type: `string`):

Filter trending hashtags by industry (e.g. Beauty & Personal Care).

## `adsNewOnBoard` (type: `boolean`):

Only hashtags newly entered the trending board.

## `adsRankType` (type: `string`):

Popular or surging sound ranking.

## `adsApprovedForBusinessUse` (type: `boolean`):

Only include sounds approved for commercial use.

## `adsSortCreatorsBy` (type: `string`):

Ranking metric for trending creators.

## `adsFollowers` (type: `string`):

Filter creators by follower count bucket (1–4).

## `adsAudienceCountry` (type: `string`):

Filter trending creators by primary audience country.

## `adsSortVideosBy` (type: `string`):

Ranking metric for trending videos.

## `adsSoundsCountryCode` (type: `string`):

Country code for trending sounds.

## `adsCreatorsCountryCode` (type: `string`):

Country code for trending creators.

## `adsVideosCountryCode` (type: `string`):

Country code for trending videos.

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

Apify Proxy is strongly recommended for reliable TikTok scraping at scale.

## `maxConcurrency` (type: `integer`):

Reserved for future parallel processing. Currently processed sequentially for stability.

## Actor input object example

```json
{
  "mode": "scrape",
  "hashtags": [
    "marketing",
    "startup"
  ],
  "profiles": [
    "nike",
    "redbull"
  ],
  "search": [
    "ai tools",
    "fitness tips"
  ],
  "searchQueries": [],
  "videoUrls": [
    "https://www.tiktok.com/@tiktok/video/7000000000000000000"
  ],
  "postURLs": [],
  "resultsPerPage": 20,
  "maxProfilesPerQuery": 10,
  "excludePinnedPosts": false,
  "scrapeRelatedVideos": false,
  "profileScrapeSections": [
    "videos"
  ],
  "profileSorting": "latest",
  "searchSection": "",
  "adsCountryCode": "US",
  "adsTimeRange": "7",
  "adsScrapeHashtags": true,
  "adsScrapeSounds": false,
  "adsScrapeCreators": false,
  "adsScrapeVideos": false,
  "adsNewOnBoard": false,
  "adsRankType": "popular",
  "adsApprovedForBusinessUse": false,
  "adsSortCreatorsBy": "follower",
  "adsSortVideosBy": "vv",
  "adsSoundsCountryCode": "US",
  "adsCreatorsCountryCode": "US",
  "adsVideosCountryCode": "US",
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "maxConcurrency": 1
}
```

# Actor output Schema

## `dataset` (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 = {
    "mode": "scrape",
    "hashtags": [
        "fyp",
        "viral"
    ],
    "profiles": [
        "tiktok"
    ],
    "search": [],
    "searchQueries": [],
    "videoUrls": [],
    "postURLs": [],
    "resultsPerPage": 20,
    "maxProfilesPerQuery": 10,
    "profileScrapeSections": [
        "videos"
    ],
    "oldestPostDateUnified": "",
    "newestPostDate": "",
    "adsCountryCode": "US",
    "adsHashtagIndustry": "",
    "adsFollowers": "",
    "adsAudienceCountry": "",
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("rp_openpro.ai/tiktok-ultimate-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 = {
    "mode": "scrape",
    "hashtags": [
        "fyp",
        "viral",
    ],
    "profiles": ["tiktok"],
    "search": [],
    "searchQueries": [],
    "videoUrls": [],
    "postURLs": [],
    "resultsPerPage": 20,
    "maxProfilesPerQuery": 10,
    "profileScrapeSections": ["videos"],
    "oldestPostDateUnified": "",
    "newestPostDate": "",
    "adsCountryCode": "US",
    "adsHashtagIndustry": "",
    "adsFollowers": "",
    "adsAudienceCountry": "",
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("rp_openpro.ai/tiktok-ultimate-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 '{
  "mode": "scrape",
  "hashtags": [
    "fyp",
    "viral"
  ],
  "profiles": [
    "tiktok"
  ],
  "search": [],
  "searchQueries": [],
  "videoUrls": [],
  "postURLs": [],
  "resultsPerPage": 20,
  "maxProfilesPerQuery": 10,
  "profileScrapeSections": [
    "videos"
  ],
  "oldestPostDateUnified": "",
  "newestPostDate": "",
  "adsCountryCode": "US",
  "adsHashtagIndustry": "",
  "adsFollowers": "",
  "adsAudienceCountry": "",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call rp_openpro.ai/tiktok-ultimate-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "TikTok Ultimate Scraper | Videos, Hashtags & Analytics",
        "description": "Scrape TikTok videos, profiles, hashtags, search, followers, Creative Center analytics and trends. Export views, likes, comments, music and author stats to JSON/CSV via Apify API.",
        "version": "0.9",
        "x-build-id": "JZ0E5rd9cVtOq3TKu"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/rp_openpro.ai~tiktok-ultimate-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-rp_openpro.ai-tiktok-ultimate-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/rp_openpro.ai~tiktok-ultimate-scraper/runs": {
            "post": {
                "operationId": "runs-sync-rp_openpro.ai-tiktok-ultimate-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/rp_openpro.ai~tiktok-ultimate-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-rp_openpro.ai-tiktok-ultimate-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",
                "properties": {
                    "mode": {
                        "title": "Scraping mode",
                        "enum": [
                            "scrape",
                            "hashtagAnalytics",
                            "trendDiscovery"
                        ],
                        "type": "string",
                        "description": "Choose what to scrape: standard TikTok content, hashtag analytics, or Creative Center trends.",
                        "default": "scrape"
                    },
                    "hashtags": {
                        "title": "Hashtags",
                        "type": "array",
                        "description": "Hashtags to scrape (without #). Used in scrape and hashtagAnalytics modes.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "profiles": {
                        "title": "Profiles",
                        "type": "array",
                        "description": "TikTok usernames to scrape (with or without @).",
                        "items": {
                            "type": "string"
                        }
                    },
                    "search": {
                        "title": "Search queries",
                        "type": "array",
                        "description": "Keywords to search on TikTok.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "searchQueries": {
                        "title": "Search queries (alias)",
                        "type": "array",
                        "description": "Alias for search — both fields are merged.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "videoUrls": {
                        "title": "Video URLs",
                        "type": "array",
                        "description": "Direct TikTok video URLs to extract.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "postURLs": {
                        "title": "Video URLs (alias)",
                        "type": "array",
                        "description": "Alias for videoUrls — both fields are merged.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "resultsPerPage": {
                        "title": "Results per query",
                        "minimum": 1,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Maximum items to fetch per hashtag, profile, search, or URL.",
                        "default": 20
                    },
                    "maxProfilesPerQuery": {
                        "title": "Max profiles",
                        "minimum": 1,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Maximum number of profile usernames to process.",
                        "default": 10
                    },
                    "excludePinnedPosts": {
                        "title": "Exclude pinned posts",
                        "type": "boolean",
                        "description": "Skip pinned videos from profile results.",
                        "default": false
                    },
                    "scrapeRelatedVideos": {
                        "title": "Scrape related videos",
                        "type": "boolean",
                        "description": "When scraping video URLs, also fetch related/recommended videos.",
                        "default": false
                    },
                    "profileScrapeSections": {
                        "title": "Profile sections",
                        "type": "array",
                        "description": "Which profile data to collect: videos, reposts, followers, following.",
                        "default": [
                            "videos"
                        ],
                        "items": {
                            "type": "string"
                        }
                    },
                    "profileSorting": {
                        "title": "Profile sort order",
                        "enum": [
                            "latest",
                            "popular",
                            "oldest"
                        ],
                        "type": "string",
                        "description": "Sort order for profile video lists.",
                        "default": "latest"
                    },
                    "oldestPostDateUnified": {
                        "title": "Oldest post date",
                        "type": "string",
                        "description": "Only include posts on or after this date. Use YYYY-MM-DD or number of days (e.g. 7 = last week)."
                    },
                    "newestPostDate": {
                        "title": "Newest post date",
                        "type": "string",
                        "description": "Only include posts on or before this date. Use YYYY-MM-DD."
                    },
                    "searchSection": {
                        "title": "Search section",
                        "enum": [
                            "",
                            "video",
                            "user"
                        ],
                        "type": "string",
                        "description": "Filter search results by type.",
                        "default": ""
                    },
                    "adsCountryCode": {
                        "title": "Analytics country",
                        "type": "string",
                        "description": "Country code for hashtag analytics and trend discovery (ISO 2-letter, e.g. US, FR, GB).",
                        "default": "US"
                    },
                    "adsTimeRange": {
                        "title": "Analytics time range (days)",
                        "enum": [
                            "7",
                            "30",
                            "120"
                        ],
                        "type": "string",
                        "description": "Lookback window for Creative Center analytics and trends.",
                        "default": "7"
                    },
                    "adsScrapeHashtags": {
                        "title": "Trend: hashtags",
                        "type": "boolean",
                        "description": "Fetch trending hashtags from Creative Center.",
                        "default": true
                    },
                    "adsScrapeSounds": {
                        "title": "Trend: sounds",
                        "type": "boolean",
                        "description": "Fetch trending sounds from Creative Center.",
                        "default": false
                    },
                    "adsScrapeCreators": {
                        "title": "Trend: creators",
                        "type": "boolean",
                        "description": "Fetch trending creators from Creative Center.",
                        "default": false
                    },
                    "adsScrapeVideos": {
                        "title": "Trend: videos",
                        "type": "boolean",
                        "description": "Fetch trending videos from Creative Center.",
                        "default": false
                    },
                    "adsHashtagIndustry": {
                        "title": "Hashtag industry filter",
                        "type": "string",
                        "description": "Filter trending hashtags by industry (e.g. Beauty & Personal Care)."
                    },
                    "adsNewOnBoard": {
                        "title": "New on board only",
                        "type": "boolean",
                        "description": "Only hashtags newly entered the trending board.",
                        "default": false
                    },
                    "adsRankType": {
                        "title": "Sound rank type",
                        "enum": [
                            "popular",
                            "surging"
                        ],
                        "type": "string",
                        "description": "Popular or surging sound ranking.",
                        "default": "popular"
                    },
                    "adsApprovedForBusinessUse": {
                        "title": "Business-approved sounds only",
                        "type": "boolean",
                        "description": "Only include sounds approved for commercial use.",
                        "default": false
                    },
                    "adsSortCreatorsBy": {
                        "title": "Sort creators by",
                        "enum": [
                            "follower",
                            "engagement",
                            "avg_views"
                        ],
                        "type": "string",
                        "description": "Ranking metric for trending creators.",
                        "default": "follower"
                    },
                    "adsFollowers": {
                        "title": "Creator follower bucket",
                        "type": "string",
                        "description": "Filter creators by follower count bucket (1–4)."
                    },
                    "adsAudienceCountry": {
                        "title": "Creator audience country",
                        "type": "string",
                        "description": "Filter trending creators by primary audience country."
                    },
                    "adsSortVideosBy": {
                        "title": "Sort trending videos by",
                        "enum": [
                            "vv",
                            "like",
                            "comment",
                            "repost"
                        ],
                        "type": "string",
                        "description": "Ranking metric for trending videos.",
                        "default": "vv"
                    },
                    "adsSoundsCountryCode": {
                        "title": "Sounds country",
                        "type": "string",
                        "description": "Country code for trending sounds.",
                        "default": "US"
                    },
                    "adsCreatorsCountryCode": {
                        "title": "Creators country",
                        "type": "string",
                        "description": "Country code for trending creators.",
                        "default": "US"
                    },
                    "adsVideosCountryCode": {
                        "title": "Videos country",
                        "type": "string",
                        "description": "Country code for trending videos.",
                        "default": "US"
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Apify Proxy is strongly recommended for reliable TikTok scraping at scale."
                    },
                    "maxConcurrency": {
                        "title": "Max concurrency",
                        "minimum": 1,
                        "maximum": 20,
                        "type": "integer",
                        "description": "Reserved for future parallel processing. Currently processed sequentially for stability.",
                        "default": 1
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
