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.
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.
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 requestsimport timeHEYGEN_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 timedef 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 resultsresults = 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 osos.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}")