# TikTok Hashtag Scraper (`toolzerhub/tiktok-hashtag-scraper`) Actor

Fetch TikTok hashtag data by name: hashtag ID, video count, and view count. Optionally collect the hashtag's current top videos with captions, engagement statistics, and music metadata. Export the data, run it via API, or schedule and monitor trending hashtags.

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

## Pricing

from $1.40 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 Hashtag Scraper

Look up a TikTok hashtag by name and get its ID, video count and total views. Tick one box and you get its current top videos instead, each carrying the hashtag's stats.

### Input

| Field | Use it for |
|---|---|
| **`tag_name`** | Hashtag name, no `#`. Required. A leading `#` is stripped if you paste one. |
| **`region`** | Two-letter region code. Default `US`. Affects the **videos** only, not the hashtag lookup. |
| **`addonHashtagVideos`** | Return the current top videos as rows instead of the hashtag row. One extra request. |

```json
{
  "tag_name": "booktok",
  "region": "US"
}
```

### Two different outputs, depending on one box

This is the thing to understand before you run it.

**`addonHashtagVideos` off (default)** -- you get exactly **one row**: the hashtag itself.

| Field | Contents |
|---|---|
| **`tag_name`** | The hashtag you asked for |
| **`ch_id`** | TikTok's hashtag (challenge) ID |
| **`hashtag_video_count`** | Videos reported for the hashtag |
| **`hashtag_view_count`** | Total views reported |
| **`ch_info`** | The full hashtag record |

```json
{
  "tag_name": "booktok",
  "ch_id": "10358",
  "hashtag_video_count": 3840000,
  "hashtag_view_count": 219000000000
}
```

**`addonHashtagVideos` on** -- you get **one row per video**, and no standalone hashtag row. Each video row carries the hashtag fields above *plus* the video's own:

| Field | Contents |
|---|---|
| **`aweme_id`** | Video ID |
| **`description`** | Caption |
| **`create_time`** | Unix timestamp |
| **`stats`** | Play, like, comment and share counts |
| **`music_info`** | The sound used |

So if you were expecting the hashtag row *and* the videos, you will not find it -- the hashtag's numbers ride along on every video row instead. Nothing is lost, but the row count changes shape entirely.

### Questions

**Why does `region` do nothing when the add-on is off?**
Because the hashtag lookup itself is not regional -- a hashtag's ID and lifetime totals are the same everywhere. Region only applies to the top-videos request, which is genuinely different market to market.

**I get zero rows with the add-on on. The hashtag exists.**
The hashtag resolved but TikTok returned no video list for it in that region. Try a different **`region`**, or run without the add-on to confirm the hashtag record itself is fine.

**How many top videos come back?**
As many as TikTok serves for that hashtag and region in a single response -- there is no pagination here and no limit setting. For a large, paged sweep of a hashtag's videos, search the tag as a keyword with the [Video Search Scraper](https://apify.com/toolzerhub/tiktok-video-search-scraper).

**Are `hashtag_video_count` and `hashtag_view_count` always present?**
Not always. TikTok reports them inconsistently across hashtags, and when a count is missing it comes back as `null` rather than `0` -- so you can tell "not reported" apart from "genuinely zero".

**Can I pass more than one hashtag?**
No, one per run.

### Related Actors

| Actor | Purpose |
|---|---|
| [TikTok Video Search Scraper](https://apify.com/toolzerhub/tiktok-video-search-scraper) | Paginated keyword search, when one page of top videos is not enough |
| [TikTok Sound & Music Scraper](https://apify.com/toolzerhub/tiktok-sound-scraper) | The same pattern for a sound instead of a hashtag |

### Support

Questions, bugs, or feature requests: **contact@toolzerhub.com**

Browse the rest: [apify.com/toolzerhub](https://apify.com/toolzerhub)

# Actor input Schema

## `tag_name` (type: `string`):

TikTok hashtag name without the # symbol.

## `region` (type: `string`):

Two-letter region code affecting search/feed results, e.g. US, GB, JP.

## `addonHashtagVideos` (type: `boolean`):

Return each current top video as a separate row with hashtag context. One extra request.

## Actor input object example

```json
{
  "tag_name": "cats",
  "region": "US",
  "addonHashtagVideos": false
}
```

# Actor output Schema

## `dataset` (type: `string`):

Every record collected during this run

# 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 = {
    "tag_name": "cats",
    "region": "US"
};

// Run the Actor and wait for it to finish
const run = await client.actor("toolzerhub/tiktok-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 = {
    "tag_name": "cats",
    "region": "US",
}

# Run the Actor and wait for it to finish
run = client.actor("toolzerhub/tiktok-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 '{
  "tag_name": "cats",
  "region": "US"
}' |
apify call toolzerhub/tiktok-hashtag-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,toolzerhub/tiktok-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/XQ8lda6l5dZRVLYAr/builds/0fZv8W6y26KLiyZ1x/openapi.json
