# TikTok Scraper — Profiles, Videos, Stats & Hashtags (`hichemdev/tiktok-scraper`) Actor

Scrape TikTok profiles and videos: play/like/comment/share counts, captions, hashtags, music, and author info. By username or video URL.

- **URL**: https://apify.com/hichemdev/tiktok-scraper.md
- **Developed by:** [Hichem Ben Moussa](https://apify.com/hichemdev) (community)
- **Categories:** Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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 — Profiles, Videos, Stats & Hashtags

**Scrape TikTok profiles and videos without an API key — follower counts, play/like/comment/share stats, captions, hashtags, music, and author info — as clean structured data.**

Give it usernames or video links and export to CSV, Excel, JSON, or Google Sheets.

***

### ✨ What you get

**Per profile**

| Field | Example |
|---|---|
| username / nickname | tiktok · TikTok |
| verified | true |
| followers / following | 82,000,000 · 6 |
| likes | 340,000,000 |
| videosCount | 1,024 |
| signature, avatar, url | bio + links |

**Per video**

| Field | Example |
|---|---|
| id / url | direct video link |
| description | caption text |
| stats | plays, likes, comments, shares, saves |
| hashtags | \["fyp", "viral"] |
| music | title + author |
| author | username, nickname, verified |
| createTime, durationSecs, cover | metadata |

***

### 🎯 Who it's for

- **Influencer marketing** — vet creators by real follower and engagement numbers.
- **Social & brand teams** — track your own or competitors' TikTok performance.
- **Trend research** — pull hashtags, sounds, and top videos for a niche.
- **Analytics & dashboards** — feed structured TikTok data into your reports.

***

### 🚀 How to use it

1. Add **profiles** (usernames or profile URLs) to get profile stats, **and/or** specific **video URLs** to get full per-video metrics.
2. Set **max videos per profile**.
3. Click **Start** and export.

> **Tip:** For video-level data (plays, likes, comments, shares), provide the **video URLs**. TikTok limits logged-out access to a profile's full video feed, so profile input returns the profile's own stats.

TikTok blocks datacenter traffic, so the Actor uses **residential proxy** (included in your Apify plan) for reliable results.

***

### 📥 Example input

```json
{
  "profiles": ["tiktok", "https://www.tiktok.com/@nasa"],
  "maxVideosPerProfile": 20
}
```

Scrape specific videos:

```json
{
  "videoUrls": ["https://www.tiktok.com/@tiktok/video/7300000000000000000"]
}
```

***

### 📤 Example output

Profile record:

```json
{
  "type": "profile",
  "username": "tiktok",
  "nickname": "TikTok",
  "verified": true,
  "followers": 82000000,
  "likes": 340000000,
  "videosCount": 1024,
  "url": "https://www.tiktok.com/@tiktok"
}
```

Video record:

```json
{
  "type": "video",
  "id": "7300000000000000000",
  "url": "https://www.tiktok.com/@tiktok/video/7300000000000000000",
  "description": "Welcome to TikTok #fyp",
  "stats": { "plays": 1200000, "likes": 90000, "comments": 2300, "shares": 1500, "saves": 800 },
  "hashtags": ["fyp"],
  "music": { "title": "original sound", "author": "TikTok" },
  "author": { "username": "tiktok", "nickname": "TikTok", "verified": true }
}
```

Export to **CSV, Excel, JSON, XML, or Google Sheets**, or pull via the **Apify API**.

***

### ❓ FAQ

**Do I need a proxy?**
Yes — TikTok blocks datacenter IPs. The Actor defaults to **residential proxy** (included in your Apify plan) and rotates sessions automatically on blocks.

**How does it get the data?**
It reads the structured JSON that TikTok embeds in each page — the same data the site itself renders from — so results are clean and complete, no fragile HTML scraping.

**How do I get video-level data (plays, likes, comments)?**
Add the **video URLs** to the input. TikTok restricts logged-out access to a profile's full video feed, so the reliable way to get per-video metrics is to provide the video links directly (you can gather them from the app's Share → Copy link, or a profile page). Profile input returns the profile's own stats.

**Is scraping TikTok legal?**
It collects publicly visible information. You're responsible for complying with TikTok's terms and applicable laws (e.g. GDPR). Use it for research and analytics.

***

### 🗺️ Roadmap

- Hashtag and keyword search
- Comment scraping per video
- Trending sounds & creator discovery
- Region and language filters

***

*Built and maintained by [hichemdev](https://apify.com/hichemdev). Found a bug or want a feature? Open an issue on the Actor's **Issues** tab.*

# Actor input Schema

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

TikTok usernames (with or without @) or profile URLs, e.g. "tiktok" or "https://www.tiktok.com/@tiktok". Returns each profile's stats (followers, likes, video count, bio). For per-video data, add the video links under Video URLs — TikTok restricts logged-out access to a profile's full video feed.

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

Optional. Scrape specific TikTok videos directly, e.g. "https://www.tiktok.com/@user/video/1234567890".

## `maxVideosPerProfile` (type: `integer`):

How many recent videos to scrape from each profile.

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

TikTok blocks datacenter traffic, so a proxy is required. Residential is recommended and included in your Apify plan.

## Actor input object example

```json
{
  "profiles": [
    "tiktok"
  ],
  "videoUrls": [],
  "maxVideosPerProfile": 3,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# 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 = {
    "profiles": [
        "tiktok"
    ],
    "videoUrls": [],
    "maxVideosPerProfile": 3
};

// Run the Actor and wait for it to finish
const run = await client.actor("hichemdev/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 = {
    "profiles": ["tiktok"],
    "videoUrls": [],
    "maxVideosPerProfile": 3,
}

# Run the Actor and wait for it to finish
run = client.actor("hichemdev/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 '{
  "profiles": [
    "tiktok"
  ],
  "videoUrls": [],
  "maxVideosPerProfile": 3
}' |
apify call hichemdev/tiktok-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/eaBT4qvsnEgQPCixM/builds/jBJhTNmMhJZHsoXQ6/openapi.json
