# TikTok Hashtag Scraper – Hashtag Videos & Tag Analytics (`harshmaur/tiktok-hashtag-scraper`) Actor

Collect TikTok hashtag videos for tag analytics. Require an exact hashtag match, combine date and likes filters, and explore results across countries. Export captions, creators and engagement, with optional downloads, subtitles and AI analysis. No TikTok login needed.

- **URL**: https://apify.com/harshmaur/tiktok-hashtag-scraper.md
- **Developed by:** [Harsh Maur](https://apify.com/harshmaur) (community)
- **Categories:** Social media, Videos
- **Features:** Limited permissions
- **Stats:** 2 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.35 / 1,000 videos

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## TikTok Hashtag Scraper

Collect TikTok hashtag videos with captions, creator profiles, engagement counts and sound metadata. Use an exact hashtag match, a posting window and a likes range in the same run. Export the dataset as JSON, CSV or Excel, or deliver results through an MCP connector.

### TikTok hashtag scraper with exact tag matching

TikTok can place a video on a hashtag page even when its caption does not contain that tag. Set `hashtagMatch` to `exact` to keep only videos whose hashtag list contains the requested name, ignoring letter case. The default, `related`, follows TikTok's hashtag page results.

Add names to `hashtags`, with or without `#`. `resultsPerPage` limits matching videos per hashtag and defaults to 100. `maxItems` optionally caps the entire run. If a video appears under several requested tags, it is delivered once.

### Collect TikTok hashtag videos by date and likes

Combine `oldestPostDateUnified`, `newestPostDate`, `leastDiggs` and `mostDiggs` to select a posting window and engagement range. These filters work together without a separate filter charge. Filtered videos do not count toward the video limit.

```json
{
  "hashtags": ["cooking", "mealprep"],
  "resultsPerPage": 100,
  "maxItems": 150,
  "hashtagMatch": "exact",
  "oldestPostDateUnified": "2026-10-01",
  "newestPostDate": "2026-10-29",
  "leastDiggs": 100,
  "mostDiggs": 50000,
  "shouldDownloadVideos": false
}
```

Dates accept an ISO date or a relative age such as `30 days`. Strict filters can leave fewer results than requested. Hashtag pages are a changing sample, not a complete historical archive, and their order does not guarantee newest-first results.

### TikTok tag analytics across countries

A single visitor session sees only part of a hashtag. With `proxyCountryCode` set to `None` or omitted, the scraper moves across countries to find additional videos. In our recorded `#cooking` probe, one US session returned 142 videos; eight countries exposed 936 distinct videos. This is a measured example, not a promised result count.

Choose a specific `proxyCountryCode` when you need one visitor region. It selects where TikTok is viewed from; it does not filter creators by nationality or posting location.

Use `playCount`, `diggCount`, `commentCount`, `shareCount` and `collectCount` for your own tag analytics. Each row also includes `hashtags`, `searchHashtag` and `authorMeta`. The actor returns individual videos rather than an aggregate analytics report.

Example video row, shortened to show the field structure:

```json
{
  "dataType": "video",
  "id": "7694335322922044703",
  "webVideoUrl": "https://www.tiktok.com/@example/video/7694335322922044703",
  "text": "Dinner in one pan #cooking #mealprep",
  "createTimeISO": "2026-10-08T16:31:16.000Z",
  "authorMeta": {
    "name": "example",
    "fans": 120000
  },
  "playCount": 250000,
  "diggCount": 12500,
  "commentCount": 180,
  "shareCount": 420,
  "hashtags": [{ "name": "cooking" }, { "name": "mealprep" }],
  "searchHashtag": { "name": "cooking", "views": 412000000000 },
  "input": "cooking"
}
```

Successful rows have `dataType: "video"`. The creator's details ride on each video; the actor does not collect separate profile, comment or follower rows. A target that fails can produce a free `failed` row with `errorCode` and `error`.

### Download hashtag videos, subtitles and AI insights

- `shouldDownloadVideos` saves watermark-free MP4 files. Stored links appear in `mediaUrls`.
- `shouldDownloadCovers`, `shouldDownloadSlideshowImages`, `shouldDownloadAvatars` and `shouldDownloadMusicCovers` save the corresponding images.
- `downloadSubtitlesOptions` can save TikTok captions or generate an AI transcript. Text appears in `videoMeta.transcript`; caption links appear in `videoMeta.subtitleLinks`.
- `aiAnalysis` adds content category, sponsorship, brand safety and sentiment labels. Use `aiQuestions` for your own yes/no questions.
- `aiVideoSummary` and `aiVideoDescription` add a summary or timed scene description inside `videoMeta`.

Downloads use the run's default key-value store and follow its retention settings. AI features require a paid Apify plan and the operator's configured AI credentials. Missing AI credentials cause those options to be skipped.

### TikTok hashtag scraper pricing

Starting a hashtag run costs **$0.001**, collected by Apify. All plans pay the listed flat amounts, with no tiered reductions.

| Work delivered | Flat price |
| --- | --- |
| Video row | $0.00035 ($0.35 per 1,000) |
| Saved MP4 download | $0.01 per video |
| Text AI analysis | $0.0015 per video |
| AI transcript, summary or scene description | $0.025 per started 30 seconds of video |

Failed targets carry no video or add-on fee; Apify still collects the start charge. TikTok’s own captions are included without an extra event. The listing’s Store pricing panel defines these amounts.

### Send hashtag results to an MCP connector

Set `mcpConnector` and `mcpTarget` to deliver video results to a supported connected destination, such as Slack, Notion or Google Sheets. `mcpMode` selects how delivery works, and `mcpMaxItems` limits the delivered subset. Use `mcpTool` and `mcpArguments` for an explicit connector tool, or the custom server fields for your own MCP endpoint. Scraping still writes the dataset when connector delivery fails.

### TikTok hashtag scraper FAQ

#### Can I require a literal hashtag instead of related results?

Yes. Choose `hashtagMatch: "exact"`. A request for `cooking` keeps the `cooking` tag, not a longer tag such as `cookingtime`.

#### Can I combine a date filter with minimum likes?

Yes. Set a date bound and `leastDiggs` together. Add `mostDiggs` to restrict the upper end of the likes range.

#### Why do I receive fewer TikTok hashtag videos than I requested?

TikTok limits what a logged-out session can see. Filters, duplicate removal, unavailable posts and the run's charge cap can reduce the total. Leaving the visitor country unset helps discover additional regional slices, but cannot guarantee complete coverage.

#### Does the actor need my TikTok password?

No TikTok account, password or session cookie is required from you.

#### Does it return the comments below each video?

It includes the comment count. For comment text and replies, use the comments listing below.

### Other TikTok scrapers

- [TikTok Scraper](https://apify.com/harshmaur/tiktok-scraper): combine hashtags with search, profiles, music and social data.
- [TikTok Comments Scraper](https://apify.com/harshmaur/tiktok-comments-scraper): collect comment text and replies.
- [TikTok Profile Scraper](https://apify.com/harshmaur/tiktok-profile-scraper): start with creator accounts.
- [TikTok Video Scraper](https://apify.com/harshmaur/tiktok-video-scraper): extract posts from individual video links.
- [TikTok Hashtag Scraper](https://apify.com/harshmaur/tiktok-hashtag-scraper): return to this hashtag-focused listing.
- [TikTok Transcript Scraper](https://apify.com/harshmaur/tiktok-transcript-scraper): turn TikTok speech into text.

# Actor input Schema

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

Hashtag names, with or without #. Collect videos from each tag and use Exact hashtag match to require that tag in the caption.

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

Maximum matching videos to return for EACH hashtag. TikTok may expose fewer videos than requested. Use Max videos in total to cap the whole run.

## `shouldDownloadVideos` (type: `boolean`):

Save each video's MP4 file, without the TikTok watermark.

## `shouldDownloadCovers` (type: `boolean`):

Save the thumbnail of each video.

## `downloadSubtitlesOptions` (type: `string`):

Download subtitles saves the captions TikTok already has (links in videoMeta.subtitleLinks). The transcribe options also write a speech-to-text transcript to videoMeta.transcript, either only for videos without captions or for all videos.

## `shouldDownloadSlideshowImages` (type: `boolean`):

Save every image of photo and slideshow posts. Links go to slideshowImageLinks.

## `shouldDownloadAvatars` (type: `boolean`):

Save the author's avatar for each video.

## `shouldDownloadMusicCovers` (type: `boolean`):

Save the cover art of the sound each video uses.

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

A hard cap on videos for the whole run, across all inputs. Use it to keep the cost of a large list predictable. Leave empty for no total cap.

## `hashtagMatch` (type: `string`):

Related returns everything TikTok files under the hashtag, including videos that do not carry it. Exact keeps only videos whose caption contains the hashtag. Videos filtered out are not charged.

## `oldestPostDateUnified` (type: `string`):

Only keep videos posted on or after this date. Through the API you can also send a number of days, for example 30 for the last 30 days.

## `newestPostDate` (type: `string`):

Only keep videos posted on or before this date. Pair it with the field above for a date window.

## `leastDiggs` (type: `integer`):

Only keep videos with at least this many likes (hearts). Works together with the date filter.

## `mostDiggs` (type: `integer`):

Only keep videos with at most this many likes. Useful to find smaller creators or posts before they take off.

## `aiAnalysis` (type: `boolean`):

Adds aiAnalysis to each video: a content category, whether it looks sponsored, whether it is brand safe, and its sentiment.

## `aiQuestions` (type: `array`):

Up to 20 questions answered with true or false for every video, for example 'Does the video show a dog?'. Answers go to aiAnalysis.answers. Needs the AI labels option.

## `aiVideoSummary` (type: `boolean`):

A short summary of what the video is about, from its picture and sound. Saved in videoMeta.aiVideoSummary.

## `aiVideoDescription` (type: `boolean`):

A timed description of what is seen and heard in each scene. Saved in videoMeta.aiVideoDescription.

## `proxyCountryCode` (type: `string`):

Choose the country used to load hashtag results. None lets the scraper visit multiple countries for a wider set of videos. This changes the visitor location, not the creator country.

## `mcpConnector` (type: `string`):

Pick an authorized MCP connector (Slack, Notion, Airtable, Google Sheets, …) to receive the scraped videos. Your credentials stay in Apify and are never exposed to this actor (Apify's proxy injects them). Leave empty to scrape only. Tip: schedule a hashtag or a creator to get new videos in your workspace.

## `mcpMode` (type: `string`):

perPost: one message or record per video. summary: a single digest of the whole run.

## `mcpTarget` (type: `string`):

Where to write — the destination ID the tool needs: a Notion database/page ID, a Google Sheet ID, or a Slack channel. Leave blank for connectors that post to a default location. Advanced shapes go in Arguments JSON below.

## `mcpMessage` (type: `string`):

Template for each message. Use {{field}} placeholders from any video field, nested paths included — common ones: {{text}}, {{webVideoUrl}}, {{authorMeta.name}}, {{playCount}}, {{diggCount}}, {{commentCount}}, {{shareCount}}, {{createTimeISO}}. Missing fields render empty.

## `mcpTool` (type: `string`):

Force a specific tool name on the connector (e.g. send_message, create_page, append_row). Leave empty to auto-detect the connector's write/notify tool.

## `mcpArguments` (type: `object`):

Extra/override arguments merged into each tool call as JSON — e.g. {"channel": "#tiktok"} for Slack. {{field}} placeholders work inside string values too, so you can nest live data into any shape — e.g. Notion: {"properties": {"Title": {"title": \[{"text": {"content": "{{text}}"}}]}, "Link": {"url": "{{webVideoUrl}}"}}}.

## `mcpMaxItems` (type: `integer`):

Safety cap on how many videos are piped to the connector per run (perPost mode). Protects against flooding the destination.

## `mcpServerUrl` (type: `string`):

Advanced/testing only. Connect directly to a raw MCP server URL, bypassing the connector above. For real use prefer a connector — your credentials then stay in Apify. When set, this overrides the connector.

## `mcpServerToken` (type: `string`):

Bearer token for the dev MCP server URL above. A token entered here IS visible to the actor at runtime — for production use an MCP Connector instead. Ignored unless the URL is set.

## Actor input object example

```json
{
  "hashtags": [
    "cooking"
  ],
  "resultsPerPage": 100,
  "shouldDownloadVideos": false,
  "shouldDownloadCovers": false,
  "downloadSubtitlesOptions": "NEVER_DOWNLOAD_SUBTITLES",
  "shouldDownloadSlideshowImages": false,
  "shouldDownloadAvatars": false,
  "shouldDownloadMusicCovers": false,
  "hashtagMatch": "related",
  "aiAnalysis": false,
  "aiVideoSummary": false,
  "aiVideoDescription": false,
  "proxyCountryCode": "None",
  "mcpMode": "perPost",
  "mcpMessage": "*@{{authorMeta.name}}* — {{diggCount}} likes · {{playCount}} views\n{{text}}\n{{webVideoUrl}}",
  "mcpMaxItems": 50
}
```

# Actor output Schema

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

Video rows with caption, author, views, likes, comments, shares, sound and optional AI fields.

## `failed` (type: `string`):

Inputs that could not be scraped, with the reason. Not charged.

# 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": [
        "cooking"
    ],
    "resultsPerPage": 100,
    "proxyCountryCode": "None",
    "mcpMode": "perPost",
    "mcpMessage": `*@{{authorMeta.name}}* — {{diggCount}} likes · {{playCount}} views
{{text}}
{{webVideoUrl}}`,
    "mcpMaxItems": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("harshmaur/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": ["cooking"],
    "resultsPerPage": 100,
    "proxyCountryCode": "None",
    "mcpMode": "perPost",
    "mcpMessage": """*@{{authorMeta.name}}* — {{diggCount}} likes · {{playCount}} views
{{text}}
{{webVideoUrl}}""",
    "mcpMaxItems": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("harshmaur/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 '{
  "hashtags": [
    "cooking"
  ],
  "resultsPerPage": 100,
  "proxyCountryCode": "None",
  "mcpMode": "perPost",
  "mcpMessage": "*@{{authorMeta.name}}* — {{diggCount}} likes · {{playCount}} views\\n{{text}}\\n{{webVideoUrl}}",
  "mcpMaxItems": 50
}' |
apify call harshmaur/tiktok-hashtag-scraper --silent --output-dataset

```

## MCP server setup

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