# TikTok & Instagram Trend Analyzer Premium (`tempting_finch/tiktok-instagram-trend-analyzer`) Actor

Premium TikTok & Instagram trend intelligence. Discover trending hashtags, sounds, creators, and content patterns with advanced engagement analytics, PDF/HTML reports, and gap analysis.

- **URL**: https://apify.com/tempting\_finch/tiktok-instagram-trend-analyzer.md
- **Developed by:** [Karl Goyer](https://apify.com/tempting_finch) (community)
- **Categories:** Automation, Developer tools, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.00005 / actor start

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/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/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.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/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

## TikTok & Instagram Trend Analyzer Premium

[![Deploy to Apify](https://img.shields.io/badge/Apify-Deploy-blue)](https://console.apify.com/actors/hTzjVPJUwbi604xY2)

**Premium cross-platform trend intelligence for TikTok & Instagram.**

Discover trending hashtags, sounds, creators and content patterns with advanced engagement analytics, growth metrics, competitive benchmarking, PDF/HTML reports, and content gap analysis.

### Features

- **Multi-Platform Analysis** — TikTok and Instagram in a single run
- **5 Analysis Modes**: Trending Hashtags, Trending Topics, Content Pattern Analysis, Competitor Analysis, Full Audit
- **Advanced Metrics**: Engagement rates, growth trends, virality scores, sentiment analysis
- **Smart Filtering**: Filter by engagement rate, followers, lookback period
- **Cross-Platform Insights**: Identify trends spanning both platforms
- **Export**: Downloadable JSON and CSV reports

### Input

| Parameter | Type | Default | Description |
|---|---|---|---|
| `platforms` | `string[]` | `["tiktok","instagram"]` | Platforms to analyze |
| `searchType` | `string` | `trending_hashtags` | Analysis mode |
| `query` | `string` | `""` | Keyword, hashtag, or niche (empty = global) |
| `maxResults` | `integer` | `50` | Max items per platform |
| `lookbackDays` | `integer` | `7` | Analysis time window |
| `minEngagementRate` | `number` | `0` | Minimum engagement rate filter |
| `minFollowers` | `integer` | `0` | Minimum follower count filter |
| `includeMetrics` | `boolean` | `true` | Include advanced analytics |
| `exportFormats` | `string[]` | `["json","csv"]` | Export file formats |

### Output

Each run produces:

- **Dataset** — Rich JSON records per platform with full trend data
- **Key-Value Store** — Downloadable JSON and CSV exports
- **Summary** — Top hashtags, creators, engagement benchmarks
- **Recommendations** — Actionable insights for content strategy

### Analysis Modes

| Mode | Description |
|---|---|
| `trending_hashtags` | Discover fastest-growing hashtags with engagement data |
| `trending_topics` | Identify trending themes and conversations |
| `content_analysis` | Analyze top-performing content and creator strategies |
| `competitor_analysis` | Benchmark competitor performance |
| `full_audit` | Everything — comprehensive platform audit |

### Run Locally

```bash
pip install -r requirements.txt
python -m src.main
````

With Apify CLI:

```bash
apify run
```

### Deploy

```bash
apify login
apify push
```

### License

MIT

# Actor input Schema

## `platforms` (type: `array`):

Select which platforms to analyze. Cross-platform analysis yields richer insights.

## `searchType` (type: `string`):

Type of trend analysis to perform.

## `query` (type: `string`):

Keyword, hashtag, or topic to analyze. Leave empty for global trending.

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

Geo-target the trend analysis to a specific region for localized insights.

## `contentType` (type: `string`):

Filter by content format type.

## `sortBy` (type: `string`):

How to rank the results.

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

Maximum number of items per platform to analyze.

## `lookbackDays` (type: `integer`):

How many days back to analyze trends.

## `minEngagementRate` (type: `number`):

Minimum engagement rate filter (0 = no filter).

## `minFollowers` (type: `integer`):

Minimum follower count filter (0 = no filter).

## `includeMetrics` (type: `boolean`):

Include advanced analytics: growth rates, sentiment, virality scores, content gap analysis, and trend lifecycle predictions.

## `includePdfReport` (type: `boolean`):

Generate a professional PDF report with charts, tables, and branded styling.

## `includeHtmlDashboard` (type: `boolean`):

Generate an interactive HTML dashboard with Chart.js visualizations.

## `exportFormats` (type: `array`):

Generate downloadable export files in these formats.

## `proxy` (type: `string`):

Optional proxy URL for requests (e.g., http://user:pass@host:port).

## Actor input object example

```json
{
  "platforms": [
    "tiktok",
    "instagram"
  ],
  "searchType": "trending_hashtags",
  "query": "fashion",
  "country": "global",
  "contentType": "all",
  "sortBy": "trending",
  "maxResults": 50,
  "lookbackDays": 7,
  "minEngagementRate": 0,
  "minFollowers": 0,
  "includeMetrics": true,
  "includePdfReport": true,
  "includeHtmlDashboard": true,
  "exportFormats": [
    "json",
    "csv"
  ],
  "proxy": ""
}
```

# 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 = {
    "platforms": [
        "tiktok",
        "instagram"
    ],
    "query": "fashion",
    "exportFormats": [
        "json",
        "csv"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("tempting_finch/tiktok-instagram-trend-analyzer").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 = {
    "platforms": [
        "tiktok",
        "instagram",
    ],
    "query": "fashion",
    "exportFormats": [
        "json",
        "csv",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("tempting_finch/tiktok-instagram-trend-analyzer").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 '{
  "platforms": [
    "tiktok",
    "instagram"
  ],
  "query": "fashion",
  "exportFormats": [
    "json",
    "csv"
  ]
}' |
apify call tempting_finch/tiktok-instagram-trend-analyzer --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=tempting_finch/tiktok-instagram-trend-analyzer",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "TikTok & Instagram Trend Analyzer Premium",
        "description": "Premium TikTok & Instagram trend intelligence. Discover trending hashtags, sounds, creators, and content patterns with advanced engagement analytics, PDF/HTML reports, and gap analysis.",
        "version": "2.0",
        "x-build-id": "TAJ58cMsnWwDoOIQp"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/tempting_finch~tiktok-instagram-trend-analyzer/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-tempting_finch-tiktok-instagram-trend-analyzer",
                "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/tempting_finch~tiktok-instagram-trend-analyzer/runs": {
            "post": {
                "operationId": "runs-sync-tempting_finch-tiktok-instagram-trend-analyzer",
                "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/tempting_finch~tiktok-instagram-trend-analyzer/run-sync": {
            "post": {
                "operationId": "run-sync-tempting_finch-tiktok-instagram-trend-analyzer",
                "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": [
                    "platforms",
                    "searchType"
                ],
                "properties": {
                    "platforms": {
                        "title": "Platforms",
                        "type": "array",
                        "description": "Select which platforms to analyze. Cross-platform analysis yields richer insights.",
                        "items": {
                            "type": "string"
                        },
                        "default": [
                            "tiktok",
                            "instagram"
                        ]
                    },
                    "searchType": {
                        "title": "Search Type",
                        "enum": [
                            "trending_hashtags",
                            "trending_topics",
                            "content_analysis",
                            "competitor_analysis",
                            "full_audit"
                        ],
                        "type": "string",
                        "description": "Type of trend analysis to perform.",
                        "default": "trending_hashtags"
                    },
                    "query": {
                        "title": "Search Query / Niche",
                        "type": "string",
                        "description": "Keyword, hashtag, or topic to analyze. Leave empty for global trending.",
                        "default": ""
                    },
                    "country": {
                        "title": "Country / Region",
                        "enum": [
                            "global",
                            "us",
                            "uk",
                            "fr",
                            "de",
                            "jp",
                            "br",
                            "in",
                            "ca",
                            "au"
                        ],
                        "type": "string",
                        "description": "Geo-target the trend analysis to a specific region for localized insights.",
                        "default": "global"
                    },
                    "contentType": {
                        "title": "Content Type Filter",
                        "enum": [
                            "all",
                            "video",
                            "image",
                            "carousel",
                            "reel"
                        ],
                        "type": "string",
                        "description": "Filter by content format type.",
                        "default": "all"
                    },
                    "sortBy": {
                        "title": "Sort Results By",
                        "enum": [
                            "trending",
                            "engagement",
                            "growth",
                            "virality"
                        ],
                        "type": "string",
                        "description": "How to rank the results.",
                        "default": "trending"
                    },
                    "maxResults": {
                        "title": "Max Results",
                        "minimum": 5,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Maximum number of items per platform to analyze.",
                        "default": 50
                    },
                    "lookbackDays": {
                        "title": "Lookback Period (Days)",
                        "minimum": 1,
                        "maximum": 90,
                        "type": "integer",
                        "description": "How many days back to analyze trends.",
                        "default": 7
                    },
                    "minEngagementRate": {
                        "title": "Min Engagement Rate (%)",
                        "minimum": 0,
                        "maximum": 100,
                        "type": "number",
                        "description": "Minimum engagement rate filter (0 = no filter).",
                        "default": 0
                    },
                    "minFollowers": {
                        "title": "Min Followers",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Minimum follower count filter (0 = no filter).",
                        "default": 0
                    },
                    "includeMetrics": {
                        "title": "Advanced Analytics",
                        "type": "boolean",
                        "description": "Include advanced analytics: growth rates, sentiment, virality scores, content gap analysis, and trend lifecycle predictions.",
                        "default": true
                    },
                    "includePdfReport": {
                        "title": "PDF Report",
                        "type": "boolean",
                        "description": "Generate a professional PDF report with charts, tables, and branded styling.",
                        "default": true
                    },
                    "includeHtmlDashboard": {
                        "title": "HTML Dashboard",
                        "type": "boolean",
                        "description": "Generate an interactive HTML dashboard with Chart.js visualizations.",
                        "default": true
                    },
                    "exportFormats": {
                        "title": "Data Export Formats",
                        "type": "array",
                        "description": "Generate downloadable export files in these formats.",
                        "items": {
                            "type": "string"
                        },
                        "default": [
                            "json",
                            "csv"
                        ]
                    },
                    "proxy": {
                        "title": "Proxy Configuration",
                        "type": "string",
                        "description": "Optional proxy URL for requests (e.g., http://user:pass@host:port).",
                        "default": ""
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
