# TikTok Profile & Hashtag Scraper (`nodeflow/tiktok-profile-hashtag-scraper`) Actor

Scrape TikTok profiles, hashtags, and search results. Extract videos, views, likes, comments, captions, creator stats, hashtags, music data, and more without login.

- **URL**: https://apify.com/nodeflow/tiktok-profile-hashtag-scraper.md
- **Developed by:** [NodeFlow](https://apify.com/nodeflow) (community)
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.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/actors/running/actors-in-store.md#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 Profile & Hashtag Scraper

Scrape TikTok user profiles, hashtag feeds, and search results. Extract video metadata, view counts, likes, comments, captions, author stats, and music info — with no TikTok account required.

### 🚀 What You Can Do

- **Scrape a user profile** — get all videos from any public TikTok account
- **Scrape a hashtag feed** — get trending videos from any hashtag (e.g., `#viral`, `#fyp`)
- **Scrape search results** — get videos matching any search query (e.g., `"dance challenge"`)

### 📦 Output Data (per video)

| Field | Type | Description |
|---|---|---|
| `id` | string | TikTok video ID |
| `webVideoUrl` | string | Direct link to the video on TikTok |
| `authorUsername` | string | Author's username (without @) |
| `authorNickname` | string | Author's display name |
| `authorId` | string | Author's TikTok ID |
| `authorFollowers` | integer | Author's follower count |
| `authorFollowing` | integer | Number of accounts followed by the author |
| `authorHearts` | integer | Total likes on author's account |
| `authorVerified` | boolean | Whether the author is verified |
| `caption` | string | Video caption / description text |
| `hashtags` | array | List of hashtags extracted from caption |
| `videoPlayCount` | integer | View / play count |
| `videoLikeCount` | integer | Like count (hearts) |
| `videoCommentCount` | integer | Comment count |
| `videoShareCount` | integer | Share count |
| `videoBookmarkCount` | integer | Bookmark / save count |
| `videoDuration` | integer | Duration in seconds |
| `videoWidth` | integer | Width in pixels |
| `videoHeight` | integer | Height in pixels |
| `coverUrl` | string | Thumbnail image URL |
| `musicTitle` | string | Background music title |
| `musicAuthor` | string | Background music author |
| `musicDuration` | integer | Background music duration in seconds |
| `createdAt` | string | Video creation date (ISO 8601) |
| `scrapedAt` | string | Scrape timestamp (ISO 8601) |

### ⚙️ Input Parameters

| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| `scrapeType` | select | ✅ | `user` | `user`, `hashtag`, or `search` |
| `query` | string | ✅ | — | Username (no @), hashtag (no #), or search query |
| `maxItems` | integer | ❌ | `50` | Max videos to return (1–1000) |
| `proxyConfiguration` | proxy | ❌ | RESIDENTIAL | Proxy settings — recommended for reliability |

### 💡 Input Examples

**Scrape a user profile:**

```json
{
  "scrapeType": "user",
  "query": "charlidamelio",
  "maxItems": 50
}
```

**Scrape a hashtag:**

```json
{
  "scrapeType": "hashtag",
  "query": "viral",
  "maxItems": 100
}
```

**Search for videos:**

```json
{
  "scrapeType": "search",
  "query": "dance challenge 2024",
  "maxItems": 50
}
```

### 💰 Pricing

This Actor is compatible with Apify's **Pay-Per-Event** pricing. When the synthetic default-dataset-item event is enabled in the Actor's monetization settings, each saved video produces one billable dataset event. Exact prices and any start event are shown on the Actor's Apify Store page.

### 🌐 Proxy Requirements

TikTok may block datacenter IPs. For best results, use **Residential Proxy** (pre-filled by default).

### 📋 Use Cases

- **Influencer research** — Analyze top creators in any niche
- **Competitor analysis** — Track what content a brand publishes
- **Trend discovery** — Monitor hashtag performance over time
- **Content marketing** — Find viral video patterns for inspiration
- **Market research** — Understand audience engagement in your industry

### ⚠️ Limitations

- Only **public** profiles and hashtags are accessible
- The Actor scrolls to collect more results when requested, but the exact count depends on what TikTok exposes for the query and proxy session
- Private, banned, or age-restricted content is not accessible
- TikTok's structure may change, affecting scraping reliability

### 🔌 API Usage

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/YOUR_USERNAME~tiktok-profile-hashtag-scraper/runs?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "scrapeType": "user",
    "query": "charlidamelio",
    "maxItems": 50,
    "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
  }'
```

### 🛠️ Local Development

```bash
git clone https://github.com/arda-ozkan/tiktok-profile-hashtag-scraper
cd tiktok-profile-hashtag-scraper
npm install
npm run check
```

Node.js 22 or newer is required. Set the `APIFY_TOKEN` environment variable and use `npm run dev` for local runs that use Apify Proxy.

### ⚖️ Responsible Use

This actor accesses only **publicly available** TikTok data. Do not use it to scrape private data, violate TikTok's Terms of Service, or for any unlawful purpose. The operator is not responsible for misuse.

# Actor input Schema

## `scrapeType` (type: `string`):

What to scrape: a user's profile videos, a hashtag feed, or a search query.

## `query` (type: `string`):

For 'user': TikTok username without @, e.g. 'charlidamelio'. For 'hashtag': hashtag without #, e.g. 'viral'. For 'search': any search term, e.g. 'dance challenge'.

## `maxItems` (type: `integer`):

Maximum number of videos to return. Each video is one billable event.

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

Proxy settings. TikTok may block datacenter IPs. Use Residential Proxy for higher success rates.

## Actor input object example

```json
{
  "scrapeType": "user",
  "maxItems": 50,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `videos` (type: `string`):

Items stored in the run's default dataset.

## `summary` (type: `string`):

Summary containing the query and number of saved videos.

# 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 = {
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("nodeflow/tiktok-profile-hashtag-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 = { "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    } }

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

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

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

```

## CLI example

```bash
echo '{
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call nodeflow/tiktok-profile-hashtag-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nodeflow/tiktok-profile-hashtag-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/Xa3odKQ63IBY3ePnC/builds/vRsw94YAYuSiNLb1c/openapi.json
