# Tiktok Data Extractor Scraper (`scrapapi/tiktok-data-extractor-scraper`) Actor

📲 TikTok Data Extractor Scraper collects public TikTok profiles, videos, captions, hashtags, views, likes, comments & sounds at scale. 🔍 Export CSV/JSON for analytics, influencer discovery, trend tracking & competitor insights. 🚀 Perfect for marketing, research & growth.

- **URL**: https://apify.com/scrapapi/tiktok-data-extractor-scraper.md
- **Developed by:** [ScrapAPI](https://apify.com/scrapapi) (community)
- **Categories:** Automation, Lead generation, Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$19.99/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period.You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

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

## 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 Data Extractor Scraper

Tiktok Data Extractor Scraper is an Apify actor that collects public TikTok data from hashtags, profiles, and direct video URLs at scale — a unified tiktok data scraper and tiktok data extractor for marketers, developers, analysts, and researchers. It solves the challenge of building reliable, structured TikTok datasets without manual browsing, and powers workflows like influencer research, trend tracking, and competitive analysis with a scalable tiktok scraping tool.

### What data / output can you get?

| Data field | Description | Example value |
| --- | --- | --- |
| id | Unique video identifier | “7234567890123456789” |
| sourceType | Source tag for the item | “hashtag”, “profile”, “video_url”, “video_related” |
| hashtag | Hashtag input that yielded the item (hashtag items only) | “travel” |
| profile | Username that yielded the item (profile items only) | “tiktok” |
| videoUrl | Submitted video URL or derived URL | “https://www.tiktok.com/@user/video/1234567890” |
| text | Video description/caption | “Hiking the Alps 🏔️ #travel #adventure” |
| createTimeISO | Creation time in ISO 8601 | “2024-01-15T10:30:00.000Z” |
| diggCount | Number of likes | 15000 |
| playCount | Number of views | 100000 |
| commentCount | Number of comments | 1200 |
| shareCount | Number of shares | 500 |
| webVideoUrl | Canonical TikTok video URL | “https://www.tiktok.com/@username/video/1234567890” |
| videoMeta.duration | Video duration (seconds) | 30 |
| authorMeta.name | Author’s uniqueId/username | “username” |
| authorMeta.avatar | Author’s avatar URL | “https://…” |
| musicMeta.musicName | Music track title | “original sound” |
| musicMeta.musicAuthor | Music author/artist | “Artist Name” |

Notes:
- Outputs also include nested structures like authorMeta, musicMeta, videoMeta, and arrays such as hashtags, mentions, and effectStickers (when available).
- Export your dataset in JSON, CSV, Excel, or XML directly from Apify.

### Key features

- 🚀 Unified multi-source scraping  
  One workflow for hashtags, profiles, and direct video URLs. Build a consistent tiktok dataset builder pipeline without juggling separate tools.

- 🔎 Keyword discovery & related videos  
  Resolve more content from each seed: collect related videos for every input URL, and expand datasets discovered through browsing flows. Perfect for a tiktok web crawler approach to exploration.

- 🧭 Advanced profile controls  
  Date range filtering (absolute or relative), sorting (latest, oldest, popular), sections (videos or reposts), and optional pinned-post exclusion — a robust tiktok profile scraper for monitoring.

- 🧱 Scalable & accurate extraction  
  Robust parsing for author, video, and music metadata (likes, views, comments, duration, dimensions, formats, subtitles, and more) — an accurate tiktok video metadata scraper.

- 🌐 Intelligent proxy fallback  
  Automatic escalation from no proxy → datacenter → residential with retries on 403/429 or empty responses. Block-aware resilience keeps large runs moving.

- 🧑‍💻 Developer-friendly & API-ready  
  Built on Apify’s platform with dataset outputs you can pipe into BI tools or code. Use it as a tiktok scraping api in workflows, ETL pipes, or analytics stacks.

- 🔌 Workflow integrations  
  Export to CSV/JSON for downstream systems, connect to Make, n8n, or your internal pipelines for automated tiktok data collection tool setups.

- 🏗️ Production-ready reliability  
  Sequential task execution, real-time dataset writes, and resilient request handling make it a dependable tiktok scraping tool for ongoing operations.

### How to use Tiktok Data Extractor Scraper - step by step

1. Create or log in to your Apify account  
   Go to console.apify.com and sign in.

2. Open the actor  
   Find “Tiktok Data Extractor Scraper” in your Actors and open it.

3. Choose your starting points  
   - Add one or more hashtags (without “#”) under “#️⃣ Videos with this hashtag”.  
   - Add TikTok usernames or profile URLs under “😎 Profiles”.  
   - Add direct TikTok “🔗 Video URLs” to target specific videos.

4. Set result limits  
   Define “💯 Number of videos per hashtag, profile, search, or related” to control how many items you collect per source.

5. Configure profile options (optional)  
   - Select “Profile sections to scrape” (videos or reposts).  
   - Choose “Profile video sorting” (latest, oldest, popular).  
   - Set “Scrape profile videos published after/before [date]” and “Exclude pinned posts” if needed.

6. Include related videos (optional)  
   Toggle “Include related videos for each URL” to enrich your tiktok dataset builder with recommended content.

7. Network settings (optional)  
   Adjust “Proxy Configuration” or leave it blank to let the actor start without a proxy and auto-fallback if needed.

8. Run and monitor  
   Click Start. Watch progress in Logs and see items appear in the Dataset in real time.

9. Export results  
   In the Dataset tab, filter by sourceType, hashtag, profile, or videoUrl and export as JSON, CSV, Excel, or XML.

Pro tip: Chain this tiktok scraping tool into your analytics or CRM using the Apify API for scheduled runs and automated refreshes.

### Use cases

| Use case | Description |
| --- | --- |
| Marketing – Competitor monitoring | Track competitor profiles and content performance to inform campaign strategy. |
| Influencer discovery – Niche creators | Identify high-performing creators by hashtag or profile metrics for outreach. |
| Trend tracking – Hashtag insights | Monitor trending hashtags, capture engagement, and analyze virality patterns. |
| Content research – Best formats | Analyze views/likes/comments to learn which formats and topics resonate. |
| Data analytics – Time series | Build longitudinal datasets of creator/video stats for dashboards and modeling. |
| Academic research – Social studies | Collect structured, public TikTok data for studies and hypothesis testing. |
| API pipelines – ETL & enrichment | Use the tiktok scraping api output for data warehouses, BI, and enrichment. |
| Content curation – Recommendations | Expand collections with related videos to power newsletters or playlists. |

### Why choose Tiktok Data Extractor Scraper?

Tiktok Data Extractor Scraper combines precision, automation, and reliability for production-grade TikTok data extraction.

- ✅ Accurate, structured outputs: Author, video, music, and engagement fields for analytics-ready datasets.
- 🌍 Flexible scale: Handles large batches with sequential processing and real-time dataset writes.
- 🧑‍💻 Developer access: Integrate the dataset with your apps, scripts, or data platforms.
- 🔒 Safe by design: Scrapes public data only; no private profiles or authentication required.
- 🔁 Robust anti-blocking: Automatic proxy fallback (none → datacenter → residential) with block detection.
- 💰 Cost-effective automation: Export to CSV/JSON/Excel for use across teams and tools.
- 🔗 Integration-friendly: Ideal as a tiktok data collection tool within Make, n8n, and internal pipelines.

This tiktok data extractor outperforms ad-hoc browser extensions and unstable scripts by running on a scalable, resilient backend with consistent output structures.

### Is it legal / ethical to use Tiktok Data Extractor Scraper?

Yes — when used responsibly.  
This actor scrapes only publicly available TikTok data and does not access private profiles or password-protected content.

Guidelines:
- Comply with TikTok’s Terms of Service and your local laws (e.g., GDPR, CCPA).
- Collect and use public data responsibly; do not use for spam, harassment, or illegal activities.
- Verify compliance for your specific use case with your legal team if unsure.

### Input parameters & output format

#### Example JSON input
```json
{
  "hashtags": ["travel", "adventure"],
  "profiles": ["https://www.tiktok.com/@mrbeast"],
  "postURLs": ["https://www.tiktok.com/@user/video/1234567890"],
  "resultsPerPage": 100,
  "profileScrapeSections": ["videos"],
  "profileSorting": "latest",
  "oldestPostDateUnified": "2025-04-04",
  "newestPostDate": "2025-09-09",
  "excludePinnedPosts": false,
  "scrapeRelatedVideos": true,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
````

#### Input fields

| Field | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| hashtags | array of strings | No | — | Add one or more TikTok hashtags to collect videos containing those hashtags. |
| resultsPerPage | integer (1–1,000,000) | No | 50 | Number of videos to scrape per hashtag or profile; also used as max per related videos. |
| profiles | array of strings | No | — | TikTok usernames or profile URLs whose videos and profile data you want to scrape. |
| profileScrapeSections | array of strings (“videos”, “reposts”) | No | \["videos"] | Choose profile sections to scrape. |
| profileSorting | string (“latest”, “popular”, “oldest”) | No | "latest" | Sorting for profile videos; date filters only work with latest/oldest. |
| oldestPostDateUnified | string | No | — | Filter profile videos published after a date (absolute YYYY-MM-DD or relative days). |
| newestPostDate | string | No | — | Filter profile videos published before a date (absolute YYYY-MM-DD or relative days). |
| excludePinnedPosts | boolean | No | false | Exclude pinned posts from profile results. |
| postURLs | array of strings | No | — | Direct TikTok video URLs to scrape. |
| scrapeRelatedVideos | boolean | No | false | Also collect related videos for each provided video URL (up to resultsPerPage). |
| proxyConfiguration | object | No | — | Configure proxies. By default, no proxy is used; actor auto-fallbacks on blocks. |

#### Output format

Results are written to the Apify dataset in real time. Items include a sourceType tag for easy filtering across inputs.

- Hashtag items (sourceType: "hashtag")\
  Example:

```json
{
  "id": "7234567890123456789",
  "text": "Video description text",
  "createTime": 1705312200,
  "createTimeISO": "2024-01-15T10:30:00.000Z",
  "isAd": false,
  "isMuted": false,
  "authorMeta": {
    "id": "123456789",
    "name": "username",
    "nickName": "Display Name",
    "verified": false,
    "signature": "Bio text",
    "bioLink": null,
    "avatar": "https://...",
    "privateAccount": false,
    "ttSeller": false,
    "following": 100,
    "fans": 10000,
    "heart": 50000,
    "video": 200,
    "digg": 100000
  },
  "musicMeta": {
    "musicName": "Song Title",
    "musicAuthor": "Artist Name",
    "musicOriginal": false,
    "musicAlbum": "",
    "playUrl": "https://...",
    "coverMediumUrl": "https://...",
    "musicId": "67890"
  },
  "webVideoUrl": "https://www.tiktok.com/@username/video/1234567890",
  "mediaUrls": [],
  "videoMeta": {
    "height": 1920,
    "width": 1080,
    "duration": 30,
    "coverUrl": "https://...",
    "originalCoverUrl": "https://...",
    "definition": "720p",
    "format": "",
    "originalDownloadAddr": "https://...",
    "downloadAddr": "https://..."
  },
  "diggCount": 15000,
  "shareCount": 500,
  "playCount": 100000,
  "collectCount": 200,
  "commentCount": 1200,
  "mentions": [],
  "hashtags": [
    { "name": "travel" },
    { "name": "adventure" }
  ],
  "sourceType": "hashtag",
  "hashtag": "travel"
}
```

- Profile items (sourceType: "profile")\
  Example:

```json
{
  "id": "7234567890123456789",
  "text": "Video description text",
  "textLanguage": "en",
  "createTime": 1705312200,
  "createTimeISO": "2024-01-15T10:30:00.000Z",
  "isAd": false,
  "authorMeta": {
    "id": "123456789",
    "name": "username",
    "profileUrl": "https://www.tiktok.com/@username",
    "nickName": "Display Name",
    "verified": false,
    "signature": "Bio text",
    "bioLink": null,
    "originalAvatarUrl": "https://...",
    "avatar": "https://...",
    "commerceUserInfo": { "commerceUser": false },
    "privateAccount": false,
    "roomId": "",
    "ttSeller": false,
    "followDatasetUrl": null,
    "following": 100,
    "friends": 50,
    "fans": 10000,
    "heart": 50000,
    "video": 200,
    "digg": 100000
  },
  "musicMeta": {
    "musicName": "Song Title",
    "musicAuthor": "Artist Name",
    "musicOriginal": false,
    "playUrl": "https://...",
    "coverMediumUrl": "https://...",
    "originalCoverMediumUrl": "https://...",
    "musicId": "67890"
  },
  "locationMeta": {
    "address": "",
    "city": "",
    "cityCode": "",
    "countryCode": "",
    "locationName": "",
    "locationId": ""
  },
  "webVideoUrl": "https://www.tiktok.com/@username/video/1234567890",
  "mediaUrls": [],
  "commentsDatasetUrl": null,
  "videoMeta": {
    "height": 1920,
    "width": 1080,
    "duration": 30,
    "coverUrl": "https://...",
    "originalCoverUrl": "https://...",
    "definition": "720p",
    "format": "mp4",
    "subtitleLinks": []
  },
  "diggCount": 15000,
  "shareCount": 500,
  "playCount": 100000,
  "collectCount": 200,
  "commentCount": 1200,
  "repostCount": 50,
  "mentions": [],
  "detailedMentions": [],
  "hashtags": [{ "name": "travel" }],
  "effectStickers": [],
  "isSlideshow": false,
  "isPinned": false,
  "isSponsored": false,
  "input": "username",
  "fromProfileSection": "videos",
  "sourceType": "profile",
  "profile": "username"
}
```

- Video URL items (sourceType: "video\_url" or "video\_related")\
  Example:

```json
{
  "id": "7234567890123456789",
  "text": "Video description text",
  "textLanguage": "en",
  "createTime": 1705312200,
  "createTimeISO": "2024-01-15T10:30:00.000Z",
  "locationCreated": "",
  "isAd": false,
  "authorMeta": {
    "id": "123456789",
    "name": "username",
    "profileUrl": "https://www.tiktok.com/@username",
    "nickName": "Display Name",
    "verified": false,
    "signature": "Bio text",
    "bioLink": null,
    "originalAvatarUrl": "https://...",
    "avatar": "https://...",
    "privateAccount": false,
    "roomId": "",
    "ttSeller": false,
    "followDatasetUrl": null,
    "following": 100,
    "friends": 50,
    "fans": 10000,
    "heart": 50000,
    "video": 200,
    "digg": 100000
  },
  "musicMeta": {
    "musicName": "Song Title",
    "musicAuthor": "Artist Name",
    "musicOriginal": true,
    "playUrl": "https://...",
    "coverMediumUrl": "https://...",
    "originalCoverMediumUrl": "https://...",
    "musicId": "67890"
  },
  "webVideoUrl": "https://www.tiktok.com/@username/video/1234567890",
  "mediaUrls": [],
  "commentsDatasetUrl": null,
  "videoMeta": {
    "height": 1920,
    "width": 1080,
    "duration": 30,
    "coverUrl": "https://...",
    "originalCoverUrl": "https://...",
    "definition": "720p",
    "format": "mp4",
    "subtitleLinks": []
  },
  "diggCount": 15000,
  "shareCount": 500,
  "playCount": 100000,
  "collectCount": 200,
  "commentCount": 1200,
  "repostCount": 50,
  "mentions": [],
  "detailedMentions": [],
  "hashtags": [{ "name": "travel" }],
  "effectStickers": [],
  "isSlideshow": false,
  "isPinned": false,
  "isSponsored": false,
  "submittedVideoUrl": "https://www.tiktok.com/@username/video/1234567890",
  "sourceType": "video_url",
  "videoUrl": "https://www.tiktok.com/@username/video/1234567890"
}
```

Source identification fields:

- sourceType: “hashtag”, “profile”, “video\_url”, or “video\_related”
- hashtag: present for hashtag items
- profile: present for profile items
- videoUrl: present for video\_url and video\_related items

### FAQ

#### How does the proxy fallback work?

The actor starts without a proxy for speed. If TikTok returns 403/429 or empty responses, it automatically switches to datacenter proxies and then to residential proxies with retries. After fallback, it continues with the working proxy type to maintain stability.

#### How are inputs processed?

Inputs are processed sequentially: all hashtags first, then profiles, then video URLs. Each item is written to the dataset in real time, so you can monitor progress as results stream in.

#### Can it scrape private profiles?

No. The actor only scrapes publicly available content. Private profiles and password-protected content are not accessible.

#### How many videos can I scrape per source?

The resultsPerPage parameter accepts 1 to 1,000,000. Practical throughput depends on TikTok rate limiting and source size. For very large profiles, use date filters to break runs into batches.

#### Does it include reposts?

Yes. Set “Profile sections to scrape” to include “reposts” if a profile has them available.

#### Do date filters work with all sorts?

Date filters are designed for “latest” and “oldest”. When using “popular” sorting, date filtering may be less effective due to popularity-based ordering.

#### What about data accuracy?

Data is extracted from TikTok’s web interface responses at scrape time. Counts like likes, views, and comments reflect the moment of collection and may change later.

#### How long does a run take?

Run time depends on the number of sources, resultsPerPage, network conditions, and any proxy fallback. Because processing is sequential, total time is the sum of individual tasks, with items appearing in the dataset as they are found.

#### What happens if a hashtag/profile/video is invalid?

The actor logs a warning and continues with the remaining inputs. One failed source won’t stop the entire run.

#### Why are there different output structures?

To preserve compatibility with specialized scrapers, each source type maintains its nested structure while adding a sourceType tag for unified filtering.

### Closing CTA / Final thoughts

Tiktok Data Extractor Scraper is built to extract structured, public TikTok data at scale for marketing, research, and analytics. With unified inputs (hashtags, profiles, video URLs), robust proxy fallback, and real-time dataset output, it empowers marketers, developers, data analysts, and researchers to build reliable TikTok datasets fast. Export to CSV/JSON/Excel, integrate via the Apify API, and automate your tiktok data scraper workflows. Start extracting smarter insights and accelerate your TikTok data pipelines today.

# Actor input Schema

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

Just add one or more TikTok hashtags and the scraper will collect data about videos containing this hashtag: likes, users, followers and more. You can enter the hashtags one by one, or use the Bulk edit section to add a prepared list.

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

Add the number of tiktoks you want to scrape per hashtag or profile. Also used as: max video results per keyword search and max related videos per input video URL.

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

Alternatively, add one or multiple TikTok usernames whose videos and profile data you want to scrape. Don't forget to fill out the 💯 Number of videos you want to scrape in the section above.

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

If a profile has reposted videos, you can scrape them by selecting 'Reposts'

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

Select Latest to scrape the most recent videos first, Oldest - the oldest videos first, Popular - the most popular videos first. Date filters only work with Latest and Oldest. Only supported for Videos section

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

Use Absolute tab for specific dates (YYYY-MM-DD) or Relative tab for days ago (e.g., 7 for last 7 days)

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

Use Absolute tab for specific dates (YYYY-MM-DD) or Relative tab for days ago (e.g., 0 for today)

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

Tick to exclude pinned posts from profiles. Pinned posts are usually the first videos on a profile's page.

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

Add the URLs of tiktok videos you want to scrape. You can paste video URLs one by one, or use the Bulk edit section to add a prepared list.

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

If enabled, for every provided video URL the actor will also collect 'related' videos visible on the page (up to the Number of videos setting).

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

Choose which proxies to use. By default, no proxy is used. If TikTok rejects or blocks the request, the actor will automatically fallback to datacenter proxy, then residential proxy if needed.

## Actor input object example

```json
{
  "hashtags": [
    "travel"
  ],
  "resultsPerPage": 50,
  "profiles": [
    "https://www.tiktok.com/@mrbeast"
  ],
  "profileScrapeSections": [
    "videos"
  ],
  "profileSorting": "latest",
  "excludePinnedPosts": false,
  "postURLs": [
    "https://www.tiktok.com/@mrbeast/video/7558512477600861471"
  ],
  "scrapeRelatedVideos": false,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# API

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

## JavaScript example

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

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

// Prepare Actor input
const input = {
    "hashtags": [
        "travel"
    ],
    "profiles": [
        "https://www.tiktok.com/@mrbeast"
    ],
    "postURLs": [
        "https://www.tiktok.com/@mrbeast/video/7558512477600861471"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

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

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

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

```

## Python example

```python
from apify_client import ApifyClient

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

# Prepare the Actor input
run_input = {
    "hashtags": ["travel"],
    "profiles": ["https://www.tiktok.com/@mrbeast"],
    "postURLs": ["https://www.tiktok.com/@mrbeast/video/7558512477600861471"],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("scrapapi/tiktok-data-extractor-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 '{
  "hashtags": [
    "travel"
  ],
  "profiles": [
    "https://www.tiktok.com/@mrbeast"
  ],
  "postURLs": [
    "https://www.tiktok.com/@mrbeast/video/7558512477600861471"
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call scrapapi/tiktok-data-extractor-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Tiktok Data Extractor Scraper",
        "description": "📲 TikTok Data Extractor Scraper collects public TikTok profiles, videos, captions, hashtags, views, likes, comments & sounds at scale. 🔍 Export CSV/JSON for analytics, influencer discovery, trend tracking & competitor insights. 🚀 Perfect for marketing, research & growth.",
        "version": "0.1",
        "x-build-id": "phBYgdHbcJpH8TzXj"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/scrapapi~tiktok-data-extractor-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-scrapapi-tiktok-data-extractor-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/scrapapi~tiktok-data-extractor-scraper/runs": {
            "post": {
                "operationId": "runs-sync-scrapapi-tiktok-data-extractor-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/scrapapi~tiktok-data-extractor-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-scrapapi-tiktok-data-extractor-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": {
                    "hashtags": {
                        "title": "#️⃣ Videos with this hashtag",
                        "type": "array",
                        "description": "Just add one or more TikTok hashtags and the scraper will collect data about videos containing this hashtag: likes, users, followers and more. You can enter the hashtags one by one, or use the Bulk edit section to add a prepared list.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "resultsPerPage": {
                        "title": "💯 Number of videos per hashtag, profile, search, or related",
                        "minimum": 1,
                        "maximum": 1000000,
                        "type": "integer",
                        "description": "Add the number of tiktoks you want to scrape per hashtag or profile. Also used as: max video results per keyword search and max related videos per input video URL.",
                        "default": 50
                    },
                    "profiles": {
                        "title": "😎 Profiles",
                        "type": "array",
                        "description": "Alternatively, add one or multiple TikTok usernames whose videos and profile data you want to scrape. Don't forget to fill out the 💯 Number of videos you want to scrape in the section above.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "profileScrapeSections": {
                        "title": "Profile sections to scrape",
                        "type": "array",
                        "description": "If a profile has reposted videos, you can scrape them by selecting 'Reposts'",
                        "items": {
                            "type": "string",
                            "enum": [
                                "videos",
                                "reposts"
                            ]
                        },
                        "default": [
                            "videos"
                        ]
                    },
                    "profileSorting": {
                        "title": "Profile video sorting",
                        "enum": [
                            "latest",
                            "popular",
                            "oldest"
                        ],
                        "type": "string",
                        "description": "Select Latest to scrape the most recent videos first, Oldest - the oldest videos first, Popular - the most popular videos first. Date filters only work with Latest and Oldest. Only supported for Videos section",
                        "default": "latest"
                    },
                    "oldestPostDateUnified": {
                        "title": "Scrape profile videos published after [date]",
                        "type": "string",
                        "description": "Use Absolute tab for specific dates (YYYY-MM-DD) or Relative tab for days ago (e.g., 7 for last 7 days)"
                    },
                    "newestPostDate": {
                        "title": "Scrape videos published before [date]",
                        "type": "string",
                        "description": "Use Absolute tab for specific dates (YYYY-MM-DD) or Relative tab for days ago (e.g., 0 for today)"
                    },
                    "excludePinnedPosts": {
                        "title": "Exclude pinned posts",
                        "type": "boolean",
                        "description": "Tick to exclude pinned posts from profiles. Pinned posts are usually the first videos on a profile's page.",
                        "default": false
                    },
                    "postURLs": {
                        "title": "🔗 Video URLs",
                        "type": "array",
                        "description": "Add the URLs of tiktok videos you want to scrape. You can paste video URLs one by one, or use the Bulk edit section to add a prepared list.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "scrapeRelatedVideos": {
                        "title": "Include related videos for each URL",
                        "type": "boolean",
                        "description": "If enabled, for every provided video URL the actor will also collect 'related' videos visible on the page (up to the Number of videos setting).",
                        "default": false
                    },
                    "proxyConfiguration": {
                        "title": "Proxy Configuration",
                        "type": "object",
                        "description": "Choose which proxies to use. By default, no proxy is used. If TikTok rejects or blocks the request, the actor will automatically fallback to datacenter proxy, then residential proxy if needed."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
