POST /api/hook
Adds a styled text overlay (“hook”) to the beginning of a video clip. Hooks are short phrases designed to capture attention in the first 1-3 seconds, such as:- “Wait for it…”
- “You won’t believe this”
- “Mind = Blown 🤯”
- “WATCH TILL THE END”
Request Body
The job ID from
/api/processZero-based index of the clip to add a hook to
The hook text to display (keep under 30 characters for readability)
Specific video filename to add hook to (for effect chaining)
Vertical position:
top, center, or bottomText size:
S (small, 0.8x), M (medium, 1.0x), or L (large, 1.3x)Response
Always
true on successful hook additionRelative URL to the video with hook overlay
Text Styling
Hooks are rendered with high-visibility styling:- Font: Impact or Arial Black (bold, all-caps)
- Color: White with yellow/orange glow
- Outline: Thick black border (3-5px)
- Background: Semi-transparent dark overlay for contrast
- Animation: Fade-in for first 0.5s, fade-out over last 1s
- Duration: 3 seconds total display time
Position Examples
Top (Default)
Center
Bottom
Size Examples
| Size | Scale | Use Case |
|---|---|---|
S | 0.8x | Subtle hooks, secondary text |
M | 1.0x | Default, balanced visibility |
L | 1.3x | Maximum impact, short phrases |
Error Codes
| Code | Description |
|---|---|
| 404 | Job ID not found |
| 404 | Metadata file not found |
| 404 | Clip index out of range |
| 404 | Video file not found at specified path |
| 500 | FFmpeg hook rendering failed |
Examples
Basic Hook Request
Python SDK Example
JavaScript/Fetch Example
Chain Hook with Other Effects
Hook Text Best Practices
High-Performing Hooks
✅ Curiosity Gap: “What happens next will shock you” ✅ Urgency: “DON’T SCROLL YET” ✅ Emotion: “This made me cry 😭” ✅ Question: “Can you guess what this is?” ✅ Challenge: “99% will fail this”Avoid
❌ Too Long: “This is an incredibly interesting video about…” (30+ chars) ❌ Generic: “Check this out” (overused) ❌ Misleading: Clickbait that doesn’t match contentPerformance Notes
- Processing Time: 10-20 seconds for typical 30-second clips
- CPU Usage: Moderate (OpenCV text rendering + FFmpeg)
- Blocking: This endpoint is synchronous (waits for completion)
Technical Implementation
Hooks are rendered using OpenCV’scv2.putText() with custom styling:
- Load video with
cv2.VideoCapture - Calculate text size and position based on frame dimensions
- Render text frame-by-frame for first 3 seconds with fade animation
- Write output with
cv2.VideoWriter - Copy audio stream from original video
Next Steps
- Translate videos to reach global audiences
- Post to social media with optimized hooks
- Apply AI effects before adding hooks for creative combinations