# TikTok Viral Idea Script Generator API (`shahabuddin38/tiktok-viral-idea-script-generator-api`) Actor

Generate viral TikTok ideas, hooks, scripts, captions, hashtags, and content calendars for any niche. Designed for creators and agencies to grow faster with ready-to-use content. No coding required, just input your niche and get high performing video ideas instantly.

- **URL**: https://apify.com/shahabuddin38/tiktok-viral-idea-script-generator-api.md
- **Developed by:** [Shahab Uddin](https://apify.com/shahabuddin38) (community)
- **Categories:** Videos, Social media, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 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.

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

## TikTok Viral Idea & Script Generator API

Generate TikTok content ideas, viral hooks, ready-to-film scripts, captions, hashtags, and content calendars for any niche. Turn simple topics into short-form video ideas designed for creators, agencies, brands, and social media managers. This Actor works as a TikTok idea generator, TikTok script generator, viral TikTok hooks builder, TikTok content calendar planner, TikTok caption generator, TikTok hashtag generator, short-form video ideas engine, TikTok growth tool, and creator content engine for repeatable content planning.

This is not a TikTok scraper, downloader, or fake engagement tool. It is a TikTok content generation and growth planning engine built for creators and marketers who want clearer content direction fast.

### What this Actor does

- Understands a niche, target audience, goal, offer, tone, language, and preferred content format.
- Generates multiple viral hook styles including curiosity, pain-point, mistake, transformation, contrarian, list, story, and shock hooks.
- Produces TikTok video ideas across educational, entertainment, storytelling, before/after, myth-busting, trend-adapted, product demo, and problem-solution formats.
- Builds ready-to-film scripts with hook, scene-by-scene flow, voiceover, on-screen text, CTA, and filming notes.
- Creates short captions, SEO captions, emotional captions, CTA captions, and balanced hashtag sets.
- Scores each idea with a strategic viral score and builds a 7-day or 30-day content calendar.
- Saves a non-billable strategy report to `OUTPUT.json`.

### Who it is for

- TikTok creators
- Social media managers
- Content agencies
- UGC creators
- Ecommerce brands
- Affiliate marketers
- Coaches
- Local businesses
- Short-form video editors

### Use cases

- Turn a niche into 10 to 100 TikTok ideas for a monthly content sprint.
- Build hooks and scripts for client deliverables inside an agency workflow.
- Create product demo ideas for ecommerce, SaaS, coaching, or local services.
- Build a TikTok content calendar for launches, offers, seasonal campaigns, or ongoing growth.
- Generate repurposing notes for TikTok, Instagram Reels, YouTube Shorts, and Facebook Reels.

### Input

Key inputs include:

- `niche`
- `targetAudience`
- `goal`
- `offerOrProduct`
- `location`
- `language`
- `tone`
- `contentFormat`
- `videoLength`
- `numberOfIdeas`
- toggles for scripts, captions, hashtags, content calendar, and repurposing

Default local test input:

```json
{
  "niche": "fitness for beginners",
  "targetAudience": "beginners who want simple workouts",
  "goal": "viral_growth",
  "numberOfIdeas": 10
}
````

### Output

The default dataset only stores billable, high-value rows:

- `viral_content_idea`
- `tiktok_script`
- `content_calendar_item`

Every dataset row includes a hook, video idea, viral score, priority score, and reason. Depending on the row type and selected options, it can also include scripts, captions, hashtags, repurposing notes, calendar day, and posting angle.

The Actor also stores a non-billable `OUTPUT.json` report with:

- summary
- best hooks
- content calendar
- growth strategy
- limitations

### Viral scoring

Each idea is scored from `0` to `100` using weighted strategic signals:

- Hook strength: 30%
- Audience fit: 25%
- Shareability: 20%
- Clarity: 15%
- CTA fit: 10%

Higher scores go to hooks that are specific, easy to understand, audience-relevant, and aligned with the selected goal.

### Content calendar

Choose a 7-day or 30-day content calendar. Each calendar item includes:

- day
- idea
- hook
- script format
- caption
- hashtags
- posting angle

This makes the Actor useful as both a content ideation API and a short-form publishing planner.

### AI support

The Actor works without any AI API keys using strong rule-based templates and scoring logic.

If `OPENAI_API_KEY` or `GEMINI_API_KEY` is available, the Actor can lightly polish hook wording for more variety. The core generation engine remains template-driven so runs do not fail when no AI provider is configured.

### Billing notes

Only generated content idea, script, and content calendar rows are written as billable dataset results. Summaries and strategy reports are saved to `OUTPUT.json`.

### Limitations

- Generated content should be reviewed before publishing.
- Viral performance is not guaranteed.
- Scores are strategic estimates based on content structure and audience fit.
- Non-English runs work best when the niche and audience are already written clearly in the target language.
- This Actor does not scrape TikTok data, trending sounds, or account analytics.

### FAQ

**Does this Actor scrape TikTok?**

No. It is positioned as a TikTok viral idea generator, TikTok script generator, TikTok content calendar API, and creator growth tool.

**Does it work without AI keys?**

Yes. The full generation pipeline works without `OPENAI_API_KEY` or `GEMINI_API_KEY`.

**What gets billed?**

Only the dataset rows that contain usable content outputs. Non-billable summaries stay in `OUTPUT.json`.

**Can I use this for agencies or client work?**

Yes. The output format is designed for creators, freelancers, agencies, social teams, and client-facing production workflows.

**Can I export the result for spreadsheets or automations?**

Yes. The dataset supports structured exports for API, JSON, CSV-ready processing, and content calendar workflows.

### Pricing recommendation

- Launch price: `$0.01` per generated content idea plus an Actor start fee of `$0.00005`
- After validation: `$0.02` per generated content idea

### Thumbnail idea

- Main text: `VIRAL TIKTOK IDEAS`
- Main text: `SCRIPTS + HOOKS`
- Subtext: `Niche → Content plan`

# Actor input Schema

## `niche` (type: `string`):

Your niche or topic.

## `targetAudience` (type: `string`):

Who the content is for.

## `goal` (type: `string`):

Content Goal

## `offerOrProduct` (type: `string`):

Offer or Product

## `location` (type: `string`):

Location

## `language` (type: `string`):

Language

## `tone` (type: `string`):

Tone

## `contentFormat` (type: `string`):

Content Format

## `videoLength` (type: `string`):

Video Length

## `numberOfIdeas` (type: `integer`):

Number of Ideas

## `includeScripts` (type: `boolean`):

Include Scripts

## `includeCaptions` (type: `boolean`):

Include Captions

## `includeHashtags` (type: `boolean`):

Include Hashtags

## `includeContentCalendar` (type: `boolean`):

Include Content Calendar

## `calendarDays` (type: `integer`):

Calendar Days

## `includeRepurposing` (type: `boolean`):

Include Repurposing Ideas

## `exportFormat` (type: `string`):

Export Format

## Actor input object example

```json
{
  "niche": "fitness for beginners",
  "targetAudience": "busy moms, students, small business owners",
  "goal": "viral_growth",
  "offerOrProduct": "",
  "location": "",
  "language": "en",
  "tone": "friendly",
  "contentFormat": "mixed",
  "videoLength": "30_seconds",
  "numberOfIdeas": 20,
  "includeScripts": true,
  "includeCaptions": true,
  "includeHashtags": true,
  "includeContentCalendar": true,
  "calendarDays": 7,
  "includeRepurposing": true,
  "exportFormat": "dataset"
}
```

# Actor output Schema

## `viralIdeas` (type: `string`):

No description

## `scripts` (type: `string`):

No description

## `calendar` (type: `string`):

No description

## `growthReport` (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 = {
    "niche": "fitness for beginners",
    "targetAudience": "busy moms, students, small business owners"
};

// Run the Actor and wait for it to finish
const run = await client.actor("shahabuddin38/tiktok-viral-idea-script-generator-api").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 = {
    "niche": "fitness for beginners",
    "targetAudience": "busy moms, students, small business owners",
}

# Run the Actor and wait for it to finish
run = client.actor("shahabuddin38/tiktok-viral-idea-script-generator-api").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 '{
  "niche": "fitness for beginners",
  "targetAudience": "busy moms, students, small business owners"
}' |
apify call shahabuddin38/tiktok-viral-idea-script-generator-api --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "TikTok Viral Idea Script Generator API",
        "description": "Generate viral TikTok ideas, hooks, scripts, captions, hashtags, and content calendars for any niche. Designed for creators and agencies to grow faster with ready-to-use content. No coding required, just input your niche and get high performing video ideas instantly.",
        "version": "0.1",
        "x-build-id": "8DBAUidxEXjEGUOD2"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/shahabuddin38~tiktok-viral-idea-script-generator-api/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-shahabuddin38-tiktok-viral-idea-script-generator-api",
                "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/shahabuddin38~tiktok-viral-idea-script-generator-api/runs": {
            "post": {
                "operationId": "runs-sync-shahabuddin38-tiktok-viral-idea-script-generator-api",
                "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/shahabuddin38~tiktok-viral-idea-script-generator-api/run-sync": {
            "post": {
                "operationId": "run-sync-shahabuddin38-tiktok-viral-idea-script-generator-api",
                "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": [
                    "niche"
                ],
                "properties": {
                    "niche": {
                        "title": "Niche",
                        "type": "string",
                        "description": "Your niche or topic."
                    },
                    "targetAudience": {
                        "title": "Target Audience",
                        "type": "string",
                        "description": "Who the content is for."
                    },
                    "goal": {
                        "title": "Content Goal",
                        "enum": [
                            "viral_growth",
                            "sales",
                            "lead_generation",
                            "followers",
                            "education",
                            "brand_awareness"
                        ],
                        "type": "string",
                        "description": "Content Goal",
                        "default": "viral_growth"
                    },
                    "offerOrProduct": {
                        "title": "Offer or Product",
                        "type": "string",
                        "description": "Offer or Product",
                        "default": ""
                    },
                    "location": {
                        "title": "Location",
                        "type": "string",
                        "description": "Location",
                        "default": ""
                    },
                    "language": {
                        "title": "Language",
                        "enum": [
                            "en",
                            "es",
                            "fr",
                            "de",
                            "it",
                            "pt",
                            "ur",
                            "hi",
                            "ar"
                        ],
                        "type": "string",
                        "description": "Language",
                        "default": "en"
                    },
                    "tone": {
                        "title": "Tone",
                        "enum": [
                            "friendly",
                            "bold",
                            "professional",
                            "funny",
                            "emotional",
                            "educational",
                            "direct"
                        ],
                        "type": "string",
                        "description": "Tone",
                        "default": "friendly"
                    },
                    "contentFormat": {
                        "title": "Content Format",
                        "enum": [
                            "mixed",
                            "talking_head",
                            "faceless",
                            "product_demo",
                            "storytelling",
                            "listicle",
                            "before_after"
                        ],
                        "type": "string",
                        "description": "Content Format",
                        "default": "mixed"
                    },
                    "videoLength": {
                        "title": "Video Length",
                        "enum": [
                            "15_seconds",
                            "30_seconds",
                            "60_seconds"
                        ],
                        "type": "string",
                        "description": "Video Length",
                        "default": "30_seconds"
                    },
                    "numberOfIdeas": {
                        "title": "Number of Ideas",
                        "minimum": 5,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Number of Ideas",
                        "default": 20
                    },
                    "includeScripts": {
                        "title": "Include Scripts",
                        "type": "boolean",
                        "description": "Include Scripts",
                        "default": true
                    },
                    "includeCaptions": {
                        "title": "Include Captions",
                        "type": "boolean",
                        "description": "Include Captions",
                        "default": true
                    },
                    "includeHashtags": {
                        "title": "Include Hashtags",
                        "type": "boolean",
                        "description": "Include Hashtags",
                        "default": true
                    },
                    "includeContentCalendar": {
                        "title": "Include Content Calendar",
                        "type": "boolean",
                        "description": "Include Content Calendar",
                        "default": true
                    },
                    "calendarDays": {
                        "title": "Calendar Days",
                        "minimum": 1,
                        "maximum": 30,
                        "type": "integer",
                        "description": "Calendar Days",
                        "default": 7
                    },
                    "includeRepurposing": {
                        "title": "Include Repurposing Ideas",
                        "type": "boolean",
                        "description": "Include Repurposing Ideas",
                        "default": true
                    },
                    "exportFormat": {
                        "title": "Export Format",
                        "enum": [
                            "dataset",
                            "json",
                            "csv-ready",
                            "content-calendar"
                        ],
                        "type": "string",
                        "description": "Export Format",
                        "default": "dataset"
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
