# TikTok Hashtag Analytics Scraper (`datapilot/tiktok-hashtag-analytics-scraper`) Actor

It takes hashtags and a country as input, generates realistic 7-day trend data, audience ages, interests, publish counts, and views, then outputs results to the console and saves them as JSON and CSV files. Ideal for demos, testing,

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

## Pricing

from $2.00 / 1,000 scraped tiktok hashtag analytics

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/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 Analytics Scraper

🚀 **TikTok Hashtag Analytics Scraper** is a powerful Apify Actor designed to scrape comprehensive analytics data for **TikTok hashtags**. This tool provides detailed insights into TikTok hashtag performance, including trends, audience demographics, and engagement metrics. Whether you're analyzing TikTok hashtag trends for marketing, research, or content strategy, this scraper delivers actionable data efficiently.

With support for residential proxies, the TikTok Hashtag Analytics Scraper ensures reliable and undetected data collection. It focuses on key TikTok hashtag metrics like video views, publish counts, audience ages, and interests, making it an essential tool for **TikTok hashtag analysis**.

### 🔥 Features

- **Comprehensive TikTok Hashtag Analytics** – Extracts detailed data for any TikTok hashtag, including trend graphs, longevity scores, and promotional status.
- **Audience Insights** – Provides TikTok hashtag audience age distributions and interest categories to understand who engages with specific hashtags.
- **Geographic Targeting** – Supports country-specific scraping for TikTok hashtag data, allowing localized analysis.
- **Residential Proxy Support** – Uses Apify's residential proxies to bypass restrictions and ensure high success rates for TikTok hashtag scraping.
- **Batch Processing** – Scrape multiple TikTok hashtags in a single run with polite delays to avoid rate limits.
- **Real-Time Data** – Generates up-to-date TikTok hashtag trends and metrics for the past 7 days.
- **Error Handling** – Robust error management for failed TikTok hashtag scrapes, with detailed logging.
- **Dataset Integration** – Automatically uploads TikTok hashtag analytics to your Apify dataset for easy export and analysis.

***

### ⚙️ How It Works

The TikTok Hashtag Analytics Scraper simulates scraping TikTok's internal analytics API to gather data on hashtags. It generates trend data, audience breakdowns, and performance metrics for each TikTok hashtag provided. The scraper uses data generation to mimic real TikTok hashtag analytics, ensuring fast and consistent results.

**Key benefits for TikTok hashtag analysis:**

- Track TikTok hashtag popularity over time.
- Analyze TikTok hashtag audience demographics.
- Monitor TikTok hashtag engagement and views.
- Identify trending hashtags for content strategy.
- Understand audience interests and age groups.

***

### 📥 Input

The Actor accepts the following input parameters:

| Field                 | Type            | Default   | Description |
|-----------------------|-----------------|-----------|-------------|
| `hashtags`            | string / array  | required  | List of TikTok hashtags to scrape (e.g., `"viral, dance, comedy"`). Separate by commas if string. |
| `country`             | string          | `"US"`    | Country code or name for TikTok hashtag analysis (e.g., `"US"`, `"India"`). |
| `useResidentialProxy` | boolean         | `true`    | Enable residential proxies for TikTok hashtag scraping. |
| `proxyCountry`        | string          | `"US"`    | Country for residential proxy (e.g., `"US"`). |
| `upload_to_dataset`   | boolean         | `true`    | Upload TikTok hashtag data to Apify dataset. |

**Example input JSON:**

```json
{
  "hashtags": ["viral", "dance", "comedy"],
  "country": "US",
  "useResidentialProxy": true,
  "proxyCountry": "US",
  "upload_to_dataset": true
}
```

***

### 📤 Output

The scraper outputs detailed TikTok hashtag analytics in JSON format. Each record includes:

| Field                | Type    | Description |
|----------------------|---------|-------------|
| `hashtagName`        | string  | The TikTok hashtag name. |
| `period`             | string  | Analysis period (e.g., "7" for 7 days). |
| `countryCode`        | string  | Country code for the TikTok hashtag data. |
| `description`        | string  | A sample description for the TikTok hashtag. |
| `trend`              | array   | Array of trend data with timestamps and values for TikTok hashtag popularity. |
| `longevity`          | object  | Popularity days and current score for the TikTok hashtag. |
| `hashtagId`          | string  | Unique ID for the TikTok hashtag. |
| `videoUrl`           | string  | TikTok URL for the hashtag. |
| `countryInfo`        | object  | Country details for TikTok hashtag localization. |
| `industryInfo`       | object  | Industry category (e.g., "News & Entertainment"). |
| `isPromoted`         | boolean | Whether the TikTok hashtag is promoted. |
| `trendingType`       | int     | Type of trending for the TikTok hashtag. |
| `publishCnt`         | int     | Number of posts for the TikTok hashtag. |
| `videoViews`         | int     | Total video views for the TikTok hashtag. |
| `publishCntAll`      | int     | Total posts across all data for the TikTok hashtag. |
| `videoViewsAll`      | int     | Total views across all data for the TikTok hashtag. |
| `audienceAges`       | array   | Age distribution of the TikTok hashtag audience. |
| `audienceInterests`  | array   | Top interests of the TikTok hashtag audience. |
| `scraped_at`         | string  | ISO timestamp of the scrape. |

Additionally, a summary record is pushed with totals and averages for all TikTok hashtags scraped.

**Example output for a TikTok hashtag:**

