# TikTok Hashtag Data Scraper (`scrapecore/tiktok-cheerio-hashtag-scraper`) Actor

Scrape TikTok videos by hashtag using Playwright browser. No signature server needed. Fast and lightweight.

- **URL**: https://apify.com/scrapecore/tiktok-cheerio-hashtag-scraper.md
- **Developed by:** [ScrapeCore](https://apify.com/scrapecore) (community)
- **Categories:** Social media, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 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 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 Hashtag Data Scraper

**The fastest and most reliable way to extract TikTok video data by hashtag — no login, no API key, no rate limits.**

Scrape hundreds of TikTok videos in seconds. Get complete video metadata, engagement metrics, creator profiles, music info, and direct download URLs — all structured in clean JSON, ready for your analytics pipeline.

---

### ⚡ Why Use This Scraper?

| Feature | TikTok Hashtag Data Scraper | Other Scrapers |
|---|---|---|
| **No API key needed** | ✅ | ❌ Requires TikTok API access |
| **No login required** | ✅ | ❌ Often needs cookies/session |
| **Parallel scraping** | ✅ Up to 5 hashtags at once | ❌ Sequential only |
| **Smart filtering** | ✅ Min likes & views filters | ❌ Manual post-processing |
| **Sorting options** | ✅ By views, likes, shares, date | ❌ Relevance only |
| **Complete metadata** | ✅ 25+ fields per video | ❌ Basic info only |
| **Reliable extraction** | ✅ Real browser + XHR interception | ❌ Breaks on page changes |

---

### 🚀 What Data Can You Extract?

Every video scraped includes **rich, structured data** across these categories:

#### 📊 Engagement Metrics
- Play count, likes (diggs), shares, comments, saves (collects)
- Filter by minimum likes or views to focus on viral content

#### 👤 Creator Information
- Username, display name, verified status, bio, avatar URL
- Follower count, following count, total hearts, video count
- Private account flag, TikTok seller status

#### 🎶 Music & Audio
- Song name, artist, album, original sound flag
- Music play URL for audio analysis
- Cover image URL, music ID

#### 🎬 Video Details
- Duration, resolution (width × height), video definition
- Cover image URL, original cover URL
- Direct download URL, original download address
- Video format (mp4)

#### 🏷️ Content Metadata
- Full video description text
- All hashtags used in the video
- Mentioned users
- Creation timestamp (Unix + ISO 8601)
- Ad flag, muted flag, slideshow detection, pinned status
- Effect stickers used
- Direct TikTok web URL

---

### 📥 Input Configuration

```json
{
    "hashtags": ["webscraping", "python", "coding"],
    "resultsPerPage": 30,
    "sortBy": "playCount",
    "minLikes": 100,
    "minViews": 1000
}
````

#### Input Parameters

| Parameter | Type | Default | Description |
|---|---|---|---|
| `hashtags` | string\[] | *required* | List of TikTok hashtags to scrape (without `#`). Up to 50 hashtags per run. |
| `resultsPerPage` | integer | `30` | Maximum number of videos to collect per hashtag (1–500). |
| `sortBy` | string | `"relevance"` | Sort results by: `relevance`, `playCount`, `diggCount`, `shareCount`, or `createTime`. |
| `minLikes` | integer | `0` | Only include videos with likes ≥ this value. Set `0` to disable. |
| `minViews` | integer | `0` | Only include videos with views ≥ this value. Set `0` to disable. |

***

### 📤 Output Example

Each video is output as a structured JSON object:

```json
{
    "id": "7204347705928191259",
    "text": "Scraping website dari nol menggunakan nodejs #programmer #nodejs #tutorial #webscraping #fyp",
    "createTime": 1677392919,
    "createTimeISO": "2023-02-26T06:28:39.000Z",
    "isAd": false,
    "isMuted": false,
    "authorMeta": {
        "id": "6964254822141297665",
        "name": "username",
        "nickName": "Display Name",
        "verified": false,
        "signature": "Bio text here",
        "bioLink": null,
        "avatar": "https://p16-sign-va.tiktokcdn.com/...",
        "privateAccount": false,
        "ttSeller": true,
        "following": 1,
        "fans": 1849,
        "heart": 13000,
        "video": 33,
        "digg": 37
    },
    "musicMeta": {
        "musicName": "LoFi(860862)",
        "musicAuthor": "skollbeats",
        "musicOriginal": false,
        "musicAlbum": "",
        "playUrl": "",
        "coverMediumUrl": "https://p16-sign-va.tiktokcdn.com/...",
        "musicId": "6873526724840130562"
    },
    "webVideoUrl": "https://www.tiktok.com/@username/video/7204347705928191259",
    "mediaUrls": [
        "https://v16-webapp-prime.tiktok.com/video/..."
    ],
    "videoMeta": {
        "height": 944,
        "width": 576,
        "duration": 164,
        "coverUrl": "https://p16-sign-useast2a.tiktokcdn.com/...",
        "originalCoverUrl": "https://p16-sign-useast2a.tiktokcdn.com/...",
        "definition": "540p",
        "format": "mp4",
        "originalDownloadAddr": "https://v16-webapp-prime.tiktok.com/...",
        "downloadAddr": "https://v16-webapp-prime.tiktok.com/..."
    },
    "diggCount": 517,
    "shareCount": 17,
    "playCount": 12600,
    "collectCount": 115,
    "commentCount": 27,
    "mentions": [],
    "hashtags": [
        { "name": "programmer" },
        { "name": "nodejs" },
        { "name": "tutorial" },
        { "name": "webscraping" },
        { "name": "fyp" }
    ]
}
```

***

### 💡 Use Cases

#### 📈 Marketing & Brand Monitoring

Track hashtag performance, discover trending content in your niche, and monitor competitor campaigns. Identify viral videos early to ride trending waves.

#### 🔬 Research & Analytics

Collect large-scale datasets for academic research, sentiment analysis, or trend forecasting. Study content virality patterns across different hashtags and creators.

#### 🤖 Content Strategy & Automation

Find top-performing content formats, optimal posting times, and high-engagement music tracks. Build automated reporting dashboards with fresh TikTok data.

#### 📊 Influencer Discovery

Filter by minimum engagement metrics to find rising creators with high-performing content. Analyze follower counts, engagement rates, and content consistency.

#### 🎵 Music & Trend Tracking

Track which songs are going viral, discover emerging audio trends, and monitor music usage across hashtags for record labels and artists.

***

### ⚙️ How It Works

1. **Real Browser Rendering** — Uses Playwright (Chromium) to load TikTok hashtag pages exactly like a real user would.
2. **XHR Interception** — Captures TikTok's internal API responses as they load, ensuring complete and accurate data extraction.
3. **Smart Pagination** — Automatically scrolls and loads more results until your target count is reached.
4. **Parallel Processing** — Scrapes up to 5 hashtags simultaneously using a shared browser instance for maximum speed and efficiency.
5. **Structured Output** — Raw API data is parsed into a clean, consistent JSON schema with 25+ fields per video.

***

### 🏎️ Performance

| Hashtags | Results per Hashtag | Total Items | Approx. Time |
|---|---|---|---|
| 1 | 30 | ~30 | ~5s |
| 3 | 30 | ~90 | ~15s |
| 5 | 30 | ~150 | ~20s |
| 10 | 30 | ~300 | ~55s |

> **Benchmark:** 10 hashtags × 30 results = 240 items scraped in under 60 seconds.

***

### 🔗 Integrations & Export

Export your scraped data in multiple formats directly from the Apify platform:

- **JSON** — Perfect for APIs and custom integrations
- **CSV** — Import into Excel, Google Sheets, or any BI tool
- **XML** — For legacy systems and enterprise workflows
- **RSS** — Create automated content feeds
- **Webhook** — Push results to Zapier, Make, n8n, or custom endpoints
- **API** — Access results programmatically via Apify REST API

#### API Example

```bash
## Start the scraper via API
curl "https://api.apify.com/v2/acts/YOUR_ACTOR_ID/runs" \
  -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
    "hashtags": ["trending", "fyp"],
    "resultsPerPage": 50
  }'
```

#### Python Integration

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")

run = client.actor("YOUR_ACTOR_ID").call(run_input={
    "hashtags": ["webscraping", "python"],
    "resultsPerPage": 30,
    "sortBy": "playCount",
    "minLikes": 100,
})

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(f"{item['id']} — {item['playCount']} views — {item['text'][:60]}")
```

***

### 📋 Limitations

- Maximum **50 hashtags** per run
- Up to **500 results** per hashtag
- TikTok may occasionally return fewer results than requested for some hashtags
- Scraping speed depends on TikTok's server response time

***

### 🛡️ Responsible Use

This tool is designed for legitimate data collection purposes such as market research, academic studies, and content analysis. Please use it responsibly and in compliance with TikTok's Terms of Service and applicable data protection regulations.

***

### 📬 Support & Feedback

Found a bug or have a feature request? Open an issue on the Actor's page or reach out through Apify's support channels. Your feedback helps make this tool better for everyone.

***

**Start scraping TikTok hashtag data in seconds — no coding required. Just enter your hashtags and hit Run.**

# Actor input Schema

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

List of TikTok hashtags to scrape (without #). Example: fyp, trending, cooking

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

Maximum number of videos to collect per hashtag

## `sortBy` (type: `string`):

Sort results by a specific metric

## `minLikes` (type: `integer`):

Filter: only include videos with likes >= this value

## `minViews` (type: `integer`):

Filter: only include videos with views >= this value

## Actor input object example

```json
{
  "hashtags": [
    "fyp"
  ],
  "resultsPerPage": 30,
  "sortBy": "relevance",
  "minLikes": 0,
  "minViews": 0
}
```

# 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": [
        "fyp"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapecore/tiktok-cheerio-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 = { "hashtags": ["fyp"] }

# Run the Actor and wait for it to finish
run = client.actor("scrapecore/tiktok-cheerio-hashtag-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": [
    "fyp"
  ]
}' |
apify call scrapecore/tiktok-cheerio-hashtag-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "TikTok Hashtag Data Scraper",
        "description": "Scrape TikTok videos by hashtag using Playwright browser. No signature server needed. Fast and lightweight.",
        "version": "0.1",
        "x-build-id": "2TSevYajazSwpBkcY"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/scrapecore~tiktok-cheerio-hashtag-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-scrapecore-tiktok-cheerio-hashtag-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/scrapecore~tiktok-cheerio-hashtag-scraper/runs": {
            "post": {
                "operationId": "runs-sync-scrapecore-tiktok-cheerio-hashtag-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/scrapecore~tiktok-cheerio-hashtag-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-scrapecore-tiktok-cheerio-hashtag-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",
                "required": [
                    "hashtags"
                ],
                "properties": {
                    "hashtags": {
                        "title": "Hashtags",
                        "type": "array",
                        "description": "List of TikTok hashtags to scrape (without #). Example: fyp, trending, cooking",
                        "items": {
                            "type": "string"
                        }
                    },
                    "resultsPerPage": {
                        "title": "Max Results per Hashtag",
                        "minimum": 1,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Maximum number of videos to collect per hashtag",
                        "default": 30
                    },
                    "sortBy": {
                        "title": "Sort Results By",
                        "enum": [
                            "relevance",
                            "playCount",
                            "diggCount",
                            "shareCount",
                            "createTime"
                        ],
                        "type": "string",
                        "description": "Sort results by a specific metric",
                        "default": "relevance"
                    },
                    "minLikes": {
                        "title": "Minimum Likes",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Filter: only include videos with likes >= this value",
                        "default": 0
                    },
                    "minViews": {
                        "title": "Minimum Views",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Filter: only include videos with views >= this value",
                        "default": 0
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
