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

🎵 TikTok Data Extractor Scraper collects profiles, videos, hashtags & comments—captions, sounds, views, likes, shares, timestamps & engagement. 🔎 Ideal for influencer discovery, trend tracking & competitor analysis. 📊 Fast, scalable exports to CSV/JSON. 🚀

- **URL**: https://apify.com/scraperx/tiktok-data-extractor-scraper.md
- **Developed by:** [ScraperX](https://apify.com/scraperx) (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 all‑in‑one TikTok data extractor that pulls structured video metadata from hashtags, user profiles, and direct video URLs — fast and at scale. It removes the need for multiple tools by unifying three workflows into a single TikTok scraper tool and reliable TikTok API alternative scraper. Built for marketers, developers, data analysts, and researchers, it powers trend tracking, creator analysis, and TikTok data export to CSV/JSON/Excel for downstream analytics and automation at scale. 🚀

### What data / output can you get?

Below are example data fields the actor saves to the Apify dataset in real time. Field names reflect the exact output keys pushed by the actor.

| Data field | Description | Example value |
| --- | --- | --- |
| id | TikTok video ID | 7234567890123456789 |
| sourceType | Source identifier | "profile" |
| hashtag / profile / videoUrl | Input identifier (present depending on source) | "travel" / "username" / "https://www.tiktok.com/@user/video/123..." |
| text | Video description | "Video description text" |
| createTimeISO | Creation timestamp (ISO 8601) | "2024-01-15T10:30:00.000Z" |
| webVideoUrl | Public web URL to the video | "https://www.tiktok.com/@username/video/1234567890" |
| authorMeta.name | Author uniqueId (username) | "username" |
| authorMeta.avatar | Author avatar URL | "https://..." |
| diggCount | Likes | 15000 |
| playCount | Views | 100000 |
| shareCount | Shares | 500 |
| commentCount | Comments | 1200 |
| videoMeta.duration | Video duration (seconds) | 30 |
| musicMeta.musicName | Track title | "Song Title" |
| musicMeta.musicAuthor | Track artist | "Artist Name" |
| isAd | Whether the video is an ad | false |
| locationCreated | Location (video URL items only) | "US" |
| hashtags | Hashtags detected on the post | [{"name":"travel"}] |

Notes:
- Each source preserves its native nested structure (hashtag, profile, or video URL) and adds a sourceType field for easy filtering.
- Export your dataset in JSON, CSV, or Excel directly from Apify for analytics pipelines and BI workflows.

### Key features

- 🚦 Unified multi‑source scraping  
  Scrape from hashtags, profiles, and direct video URLs in one run — a no‑code TikTok scraper workflow that consolidates a TikTok hashtag scraper, TikTok user profile scraper, and TikTok video metadata scraper.

- 🧭 Advanced profile filtering & sorting  
  Fine‑tune profile data with profileScrapeSections ("videos" or "reposts"), profileSorting ("latest", "oldest", "popular"), date range filters (after/before), and excludePinnedPosts for precision collection.

- 🔁 Related videos collection  
  Enable scrapeRelatedVideos to automatically collect recommended/related videos for each input URL — great for discovery, mapping, and TikTok competitor analysis scraper workflows.

- 🛡️ Intelligent proxy management  
  Starts without a proxy for speed, then auto‑falls back to Apify datacenter and residential proxies on 403/429 blocks or empty responses. Built‑in retries maximize success.

- 📡 Real‑time dataset streaming  
  Items are pushed as soon as they’re found. Monitor progress live and export anytime — perfect for dashboards and incremental pipelines.

- 🧰 Developer‑friendly, Python‑powered  
  Implemented in Python and Playwright, this TikTok data scraping tool is production‑ready on Apify. Use it as a robust TikTok API alternative scraper via the Apify API.

- 📦 Flexible exports & integrations  
  Export TikTok data to CSV, JSON, or Excel for analytics and automation — ideal for bulk TikTok data extraction and BI.

- 🔐 No login required  
  Scrapes only publicly available content. No session cookies or account credentials needed.

- 🧱 Production‑grade reliability  
  Adaptive scrolling, sequential processing per input, and robust error handling deliver dependable results for teams and pipelines.

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

1. Sign in to Apify  
   Create or log in to your account at console.apify.com.

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

3. Add input sources  
   - hashtags: Add one or more hashtag strings (without #).  
   - profiles: Add TikTok usernames or profile URLs; usernames will be extracted automatically.  
   - postURLs: Paste direct TikTok video URLs.

4. Set limits and options  
   - resultsPerPage: Choose how many videos to scrape per hashtag/profile and per related videos.  
   - Profile options: Configure profileScrapeSections, profileSorting, oldestPostDateUnified, newestPostDate, and excludePinnedPosts.  
   - Video URL options: Toggle scrapeRelatedVideos to collect recommended videos.

5. Configure network settings (optional)  
   Use proxyConfiguration if you want to start with Apify proxies. Otherwise, the actor begins without a proxy and automatically falls back as needed.

6. Start the run  
   Click Start. The run processes inputs sequentially and pushes items in real time to the dataset.

7. Monitor progress  
   Watch the Log and Dataset tabs to see items appear as each input completes.

8. Export results  
   In the Dataset tab, filter by sourceType/hashtag/profile/videoUrl and export to JSON, CSV, or Excel — or access programmatically via the Apify API.

Pro tip: Seed with a few high‑quality postURLs and enable scrapeRelatedVideos to quickly expand your dataset with similar content for trend analysis.

### Use cases

| Use case | Description |
| --- | --- |
| Social media marketing – competitor tracking | Track creator profiles, sort by latest/oldest/popular, and measure engagement to refine content strategy with a TikTok analytics data scraper. |
| Hashtag research – trend analysis | Collect videos from hashtags at scale to identify trending topics and high‑performing formats with a TikTok hashtag scraper. |
| Influencer discovery – performance screening | Shortlist creators by views, likes, and shares for campaigns using structured video‑level metrics. |
| Campaign monitoring – branded hashtags | Track campaign hashtags over time and export metrics for reporting. |
| Content discovery – related videos | Find similar content automatically by enabling related video collection from seed URLs. |
| Data analytics – metrics at scale | Export structured likes, views, shares, comments count, and timestamps for BI dashboards and time‑series analysis. |
| Academic research – social studies | Gather public TikTok video data for studying virality, attention dynamics, and media patterns. |

### Why choose Tiktok Data Extractor Scraper?

Tiktok Data Extractor Scraper combines precision, automation, and reliability in a single TikTok metadata scraper workflow.

- 🎯 Accurate, structured outputs preserving native nested formats per source type
- 🌐 No login required — scrapes publicly available data only
- 📈 Scales from small tests to large batches with sequential, real‑time processing
- 👩‍💻 Built on Apify with Python + Playwright — ideal for API pipelines and developer workflows
- 🔄 Automatic anti‑blocking with datacenter → residential proxy fallback and retries
- 💾 Easy exports (CSV, JSON, Excel) for downstream analytics and automation stacks
- 🧩 More reliable than brittle extensions — production‑ready infrastructure with consistent results

Bottom line: a dependable TikTok data scraping tool and TikTok API alternative scraper for marketers, analysts, and developers who need clean, scalable outputs.

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

Yes — when done responsibly. This actor collects only publicly available TikTok content and never attempts to access private profiles or protected data.

Guidelines for compliant use:
- Follow TikTok’s Terms of Service and local laws.
- Use only public data; do not attempt to bypass authentication.
- Respect data protection regulations (e.g., GDPR, CCPA).
- Don’t use data for spam, harassment, or illegal activities.
- Consult your legal team if you have edge cases or region‑specific requirements.

### Input parameters & output format

#### Example input JSON

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

#### Parameters

| Field | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| hashtags | array\[string] | No | — | Add one or more TikTok hashtags; the scraper collects data about videos containing each hashtag. |
| resultsPerPage | integer | No | 50 | Number of videos to scrape per hashtag or profile; also used as the max related videos per input video URL. Range: 1–1,000,000. |
| profiles | array\[string] | No | — | Add TikTok usernames or profile URLs to scrape their videos and profile data. |
| profileScrapeSections | array\["videos","reposts"] | No | \["videos"] | Choose which profile sections to scrape. |
| profileSorting | "latest" | "popular" | "oldest" | No | "latest" | Sorting for profile videos. Date filters work with "latest" and "oldest". |
| oldestPostDateUnified | string | No | — | Scrape profile videos published after this date. Supports absolute (YYYY‑MM‑DD) or relative days. |
| newestPostDate | string | No | — | Scrape profile videos published before this date. Supports absolute (YYYY‑MM‑DD) or relative days. |
| excludePinnedPosts | boolean | No | false | Exclude pinned posts from profiles. |
| postURLs | array\[string] | No | — | Direct TikTok video URLs to scrape. |
| scrapeRelatedVideos | boolean | No | false | If true, also collect related videos for each provided video URL (up to resultsPerPage). |
| proxyConfiguration | object | No | — | Configure proxies. By default, no proxy is used; the actor automatically falls back to datacenter, then residential proxies if blocked. |

#### Output format

The actor pushes items in real time to the dataset, tagging each with sourceType. Structures differ slightly by source to preserve compatibility with specialized scrapers.

- sourceType: "hashtag" | "profile" | "video\_url" | "video\_related"
- hashtag/profile/videoUrl: present when applicable for quick filtering

Example: Hashtag item

```json
{
  "id": "7234567890123456789",
  "sourceType": "hashtag",
  "hashtag": "travel",
  "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"}
  ]
}
```

Example: Profile item

```json
{
  "id": "7234567890123456789",
  "sourceType": "profile",
  "profile": "username",
  "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"
}
```

Example: Video URL item (also used for sourceType "video\_related")

```json
{
  "id": "7234567890123456789",
  "sourceType": "video_url",
  "videoUrl": "https://www.tiktok.com/@username/video/1234567890",
  "text": "Video description text",
  "textLanguage": "en",
  "createTime": 1705312200,
  "createTimeISO": "2024-01-15T10:30:00.000Z",
  "locationCreated": "US",
  "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",
  "submittedVideoUrl": "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
}
```

### FAQ

#### Do I need to log in to scrape TikTok with this tool?

No. The actor works without login and scrapes only publicly available content. It does not access private profiles or gated pages.

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

You control this via resultsPerPage. It accepts values from 1 up to 1,000,000 per hashtag/profile, and also limits related videos per input URL.

#### What sources are supported in one run?

You can provide any combination of hashtags, profiles (usernames or profile URLs), and direct postURLs. Each item is tagged with sourceType for easy filtering.

#### How does the proxy fallback work?

By default, the actor starts without a proxy for maximum speed. On 403/429 blocks or empty responses, it automatically switches to Apify datacenter proxies, then to residential proxies, with retries to maximize success.

#### Can it collect comments?

The actor extracts engagement metrics including commentCount, but it does not fetch full comment threads. You can still filter and analyze content using counts and other metadata.

#### Can I sort and filter profile videos?

Yes. Use profileSorting ("latest", "oldest", "popular"), oldestPostDateUnified/newestPostDate for date ranges, and excludePinnedPosts to remove pinned items. You can also scrape the "reposts" section by setting profileScrapeSections accordingly.

#### In what formats can I export the data?

You can export from the Apify dataset to JSON, CSV, or Excel, or access the dataset via the Apify API for integration with your pipelines.

#### How are inputs processed?

Sequentially. The actor processes all hashtags, then profiles, then video URLs, pushing items to the dataset in real time so you can monitor progress and start analysis early.

#### Is this a TikTok API alternative scraper?

Yes. It uses Playwright and HTTP requests to collect publicly available data, making it a robust TikTok API alternative scraper for developers and analysts.

### Closing thoughts

Tiktok Data Extractor Scraper is built to extract reliable, structured TikTok data from hashtags, profiles, and video URLs at scale. With advanced profile filters, optional related‑video discovery, automatic proxy fallback, and real‑time exports, it’s a practical choice for marketers, developers, analysts, and researchers. Run it on Apify, export TikTok data to CSV/JSON/Excel, or integrate via the API to power your analytics and automation workflows. Start extracting smarter insights from TikTok 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("scraperx/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("scraperx/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 scraperx/tiktok-data-extractor-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=scraperx/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 profiles, videos, hashtags & comments—captions, sounds, views, likes, shares, timestamps & engagement. 🔎 Ideal for influencer discovery, trend tracking & competitor analysis. 📊 Fast, scalable exports to CSV/JSON. 🚀",
        "version": "0.1",
        "x-build-id": "iHEn7B9uv4a8fkHvs"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/scraperx~tiktok-data-extractor-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-scraperx-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/scraperx~tiktok-data-extractor-scraper/runs": {
            "post": {
                "operationId": "runs-sync-scraperx-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/scraperx~tiktok-data-extractor-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-scraperx-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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