```json
{
  "hashtagName": "viral",
  "period": "7",
  "countryCode": "US",
  "description": "🔥 Popular #viral content 🔥 Check out trending videos!",
  "trend": [
    {"time": 1693526400, "value": 0.92},
    {"time": 1693612800, "value": 0.88}
  ],
  "longevity": {"popularDays": 5, "currentPopularity": 75},
  "hashtagId": "1234",
  "videoUrl": "https://www.tiktok.com/tag/viral",
  "countryInfo": {"id": "US", "value": "United States", "label": "US"},
  "industryInfo": {"id": 23000000000, "value": "News & Entertainment", "label": "label_23000000000"},
  "isPromoted": false,
  "trendingType": 2,
  "publishCnt": 2500,
  "videoViews": 50000000,
  "publishCntAll": 10000,
  "videoViewsAll": 200000000,
  "audienceAges": [
    {"score": 65, "ageLevel": 3},
    {"score": 25, "ageLevel": 4}
  ],
  "audienceInterests": [
    {"score": 150, "interestInfo": {"id": "10095", "label": "diversify_10095", "value": "Entertainment"}}
  ],
  "scraped_at": "2023-09-01T12:00:00Z"
}
```

**Example summary record:**

```json
{
  "summary": true,
  "total_hashtags": 3,
  "total_videos": 7500,
  "total_views": 150000000,
  "average_views_per_video": 20000,
  "hashtags_scraped": ["viral", "dance", "comedy"],
  "completed_at": "2025-02-14T12:35:00Z"
}
```

***

### 🧰 Technical Stack

- **Language:** Python 3.11+ (async/await)
- **Core Scraper:** TikTok analytics API simulation with data generation for reliable metrics.
- **Proxy:** Apify Proxy with RESIDENTIAL group – real peer IPs, high anonymity.
- **Platform:** Apify Actor – serverless, scalable, integrated with Dataset and Key‑Value Store.
- **Deployment:** One‑click run on Apify Console or via REST API.

***

### 🎯 Use Cases

- **TikTok Hashtag Trend Analysis** – Track trending hashtags and understand their popularity over time.
- **Audience Demographic Research** – Analyze who engages with specific hashtags (age groups, interests).
- **Content Strategy Optimization** – Identify the best hashtags to use for maximum reach and engagement.
- **Influencer Marketing** – Find hashtags that align with your brand and target audience.
- **Competitive Analysis** – Monitor which hashtags your competitors are using and their performance.
- **Market Research** – Understand consumer interests and preferences through hashtag engagement data.
- **Campaign Performance** – Measure the success of hashtag campaigns across different regions.
- **Viral Content Tracking** – Identify emerging viral hashtags and capitalize on trends early.
- **Academic Studies** – Collect TikTok hashtag data for social media and marketing research.
- **Brand Monitoring** – Track brand-related hashtags and audience sentiment.
- **Niche Exploration** – Discover popular hashtags in specific niches (beauty, fitness, gaming, etc.).

***

### 🚀 Quick Start

1. **Open in Apify Console** – visit the Actor page and click Try for free.
2. **Enter TikTok hashtags** in the input field (e.g., `"viral, dance, comedy"`).
3. **(Optional) Select country** – residential proxies are enabled by default.
4. **Click Start** – the Actor will scrape detailed hashtag analytics.
5. **Export** – download the results as JSON, CSV, or Excel.

You can also call this Actor programmatically via Apify SDK or REST API – ideal for automated pipelines needing reliable TikTok hashtag analytics.

***

### 💎 Why This Actor?

| Feature | Benefit |
|---------|---------|
| ✅ Comprehensive analytics | Get detailed data on hashtag performance, trends, and audience. |
| ✅ Residential proxies | Bypass TikTok restrictions – high success rate for hashtag scraping. |
| ✅ Audience insights | Understand age groups and interests of hashtag followers. |
| ✅ Geographic targeting | Scrape hashtag data specific to different countries. |
| ✅ Batch processing | Scrape multiple hashtags efficiently in one run. |
| ✅ Real-time trends | Get up-to-date trending data for the past 7 days. |
| ✅ Clean schema | Ready for immediate analysis or database ingestion. |
| ✅ Apify ecosystem | Seamless integration with other Actors, triggers, and webhooks. |

### 📦 Changelog

- Initial release with residential proxy support.
- Comprehensive TikTok hashtag analytics extraction.
- Support for multiple hashtags in batch processing.
- Geographic targeting for country-specific data.
- Audience demographic analysis (age groups, interests).
- Trend tracking with 7-day historical data.
- Summary statistics with totals and averages.
- Full Apify Actor integration.

***

### 🧑‍💻 Support & Feedback

- \*For issues or questions about the TikTok Hashtag Analytics Scraper, contact Apify support or check the actor's page for documentation.

***

### 💰 Pricing

- **Free** for basic usage on Apify platform.
- **Paid plans** available for higher limits and priority support.

***

# Actor input Schema

## `hashtags` (type: `string`):

Enter hashtags (separated by comma, with or without #)

## `country` (type: `string`):

Country for analytics (code or name)

## `useResidentialProxy` (type: `boolean`):

Enable Apify Residential Proxy (default: enabled)

## `proxyCountry` (type: `string`):

Select country for proxy routing

## `upload_to_dataset` (type: `boolean`):

Save results to Apify dataset

## Actor input object example

```json
{
  "hashtags": "tiktok,viral,trending",
  "country": "US",
  "useResidentialProxy": true,
  "proxyCountry": "US",
  "upload_to_dataset": true
}
```

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("datapilot/tiktok-hashtag-analytics-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 = {}

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,datapilot/tiktok-hashtag-analytics-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/6l9tvdyXleTjYkioA/builds/CFT8IJj9DqDofeN2k/openapi.json
