# Tiktok Hashtag Scraper (`api-ninja/tiktok-hashtag-scraper`) Actor

\#️⃣ Discover trending TikTok hashtag videos at scale. Enter hashtags, URLs, or IDs, choose a region and limit, and get clean video data ready for analysis, APIs, and automation.

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

## Pricing

from $0.50 / 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/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

### What does TikTok Hashtag Scraper do?

**TikTok Hashtag Scraper** extracts public videos from [TikTok](https://www.tiktok.com/) hashtags and returns clean, structured video data you can use for trend research, creator discovery, content monitoring, and social media analytics.

To try it, enter one or more hashtag names, hashtag URLs, or numeric challenge IDs, choose the maximum number of videos per hashtag, optionally set a region, and run the Actor. The results are stored in an Apify dataset and can be downloaded or consumed through the Apify API.

Because this Actor runs on the Apify platform, you also get scheduling, API access, monitoring, dataset exports, webhooks, and integrations with tools such as Google Sheets, Make, Zapier, and your own backend.

### Why use TikTok Hashtag Scraper?

TikTok hashtags are one of the fastest ways to understand what people are watching, copying, remixing, and sharing. This Actor helps you turn those public hashtag pages into a structured dataset without manually opening TikTok and copying video information one by one.

Use TikTok Hashtag Scraper to:

- Track trending videos for a campaign hashtag.
- Discover creators posting under a niche topic.
- Monitor brand, product, event, or competitor hashtags.
- Compare engagement across regions.
- Build datasets for social listening, reporting, or content research.
- Feed TikTok hashtag data into dashboards, spreadsheets, and internal tools.

The Actor focuses on one job: **scraping TikTok hashtag videos**. It does not scrape comments, profiles, followers, or unrelated TikTok sections. If you need those, see the related TikTok Actors section below.

### How to scrape TikTok hashtags

1. Open TikTok Hashtag Scraper on Apify.
2. Add hashtag names, URLs, or IDs to the **Hashtag names, URLs, or IDs** field.
3. Set **Maximum videos per hashtag**.
4. Enable **Parse all videos** only if you want the Actor to keep paging until no more videos are available.
5. Set a two-letter **Region** code such as `US`, `GB`, `IN`, or `UA`.
6. Click **Start** and wait for the run to finish.
7. Open the dataset to preview, download, or send the results through the Apify API.

Example hashtag inputs:

```json
{
    "hashtags": ["dance", "#fitness", "https://www.tiktok.com/hashtag/fyp"],
    "maxResults": 100,
    "parseAll": false,
    "region": "US"
}
````

### Input

TikTok Hashtag Scraper has a simple input form. Click the **Input** tab on the Actor page to configure a run.

| Field        | Type             | Description                                                                              |
| ------------ | ---------------- | ---------------------------------------------------------------------------------------- |
| `hashtags`   | Array of strings | TikTok hashtag names, hashtag URLs, or numeric challenge IDs.                            |
| `maxResults` | Integer          | Maximum number of videos to scrape per hashtag. Ignored when `parseAll` is enabled.      |
| `parseAll`   | Boolean          | If enabled, the Actor keeps loading available videos until TikTok returns no more pages. |
| `region`     | String           | Optional two-letter region code used for localized hashtag results.                      |

You can use plain names such as `dance`, names with a hash sign such as `#fitness`, full URLs such as `https://www.tiktok.com/hashtag/fyp`, or numeric challenge IDs if you already know them.

### Output

The Actor stores each scraped TikTok video as one dataset item. You can download the dataset in various formats such as **JSON, HTML, CSV, or Excel**, or access it programmatically through the Apify API.

Example output item:

```json
{
    "video_id": "7350000000000000000",
    "title": "Example TikTok video caption",
    "content_desc": "Example TikTok video caption",
    "author": {
        "nickname": "Creator Name",
        "unique_id": "creatorhandle",
        "avatar": "https://example.com/avatar.jpeg"
    },
    "cover": "https://example.com/cover.jpeg",
    "play": "https://www.tiktok.com/@creatorhandle/video/7350000000000000000",
    "duration": 21,
    "play_count": 125000,
    "digg_count": 9500,
    "share_count": 320,
    "comment_count": 140,
    "download_count": 0,
    "collect_count": 870,
    "create_time": 1710000000
}
```

Actual fields may vary depending on what TikTok returns for a specific video.

### Data table

| Field                    | Description                                                                    |
| ------------------------ | ------------------------------------------------------------------------------ |
| `video_id`               | TikTok video ID.                                                               |
| `title` / `content_desc` | Video caption or text description.                                             |
| `author.nickname`        | Public display name of the creator.                                            |
| `author.unique_id`       | Public TikTok username.                                                        |
| `author.avatar`          | Creator avatar image URL.                                                      |
| `cover`                  | Video cover image URL.                                                         |
| `play`                   | Public TikTok video URL or playable media URL, depending on the returned data. |
| `duration`               | Video duration.                                                                |
| `play_count`             | Number of views or plays.                                                      |
| `digg_count`             | Number of likes.                                                               |
| `share_count`            | Number of shares.                                                              |
| `comment_count`          | Number of comments.                                                            |
| `collect_count`          | Number of saves or collections.                                                |
| `create_time`            | Video creation timestamp.                                                      |

### How much does it cost to scrape TikTok hashtags?

The final cost depends mainly on how many hashtags you enter, how high you set `maxResults`, and whether you enable `parseAll`. Small runs with a few hashtags and a limited number of videos usually finish quickly. Large hashtag discovery jobs can take longer because the Actor has to paginate through more result pages.

To control cost:

- Start with a small `maxResults` value to test the output.
- Use `parseAll` only when you really need every available video.
- Split very large keyword lists into several runs if you want easier monitoring.
- Schedule recurring runs only for hashtags you actively track.

Apify shows usage and run details in the Console, so you can monitor performance and adjust your input for future runs.

### Tips and advanced options

- Use region codes to compare localized hashtag results, for example `US` vs. `GB`.
- Use exact campaign hashtags when tracking branded content.
- Use broader niche hashtags for creator discovery and trend research.
- Keep `parseAll` disabled for routine monitoring unless you need exhaustive historical collection.
- Export to CSV or Excel for quick analysis, or use the Apify API for automated pipelines.

### Related TikTok Actors

If you need more than hashtag video scraping, these Actors cover other TikTok workflows:

| Actor                                                                            | Use it for                                                      |
| -------------------------------------------------------------------------------- | --------------------------------------------------------------- |
| [TikTok Video Downloader](https://apify.com/api-ninja/tiktok-video-downloader)   | Downloading TikTok videos and video metadata.                   |
| [TikTok Followers Scraper](https://apify.com/api-ninja/tiktok-followers-scraper) | Extracting followers from public TikTok profiles.               |
| [TikTok Data Scraper](https://apify.com/api-ninja/tiktok-data-scraper)           | Scraping multiple TikTok data sections in one broader Actor.    |
| [TikTok Comments Scraper](https://apify.com/api-ninja/tiktok-comments-scraper)   | Scraping comments from TikTok videos.                           |
| [TikTok Profile Scraper](https://apify.com/api-ninja/tiktok-profile-scraper)     | Extracting public profile information and profile-related data. |

### FAQ, disclaimers, and support

#### Is TikTok Hashtag Scraper an official TikTok API?

No. TikTok Hashtag Scraper is an independent Apify Actor for extracting publicly available TikTok hashtag video data. It is useful when you need structured TikTok hashtag data for analysis, automation, or monitoring.

#### Is it legal to scrape TikTok hashtag data?

This Actor is designed to extract publicly available data. However, your results may contain personal data, such as public usernames, profile images, captions, or creator information. Personal data is protected by laws such as the GDPR in the European Union and other privacy regulations around the world.

You should only scrape and process personal data when you have a legitimate reason to do so. If you are unsure whether your use case is compliant, consult a qualified legal professional.

#### Does this Actor scrape private TikTok data?

No. The Actor is intended for public TikTok hashtag video data. It does not log in to user accounts, bypass private profiles, or extract private account information.

#### Can I scrape multiple TikTok hashtags at once?

Yes. Add multiple hashtag names, URLs, or IDs to the `hashtags` input. The Actor processes each one and stores all video results in the same dataset.

#### Can I scrape all videos from a TikTok hashtag?

Enable `parseAll` if you want the Actor to keep loading available pages until no more videos are returned. For very large hashtags, this can increase run time and usage, so it is best to test with a limited `maxResults` first.

#### Why do I get fewer videos than my max results?

TikTok may return fewer available videos for a hashtag, region, or pagination path than the number you requested. Results can also vary over time and by region.

#### Can I use the data in Google Sheets, Make, Zapier, or my own app?

Yes. Apify datasets can be exported manually or consumed through API calls. You can also connect Actor runs to Apify integrations, webhooks, and automation tools.

#### What should I do if a run fails?

Check the run log first. The Actor logs progress for hashtag resolution, page fetching, retries, and pushed result counts. If the issue persists, open the **Issues** tab on the Actor page and include the input you used, the run ID, and a short description of what happened.

#### Can you build a custom TikTok scraper or workflow?

Yes. If you need a custom TikTok workflow, additional fields, a different output format, scheduled monitoring, or integration with your internal systems, use the Actor page support options to describe what you need.

# Actor input Schema

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

Provide TikTok hashtag names, hashtag URLs, or numeric challenge IDs. Examples: dance, #fitness, https://www.tiktok.com/hashtag/fyp, 1234567890

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

Maximum number of videos to scrape for each hashtag. Ignored when Parse all is enabled.

## `parseAll` (type: `boolean`):

When enabled, the Actor keeps paging until TikTok reports no more videos for each hashtag.

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

Optional two-letter country code used for localized hashtag results, for example US, GB, IN, or UA.

## Actor input object example

```json
{
  "hashtags": [
    "dance"
  ],
  "maxResults": 100,
  "parseAll": false,
  "region": "US"
}
```

# Actor output Schema

## `results` (type: `string`):

No description

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

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

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

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Tiktok Hashtag Scraper",
        "description": "#️⃣ Discover trending TikTok hashtag videos at scale. Enter hashtags, URLs, or IDs, choose a region and limit, and get clean video data ready for analysis, APIs, and automation.",
        "version": "0.0",
        "x-build-id": "1UlZZJBxSW1C2I9HH"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/api-ninja~tiktok-hashtag-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-api-ninja-tiktok-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/api-ninja~tiktok-hashtag-scraper/runs": {
            "post": {
                "operationId": "runs-sync-api-ninja-tiktok-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/api-ninja~tiktok-hashtag-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-api-ninja-tiktok-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": "#️⃣ Hashtag names, URLs, or IDs",
                        "type": "array",
                        "description": "Provide TikTok hashtag names, hashtag URLs, or numeric challenge IDs. Examples: dance, #fitness, https://www.tiktok.com/hashtag/fyp, 1234567890",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxResults": {
                        "title": "Maximum videos per hashtag",
                        "minimum": 100,
                        "type": "integer",
                        "description": "Maximum number of videos to scrape for each hashtag. Ignored when Parse all is enabled.",
                        "default": 100
                    },
                    "parseAll": {
                        "title": "Parse all videos",
                        "type": "boolean",
                        "description": "When enabled, the Actor keeps paging until TikTok reports no more videos for each hashtag.",
                        "default": false
                    },
                    "region": {
                        "title": "🌍 Region",
                        "pattern": "^[A-Za-z]{2}$",
                        "type": "string",
                        "description": "Optional two-letter country code used for localized hashtag results, for example US, GB, IN, or UA.",
                        "default": "US"
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
