VOOZH about

URL: https://apify.com/moulds.ai/script-generation

โ‡ฑ Script Architect ยท Apify


๐Ÿ‘ Script Architect avatar

Script Architect

Under maintenance

Pricing

from $50.00 / 1,000 script generateds

Go to Apify Store

Script Architect

Under maintenance

AI-powered script writer for TikTok, Instagram Reels & YouTube Shorts. Generates viral short-form video scripts with hooks, scene breakdowns & captions โ€” powered by Gemini 2.0 Flash + LangGraph.

Pricing

from $50.00 / 1,000 script generateds

Rating

0.0

(0)

Developer

๐Ÿ‘ Rahul Agarwal

Rahul Agarwal

Maintained by Community

Actor stats

0

Bookmarked

9

Total users

0

Monthly active users

4 months ago

Last modified

Share

๐ŸŽฌ Script Architect

AI agent that researches trending short-form content and generates structured video scripts with scene-by-scene visual prompts for Instagram Reels, TikTok, and YouTube Shorts.

Built on Apify + LangGraph + Gemini 2.0 Flash.


How It Works

  1. Scrapes trending content for your topic via Apify sub-actors (TikTok/Instagram)
  2. Analyzes patterns โ€” hook styles, engagement metrics, hashtag clusters, video durations
  3. Generates a structured script with narrative arc enforcement, timed scenes, and AI-ready visual prompts
  4. Validates everything โ€” Pydantic cross-validators enforce duration math, scene sequencing, and visual prompt quality

Input

FieldTypeRequiredDefaultDescription
topicstringโœ…โ€”A specific content angle (10โ€“200 chars). Bad: "AI". Good: "Why AI tools make junior devs slower before they make them faster"
targetAudiencestringnullWho is this for? Include role + pain point. Example: "Junior devs overwhelmed by AI coding assistants"
contentGoalenumawarenessawareness ยท education ยท conversion ยท entertainment ยท thought_leadership
platformenumINSTAGRAM_REELINSTAGRAM_REEL ยท TIKTOK ยท YOUTUBE_SHORT
targetDurationinteger45Target duration in seconds (15โ€“60)
toneenumcontrariancontrarian ยท storyteller ยท insider ยท skeptic ยท teacher ยท agitator ยท auto
hookStyleenumautocontradiction ยท stat ยท story ยท question ยท bold_claim ยท curiosity_gap ยท auto
visualStyleenumautotalking_head ยท b_roll_cinematic ยท screen_recording ยท motion_graphics ยท mixed ยท auto
referenceCreatorsarray[]Up to 3 Instagram/TikTok usernames to study (e.g. ["hubermanlab", "garyvee"])
brandVoicestringnull1โ€“2 sentence voice description. Example: "Direct and technical, like a senior engineer mentoring over coffee"
avoidTopicsarray[]Topics to never mention (e.g. ["competitor names", "pricing"])
contentPurposeenumstandalonestandalone ยท series_episode ยท repurposed_longform
outputLanguagestringenISO 639-1 language code
debugbooleanfalseVerbose logging + saves prompt/output to key-value store

Example Input

{
"topic":"Why AI tools make junior devs slower before they make them faster",
"targetAudience":"Junior developers overwhelmed by AI coding assistants",
"contentGoal":"thought_leadership",
"platform":"TIKTOK",
"targetDuration":45,
"tone":"contrarian",
"hookStyle":"bold_claim",
"visualStyle":"b_roll_cinematic",
"brandVoice":"Direct and technical but accessible. Like a senior engineer mentoring over coffee.",
"avoidTopics":["specific tool names","pricing"]
}

Output

The agent produces a structured JSON script pushed to the Apify dataset:

FieldTypeDescription
hookstringOpening line for the first 3 seconds
hook_typeenumHook formula used (bold_claim, question, contradiction, etc.)
scenesarrayScene-by-scene breakdown (see below)
total_durationfloatTotal script duration in seconds
platformenumTarget platform
visual_stylestringGlobal visual treatment applied to all scenes
tone_usedenumTone archetype applied
content_strategystringOne-line strategy summary
trending_patterns_usedarrayPatterns borrowed from trend research
ctastringCall-to-action text
music_moodstringSuggested music mood (optional)

Scene Structure

Each scene in the scenes array contains:

FieldTypeDescription
idintSequential scene number (1, 2, 3, ...)
roleenumNarrative function: hook ยท context ยท conflict ยท revelation ยท cta
textstringSpoken/displayed script text (10โ€“200 chars)
visual_promptstringAI image/video generation prompt (60โ€“300 chars) โ€” includes subject, environment, lighting, camera angle, and 9:16 framing
negative_promptstringWhat to exclude from visuals (optional)
duration_targetfloatScene duration in seconds (2โ€“10s)

Example Output

