# TikTok Scraper (`lentic_clockss/tiktok-scraper`) Actor

Scrape TikTok videos, profiles, hashtags, and search results. Get video URLs, play counts, likes, comments, shares, and more. Optional video download. No login required.

- **URL**: https://apify.com/lentic\_clockss/tiktok-scraper.md
- **Developed by:** [kane liu](https://apify.com/lentic_clockss) (community)
- **Categories:** Social media, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

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

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

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

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

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

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

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

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

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

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


# README

## TikTok Scraper

Scrape TikTok videos, profiles, hashtags, and search results at scale. Get video URLs, engagement metrics, author info, and optionally download video files. No login required.

### Features

- **4 scrape modes** — hashtag videos, user profiles, search results, specific video URLs
- **Full video metadata** — play count, likes, comments, shares, saves, duration, resolution
- **Video download** — optionally download video files to Apify Key-Value Store
- **Author data** — username, nickname, avatar, verified status
- **Anti-detection** — Patchright browser engine with residential proxy rotation
- **Smart scrolling** — randomized scroll behavior to load more content naturally
- **No login required** — uses TikTok's public web interface

### Output Fields

#### Video Data

| Field | Type | Description |
|-------|------|-------------|
| videoId | string | TikTok video ID |
| videoUrl | string | Direct link to video page |
| description | string | Video description/caption |
| playUrl | string | Direct video stream URL (time-limited) |
| downloadUrl | string | Apify KV Store URL (if downloadVideos=true) |
| coverUrl | string | Video cover image URL |
| playCount | integer | Number of views |
| likeCount | integer | Number of likes |
| commentCount | integer | Number of comments |
| shareCount | integer | Number of shares |
| collectCount | integer | Number of saves/bookmarks |
| author | string | Author username |
| authorName | string | Author display name |
| authorAvatar | string | Author avatar URL |
| authorVerified | boolean | Whether author is verified |
| hashtags | array | List of hashtags |
| duration | integer | Video duration in seconds |
| width | integer | Video width |
| height | integer | Video height |
| musicTitle | string | Background music title |
| musicAuthor | string | Background music artist |
| createTime | integer | Unix timestamp of creation |
| location | string | Location tag (if set) |
| scrapedAt | string | ISO timestamp of scrape |

#### User Profile Data (when mode=user)

| Field | Type | Description |
|-------|------|-------------|
| uniqueId | string | Username |
| nickname | string | Display name |
| signature | string | Bio/description |
| followerCount | integer | Number of followers |
| followingCount | integer | Number of following |
| heartCount | integer | Total likes received |
| videoCount | integer | Number of videos |
| verified | boolean | Verified status |
| profileUrl | string | Profile page URL |

### Input Parameters

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| mode | string | hashtag | Scrape mode: hashtag, user, search, video |
| hashtags | array | ["ai","tech"] | Hashtags (without #) for hashtag mode |
| profiles | array | ["tiktok"] | Usernames (without @) for user mode |
| keywords | array | | Search terms for search mode |
| videoUrls | array | | Direct video URLs for video mode |
| maxResults | integer | 50 | Maximum items to collect |
| downloadVideos | boolean | false | Download video files to KV Store |
| maxScrolls | integer | 15 | Max scroll actions for loading |
| pageTimeout | integer | 120 | Page load timeout (seconds) |

### Example: Scrape hashtag videos

**Input:**
```json
{
  "mode": "hashtag",
  "hashtags": ["ai", "machinelearning"],
  "maxResults": 20
}
````

### Example: Scrape user profile + videos

**Input:**

```json
{
  "mode": "user",
  "profiles": ["openai", "google"],
  "maxResults": 30
}
```

### Example: Download videos

**Input:**

```json
{
  "mode": "hashtag",
  "hashtags": ["recipe"],
  "maxResults": 10,
  "downloadVideos": true
}
```

Each result will include a `downloadUrl` field pointing to the video file stored in Apify Key-Value Store.

### Use Cases

- **Social media monitoring** — Track hashtag trends and engagement metrics
- **Competitor analysis** — Monitor competitor accounts and content performance
- **Content research** — Find trending videos in your niche
- **Influencer discovery** — Identify top creators by engagement metrics
- **Market research** — Analyze content trends by topic, region, or industry
- **Video archival** — Download and archive TikTok content

### Next Step: Turn Content Signals Into Hiring Intelligence

Use this Actor as your free top-of-funnel tool for trend discovery, creator research, and audience signal collection. Once you know which topics, brands, or niches are gaining traction, the next step is often understanding where companies are hiring and how demand is shifting.

If you want a paid Actor for that workflow, see [LinkedIn Jobs Scraper](https://apify.com/lentic_clockss/linkedin-jobs-scraper).

Typical workflow:

- Use **TikTok Scraper** to find trending themes, creators, and content angles.
- Shortlist brands, product categories, or fast-growing niches.
- Use **LinkedIn Jobs Scraper** to track hiring demand, role types, locations, and expansion signals.

This pairing works well for market research teams, agencies, recruiters, and founders who want to connect social momentum with real hiring activity.

### Performance

- \~10-15 seconds per page load (with anti-detection)
- \~5-10 videos per scroll action
- 50 videos: ~2-3 minutes
- 200 videos: ~8-12 minutes
- Video download adds ~2-5 seconds per video

### Video URLs

The `playUrl` field contains a direct URL to the video stream. Note:

- URLs are **time-limited** (typically valid for a few hours)
- URLs may require a `Referer: https://www.tiktok.com/` header to download
- Videos include TikTok's watermark
- Enable `downloadVideos` for persistent storage in Apify KV Store

### Proxy

This Actor uses its own residential proxy pool for reliable access. No additional proxy configuration needed.

# Actor input Schema

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

What to scrape from TikTok

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

Hashtags to scrape (without #). Used when mode is 'hashtag'.

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

TikTok usernames to scrape (without @). Used when mode is 'user'.

## `keywords` (type: `array`):

Keywords to search for. Used when mode is 'search'.

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

Direct TikTok video URLs. Used when mode is 'video'.

## `maxResults` (type: `integer`):

Maximum number of items to scrape

## `downloadVideos` (type: `boolean`):

Download video files and store them in Apify Key-Value Store. Each video adds a downloadUrl field. Increases cost and run time.

## `maxScrolls` (type: `integer`):

Maximum number of scroll actions to load more content. More scrolls = more results but slower.

## `pageTimeout` (type: `integer`):

Maximum time to wait for page to load

## Actor input object example

```json
{
  "mode": "hashtag",
  "hashtags": [
    "ai",
    "tech"
  ],
  "profiles": [
    "tiktok"
  ],
  "keywords": [
    "AI automation"
  ],
  "maxResults": 50,
  "downloadVideos": false,
  "maxScrolls": 15,
  "pageTimeout": 120
}
```

# Actor output Schema

## `tiktokData` (type: `string`):

Dataset containing scraped TikTok items

# 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": [
        "ai",
        "tech"
    ],
    "profiles": [
        "tiktok"
    ],
    "keywords": [
        "AI automation"
    ]
};

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

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

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

```

## Python example

```python
from apify_client import ApifyClient

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

# Prepare the Actor input
run_input = {
    "hashtags": [
        "ai",
        "tech",
    ],
    "profiles": ["tiktok"],
    "keywords": ["AI automation"],
}

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

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "hashtags": [
    "ai",
    "tech"
  ],
  "profiles": [
    "tiktok"
  ],
  "keywords": [
    "AI automation"
  ]
}' |
apify call lentic_clockss/tiktok-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "TikTok Scraper",
        "description": "Scrape TikTok videos, profiles, hashtags, and search results. Get video URLs, play counts, likes, comments, shares, and more. Optional video download. No login required.",
        "version": "0.1",
        "x-build-id": "Dz3qcO2zTXcgRQFOy"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/lentic_clockss~tiktok-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-lentic_clockss-tiktok-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/lentic_clockss~tiktok-scraper/runs": {
            "post": {
                "operationId": "runs-sync-lentic_clockss-tiktok-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/lentic_clockss~tiktok-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-lentic_clockss-tiktok-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "mode": {
                        "title": "Scrape mode",
                        "enum": [
                            "hashtag",
                            "user",
                            "search",
                            "video"
                        ],
                        "type": "string",
                        "description": "What to scrape from TikTok",
                        "default": "hashtag"
                    },
                    "hashtags": {
                        "title": "Hashtags",
                        "type": "array",
                        "description": "Hashtags to scrape (without #). Used when mode is 'hashtag'.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "profiles": {
                        "title": "User profiles",
                        "type": "array",
                        "description": "TikTok usernames to scrape (without @). Used when mode is 'user'.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "keywords": {
                        "title": "Search keywords",
                        "type": "array",
                        "description": "Keywords to search for. Used when mode is 'search'.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "videoUrls": {
                        "title": "Video URLs",
                        "type": "array",
                        "description": "Direct TikTok video URLs. Used when mode is 'video'.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxResults": {
                        "title": "Max results",
                        "minimum": 1,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Maximum number of items to scrape",
                        "default": 50
                    },
                    "downloadVideos": {
                        "title": "Download videos",
                        "type": "boolean",
                        "description": "Download video files and store them in Apify Key-Value Store. Each video adds a downloadUrl field. Increases cost and run time.",
                        "default": false
                    },
                    "maxScrolls": {
                        "title": "Max scroll actions",
                        "minimum": 1,
                        "maximum": 50,
                        "type": "integer",
                        "description": "Maximum number of scroll actions to load more content. More scrolls = more results but slower.",
                        "default": 15
                    },
                    "pageTimeout": {
                        "title": "Page timeout (seconds)",
                        "minimum": 60,
                        "maximum": 300,
                        "type": "integer",
                        "description": "Maximum time to wait for page to load",
                        "default": 120
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
