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

TikTok hashtag scraper: videos from one or many TikTok hashtags with plays, likes, comments, shares, saves, posted time, duration, music and creator handle. Filter by posting date (pay only for matches), dedupe across hashtags, and monitor hashtags for recent videos new to the page.

- **URL**: https://apify.com/datahamster/tiktok-hashtag-scraper.md
- **Developed by:** [Viktor Dubnytskiy](https://apify.com/datahamster) (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 $1.00 / 1,000 result items

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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?

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

Give it TikTok hashtags and get one flat row per video listed on each hashtag page: video URL, caption, hashtags, plays, likes, comments, shares, saves, posted time, duration, music id and title, and the creator's handle. No TikTok account, no cookies. Monitor mode turns the same input into an alert feed of recent videos that newly appear on your hashtag pages.

**Try it:** the prefilled example returns 10 rows in about 25 seconds and costs about $0.023. Results cost $2.10 per 1,000.

Coverage: we read about 60 to 190 videos per hashtag; the most-used TikTok hashtag actor states 400 to 800. TikTok shows a logged-out visitor about 60 to 150 videos per session before it ends the list, and the actor opens up to 4 fresh sessions per hashtag to read more (181 distinct videos for #running on 2026-11-05). The page is ordered by TikTok's popularity ranking, not by date, so old viral videos come first; use `postedAfter` for recent ones.

### Why this one

- **Date filter, and you pay only for matching videos.** `postedAfter: "30"` (days) or `"2026-11-01"` keeps only videos posted since then and keeps reading until `maxPerHashtag` matching videos are found; filtered-out videos are not charged. The most-used TikTok hashtag actor has no date or sort option in its input (its fields are hashtags, results per hashtag and download add-ons), so every old video on the page is a paid row. Test run 2026-11-05: #fitness and #gymtok with `postedAfter: "30"` scanned 123 videos, returned the 21 from the last 30 days and charged for 21.
- **Monitor mode: alerts on recent videos new to the hashtag page.** Save the input as a task with `mode: "monitor"` and schedule it. The first run stores what each hashtag page shows. A later run returns a video as new when it was not on the page before and was posted no earlier than about 3 days before the newest video already seen there; older videos that only now appear on the page are recorded without being returned or charged. Webhook or Telegram alerts. The leader has no monitor mode. Test 2026-11-05: the baseline stored 119 videos from #gymtok and #running; a run 5 minutes later returned 3 videos that had not been on the pages before (all three were posted before the baseline run, between 2026-11-04 02:15 and 2026-11-05 20:46 UTC) and recorded 29 older ones silently.
- **Many hashtags, no duplicates.** A video listed under two of your hashtags comes back once (the first hashtag in `hashtag`), and `maxPerHashtag` is per hashtag, not a total split evenly. Paste `#tag`, `tag` or a `https://www.tiktok.com/tag/<tag>` link.
- **Price.** $0.0021 per video on the free plan, $0.0014 on Bronze, $0.00105 on Silver, $0.001 on Gold and higher, no start fee. The leader charges $0.003 / $0.002 / $0.0015 / $0.001 and $0.0006 (Platinum), $0.0003 (Diamond), checked 2026-11-05; on Platinum and Diamond the leader is cheaper. Platform usage is about $0.03 per 1,000 videos for one session per hashtag, about $0.10 per 1,000 for deep reads, and $0.18 to $0.58 per 1,000 returned videos with `postedAfter` (the actor reads and skips older videos to find matches). One monitor run on two hashtags used $0.004 to $0.006.

### What you get

Real rows from the example dataset (prefilled input `hashtags: ["running"]`, 10 rows):

| rank | creator | plays | likes | comments | posted | seconds | caption |
|---|---|---|---|---|---|---|---|
| 1 | daniel.labelle | 17,500,000 | 2,500,000 | 23,900 | 2022-05-04 | 54 | How Different Actors Run. #running |
| 2 | flotracktv | 3,100,000 | 265,400 | 964 | 2022-05-14 | 51 | 44.7...Matthew Boling with the comeback of all 4x4... |
| 4 | mikeclaynfl | 6,800,000 | 1,000,000 | 3,590 | 2022-05-08 | 8 | #running #ymca #kidsbelike ... |
| 6 | thattreadmillguy | 1,700,000 | 178,500 | 494 | 2022-05-14 | 7 | Reply to @user #StarWarsDay #daphne #run #running |
| 7 | \_mission22 | 10,100 | 617 | 15 | 2022-06-03 | 20 | Running to help reduce trauma symptoms! #running ... |

One full row:

```json
{
  "id": "7095174182408981806",
  "url": "https://www.tiktok.com/@mikeclaynfl/video/7095174182408981806",
  "scrapedAt": "2026-11-05T22:37:03.809720Z",
  "hashtag": "running",
  "videoId": "7095174182408981806",
  "authorHandle": "mikeclaynfl",
  "description": "#running #ymca #kidsbelike #kidscomedy #kids #kidssaythedarnestthings",
  "hashtags": ["running", "ymca", "kidsbelike", "kidscomedy", "kids", "kidssaythedarnestthings"],
  "createdAt": "2022-05-08T01:39:31Z",
  "durationSeconds": 8,
  "playCount": 6800000,
  "likeCount": 1000000,
  "commentCount": 3590,
  "shareCount": 30800,
  "saveCount": 14876,
  "musicId": "7095174151329090346",
  "musicTitle": "original sound",
  "musicIsOriginal": true,
  "isAd": false,
  "language": null,
  "rank": 4
}
```

`createdAt` is TikTok's posting time (UTC, to the second). TikTok rounds large counts (6,800,000). `rank` is the position on the hashtag page. `@mentions` in captions are replaced with `@user`. Paid videos are left out unless `includeAds: true`.

Not collected: creator display names, avatars, bios, follower counts or other profile fields (only the public handle), video files, and the music author of original sounds (it is the creator's display name).

### Use cases

- **Trend and campaign tracking.** Daily monitor on your campaign and niche hashtags; each run returns recent videos new to the page with their counts.
- **Recent content research.** `postedAfter: "7"` on a set of hashtags for this week's videos, ranked as TikTok shows them.
- **Video stats for a hashtag list.** Feed the URLs into [TikTok Video Scraper](https://apify.com/datahamster/tiktok-video-scraper) later to re-read counts, or into [TikTok Comments Scraper](https://apify.com/datahamster/tiktok-comments-scraper) for comment text.

### Try it

Hit **Start**: the prefilled input reads #running and returns 10 videos. Add hashtags, raise `maxPerHashtag` (up to 600; TikTok usually ends the list earlier), or set `postedAfter`.

**Monitor mode.** Save the input as a task and set:

```json
{
  "mode": "monitor",
  "monitorStateId": "my-hashtags",
  "hashtags": ["gymtok", "running"],
  "maxPerHashtag": 60,
  "maxItems": 200,
  "webhookUrl": "https://your-endpoint.example.com/hook"
}
```

Schedule it (Apify, Schedules, e.g. every 6 hours). The first run stores the baseline and returns nothing. Later runs return videos that were not on the page before and were posted no earlier than about 3 days before the newest video already seen (`changeType: "new"`); older videos that only now appear are recorded silently. Count changes are not reported, so you pay only for new videos and $0.005 per monitor run plus platform usage (about $0.004 to $0.006 per run on two hashtags). A run that crashes keeps its lease until its timeout; runs started meanwhile end as `overlapping_run` without charging. If that persists, use a new `monitorStateId`.

### Input

| Field | Meaning | Default |
|---|---|---|
| `hashtags` | Hashtags, one per line (`running`, `#running` or a tag link) | empty |
| `maxPerHashtag` | Videos per hashtag (counted after the date filter) | `30` |
| `postedAfter` | Date (`2026-11-01`) or number of days (`7`) | any date |
| `includeAds` | Also return paid videos (`isAd: true`) | `false` |
| `maxItems` | Stop the whole run after this many videos | `100` |
| `mode` | `scrape`, or `monitor` for new videos only | `scrape` |
| `monitorStateId`, `webhookUrl`, `telegramBotToken`, `telegramChatId` | Monitor state key and alert targets | empty |

### Pricing

| Event | Free | Bronze | Silver | Gold+ |
|---|---|---|---|---|
| result (per video) | $0.0021 | $0.0014 | $0.00105 | $0.001 |
| change (new video in monitor mode) | $0.0021 | $0.0014 | $0.00105 | $0.001 |
| monitor-check (per monitor run) | $0.005 | $0.005 | $0.0045 | $0.004 |

You pay only for pushed videos. Apify platform usage is billed by Apify on top: the example run used $0.0015; one session per hashtag is about $0.03 per 1,000 videos, deep reads with extra sessions about $0.10 per 1,000, runs with `postedAfter` $0.18 to $0.58 per 1,000 returned videos, and one monitor run on two hashtags $0.004 to $0.006.

**Found it useful?** A short review on the Store page helps other people find this actor. If a hashtag misbehaves, open an issue on the actor page.

### Related actors

- [TikTok Video Scraper](https://apify.com/datahamster/tiktok-video-scraper) for counts, music and captions of single videos by URL.
- [TikTok Comments Scraper](https://apify.com/datahamster/tiktok-comments-scraper) for comment text and likes of a video.
- [Instagram Hashtag Scraper](https://apify.com/datahamster/instagram-hashtag-scraper) for the same hashtag workflow on Instagram.

### Limits

- We read about 60 to 190 videos per hashtag; the most-used TikTok hashtag actor states 400 to 800. TikTok ends a logged-out hashtag list at about 60 to 150 videos per session, and up to 4 sessions per hashtag add more. Hashtags with millions of videos cannot be read in full.
- The order is TikTok's ranking for the hashtag page, mostly popular videos, many of them years old.
- An unknown hashtag returns nothing and is listed under `gone` in the `ADAPTER_STATS` record. When TikTok serves no videos for a hashtag on every route (direct, fresh session, residential), that hashtag is skipped; a run where nothing could be read ends as `blocked`.

### FAQ

**Do I need a TikTok account?** No.

**Why fewer videos than `maxPerHashtag`?** TikTok ended the list (`perHashtag.<tag>.stop: "end"` in `ADAPTER_STATS`) or the date filter left fewer matches.

### Changelog

- 0.1: initial release with multi-hashtag input, date filter, cross-hashtag dedupe, ads off by default and monitor mode for recent videos new to the hashtag page.

# Actor input Schema

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

TikTok hashtags, one per line, with or without #, or a hashtag link like https://www.tiktok.com/tag/running. Each hashtag is read separately; a video found under two of them is returned once.

## `maxPerHashtag` (type: `integer`):

Stop each hashtag after this many videos from its TikTok page. Example: 30.

## `postedAfter` (type: `string`):

Keep only videos posted on or after this date (2026-11-01) or within this many days (7). Empty = any date. Videos filtered out are not charged.

## `includeAds` (type: `boolean`):

Also return paid videos TikTok mixes into the hashtag page (marked isAd: true).

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

Stop the whole run after this many videos (you are charged only for pushed videos). Example: 10.

## `mode` (type: `string`):

scrape = full results; monitor = only new/changed items since the previous run of this task

## `monitorStateId` (type: `string`):

Optional state id when not running as a saved task (monitor mode)

## `webhookUrl` (type: `string`):

POST a change summary here in monitor mode

## `telegramBotToken` (type: `string`):

Optional: bot token for monitor-mode change summaries

## `telegramChatId` (type: `string`):

Optional: chat id that receives monitor-mode summaries

## Actor input object example

```json
{
  "hashtags": [
    "running"
  ],
  "maxPerHashtag": 30,
  "includeAds": false,
  "maxItems": 10,
  "mode": "scrape"
}
```

# Actor output Schema

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

All pushed rows (dataset, JSON)

## `resultsTable` (type: `string`):

Dataset in the Console viewer

## `runSummary` (type: `string`):

RUN_SUMMARY record

# 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": [
        "running"
    ],
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("datahamster/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": ["running"],
    "maxItems": 10,
}

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

```

## MCP server setup

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