Skip to main content

Examples

These were generated with Video Agent from a text prompt — no camera, no editing, no mic.

The Problem

Creating consistent social media video content requires a camera, microphone, editing skills, and hours of time per video. Most teams can’t keep up with the pace platforms demand — daily or weekly posts across TikTok, Reels, and Shorts.

How It Works

Choose topics → Write prompts → Batch generate videos → Post
You define the topics and tone. Video Agent handles avatar selection, scripting, visuals, and rendering. Generate a week’s worth of content in one run.

Build It

1

Choose your topics

You can source topics manually, from trending data, or from audience research. Here’s an example batch of 5 topics for a SaaS marketing account:
topics = [
    "Why your onboarding flow is losing users in the first 60 seconds",
    "The 3 metrics every SaaS founder checks before coffee",
    "Stop building features nobody asked for — do this instead",
    "Your pricing page is broken and here's the proof",
    "The hiring mistake that kills startups faster than bad code",
]
Use an LLM for topic research. Ask Claude or ChatGPT: “Give me 10 trending topics in [your niche] that would perform well as 30-second TikToks.” You can also use web search APIs to find what’s trending right now.
2

Write prompts optimized for short-form

Short-form video has a specific structure: hook → content → CTA, all in under 60 seconds. Your prompts should reflect this.
def build_prompt(topic):
    return f"""Create a 30-second vertical video (portrait orientation) for TikTok/Reels.

Topic: {topic}

Structure:
- Hook (0-5s): Open with a bold, scroll-stopping statement or question.
- Content (5-25s): Deliver 2-3 punchy insights. Fast pacing, one idea
  every 5-7 seconds. Use text overlays for key points.
- CTA (25-30s): End with a clear call-to-action.

Tone: Casual and energetic, like talking to a friend who's also in the industry.
Orientation: portrait.
"""

prompts = [build_prompt(t) for t in topics]
See Prompt Engineering for more techniques — especially the scene-by-scene structure for longer videos.
3

Batch generate with rate limit handling

Submit all videos to Video Agent. Space them out to respect rate limits.
import requests
import time

HEYGEN_API_KEY = "your-api-key"
video_ids = []

for i, prompt in enumerate(prompts):
    resp = requests.post(
        "https://api.heygen.com/v3/video-agents",
        headers={
            "X-Api-Key": HEYGEN_API_KEY,
            "Content-Type": "application/json",
        },
        json={
            "prompt": prompt,
            "orientation": "portrait",
        },
    )
    data = resp.json()["data"]
    video_ids.append(data["video_id"])
    print(f"[{i+1}/{len(prompts)}] Submitted: {data['video_id']}")

    # Wait between submissions to avoid rate limits
    if i < len(prompts) - 1:
        time.sleep(5)

print(f"\nAll {len(video_ids)} videos submitted.")
4

Poll for completion

Wait for all videos to finish rendering.
import time

def poll_videos(video_ids):
    results = {}
    pending = set(video_ids)

    while pending:
        for vid in list(pending):
            resp = requests.get(
                f"https://api.heygen.com/v3/videos/{vid}",
                headers={"X-Api-Key": HEYGEN_API_KEY},
            )
            data = resp.json()["data"]

            if data["status"] == "completed":
                results[vid] = data["video_url"]
                pending.discard(vid)
                print(f"Completed: {vid}")
            elif data["status"] == "failed":
                results[vid] = None
                pending.discard(vid)
                print(f"Failed: {vid}{data.get('failure_message')}")

        if pending:
            print(f"Waiting... {len(pending)} still rendering")
            time.sleep(15)

    return results

results = poll_videos(video_ids)
For production pipelines, use webhooks instead of polling. Pass a callback_url in each creation request and handle notifications as they arrive.
5

Download and distribute

Download all completed videos, then post to your platforms.
import os

os.makedirs("output", exist_ok=True)

for i, (vid, url) in enumerate(results.items()):
    if url:
        video_data = requests.get(url).content
        filename = f"output/video_{i+1}.mp4"
        with open(filename, "wb") as f:
            f.write(video_data)
        print(f"Saved: {filename}")

Platform Optimization

Different platforms have different sweet spots:
PlatformIdeal DurationOrientationTips
TikTok15–60sPortrait (9:16)Strong hook in first 2s, fast pacing
Instagram Reels15–60sPortrait (9:16)Clean visuals, text overlays
YouTube Shorts15–60sPortrait (9:16)Slightly more polished, educational angle
LinkedIn30–90sLandscape (16:9)Professional tone, industry insights
Pass "orientation": "portrait" or "orientation": "landscape" in your API call. See Video Agent docs for all parameters.

Variations

  • Themed series: Generate 5 videos on the same topic from different angles (beginner, advanced, myth-busting, case study, hot take)
  • Multi-language: Generate in English, then use Video Translation to create versions in other languages
  • A/B testing: Generate 2 versions of the same topic with different hooks, measure which performs better

Next Steps

Prompt Engineering

Write prompts that produce scroll-stopping content.

Content Repurposing

Already have blog content? Turn it into video.