{
"hook":"AI makes you slower.",
"hook_type":"bold_claim",
"scenes":[
{
"id":1,
"role":"hook",
"text":"AI makes you slower.",
"visual_prompt":"Close-up of hands struggling to type, surrounded by error messages, harsh red lighting, shallow depth of field, cinematic, 9:16 vertical frame, mobile-optimized composition",
"negative_prompt":null,
"duration_target":3.0
},
{
"id":2,
"role":"context",
"text":"At first, anyway.",
"visual_prompt":"Abstract animation of AI learning, lines of code forming and reforming, dark background with bright accents, futuristic, 9:16 vertical frame, mobile-optimized composition",
"negative_prompt":null,
"duration_target":4.0
},
{
"id":3,
"role":"conflict",
"text":"...but no understanding.",
"visual_prompt":"Junior dev staring blankly at code, confused expression, face illuminated by screen, desaturated colors, 9:16 vertical frame, mobile-optimized composition",
"negative_prompt":null,
"duration_target":6.0
},
{
"id":4,
"role":"revelation",
"text":"Learn fundamentals first.",
"visual_prompt":"Hands methodically writing code, syntax highlighting, warm lighting, focused, 9:16 vertical frame, mobile-optimized composition",
"negative_prompt":null,
"duration_target":6.0
},
{
"id":5,
"role":"cta",
"text":"Agree or disagree?",
"visual_prompt":"Developer leaning back, thoughtful expression, screen reflecting, soft lighting, 9:16 vertical frame, mobile-optimized composition",
"negative_prompt":null,
"duration_target":6.0
}
],
"total_duration":44.0,
"platform":"TIKTOK",
"visual_style":"Dark, moody cinematic B-roll footage. Focus on hands coding, screens glowing, and abstract algorithms. Grainy, desaturated color grading, 9:16 vertical frame",
"tone_used":"contrarian",
"content_strategy":"Challenge the idea that AI is always beneficial for junior devs.",
"trending_patterns_used":[
"Contrarian viewpoint to spark debate",
"Problem-Agitate-Solve narrative structure"
],
"cta":"Agree or disagree?",
"music_mood":null
}

Validation Rules

The agent enforces these constraints on every output:

  • โœ… Narrative arc: First scene = hook, last scene = cta, at least one conflict or revelation in between
  • โœ… Duration math: total_duration must match sum of scene durations (ยฑ3s)
  • โœ… Scene IDs: Must be unique and sequential [1, 2, 3, ...]
  • โœ… Visual prompts: 60+ characters with subject, lighting, camera angle, and 9:16 framing
  • โœ… Target duration: Output checked against your targetDuration input (ยฑ5s tolerance)
  • โœ… Speaking rate: Scene text validated against duration at language-appropriate words-per-minute

Running Locally

  1. Set your Google API key:

    $exportGOOGLE_API_KEY=your_key_here
  2. Run with the test input:

    $apify run

    The default input is in storage/key_value_stores/default/INPUT.json.


Deploying to Apify

  1. Push to Apify:

    $apify push
  2. Set GOOGLE_API_KEY in the actor's Environment Variables on Apify Console.

  3. Run from the Console or via API.


Pricing (Pay-Per-Event)

EventPriceTrigger
Script Generated$0.05Per complete script pushed to dataset
Trending Research$0.02Per trending content search
Creator Analysis$0.03Per creator profile analyzed

Tech Stack

  • Runtime: Python 3.14 on Apify
  • LLM: Google Gemini 2.0 Flash
  • Agent Framework: LangGraph (ReAct pattern)
  • Schema Validation: Pydantic v2
  • Data Sources: Apify sub-actors (clockworks/tiktok-scraper, apify/instagram-hashtag-scraper, apify/instagram-scraper)

You might also like

TikTok Viral AI Hunter

adray_soft/tiktok-viral-ai-hunter

Finds VIRAL TikTok videos (>100k views) and analyzes them with Gemini 2.5 AI. Extracts Visual Hooks, Audio Strategy, and Script Structure from the actual video file.

๐Ÿ‘ User avatar

AdRay AI Solutions

3

Video Script + Storyboard (AI) - Hooks + Captions

macheta/video-script-storyboard

Generate video hooks, scripts, storyboard shot lists, on-screen text, captions, and thumbnail prompts tailored to TikTok, YouTube, Instagram, X, or LinkedIn.

YouTube Shorts Scraper & Viral Trend Finder

star_vessel/cross-platform-viral-scraper

High-speed YouTube Shorts scraper to find viral trends and hooks.

YouTube Shorts Scraper โ€” Short Video Data & Trends

oneary/youtube-shorts-scraper

Scrape YouTube Shorts by keyword or channel. Extract titles, views, likes, comments, and creator data for short-form video trend analysis.

Google Shorts Scraper

codingfrontend/google-shorts-scraper

Scrape short-form video results from Google Search across all platforms (YouTube Shorts, TikTok, Instagram Reels, Facebook Reels, etc.) including title, link, platform, channel, views, duration, and thumbnail.

๐Ÿ‘ User avatar

Coding Frontned

7

Google Shorts Scraper

searchapi/google-shorts-scraper

Scrape short-form video results from Google Search across all platforms (YouTube Shorts, TikTok, Instagram Reels, Facebook Reels, etc.) including title, link, platform, channel, views, duration, and thumbnail.

TikTok Viral Idea Script Generator API

shahabuddin38/TikTok-Viral-Idea-Script-Generator-API

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.