Video Editor API: A Developer's Guide to Programmatic Video
Learn how to generate videos programmatically using iLoveVideoEditor's REST API, Node SDK, and VideoJSON format.
Video Editor API: A Developer's Guide to Programmatic Video
Video is eating the internet. But generating video programmatically has traditionally required complex FFmpeg pipelines, expensive cloud services, or manual editing workflows.
What if you could render videos with a simple HTTP request?
The Problem with Video Automation
Developers face several challenges when adding video features to applications:
1. **Complex infrastructure**: FFmpeg deployment, GPU servers, encoding pipelines
2. **High costs**: Cloud video APIs charge $0.05-0.20 per minute of render
3. **Limited customization**: Most APIs offer pre-built templates with little flexibility
4. **Slow iteration**: Testing video changes requires re-rendering entire files
5. **Vendor lock-in**: Proprietary formats make migration difficult
Introducing VideoJSON
iLoveVideoEditor uses a declarative format called **VideoJSON** — a JSON schema that describes video composition:
{
"duration": 5.0,
"fps": 30,
"width": 1920,
"height": 1080,
"layers": [
{
"type": "video",
"src": "background.mp4",
"start": 0,
"duration": 5
},
{
"type": "text",
"text": "Hello World",
"fontSize": 72,
"color": "#ffffff",
"position": { "x": 960, "y": 540 },
"animations": [
{
"property": "opacity",
"from": 0,
"to": 1,
"duration": 1
}
]
}
]
}This format is:
- **Version-controllable**: Diff and review video changes in Git
- **Language-agnostic**: Generate from any programming language
- **Composable**: Build complex scenes from simple components
- **Portable**: Render on browser, server, or edge
Quick Start with Node.js
Installation
npm install @ilovevideoeditor/sdk-nodeBasic Example
import { iLoveVideoEditor } from '@ilovevideoeditor/sdk-node';
const client = new iLoveVideoEditor({
apiKey: 'YOUR_API_KEY',
});
const job = await client.render.create({
videoJson: {
duration: 3,
fps: 30,
width: 1920,
height: 1080,
layers: [
{
type: 'solid',
color: '#e5352c',
duration: 3,
},
{
type: 'text',
text: 'Hello from API!',
fontSize: 64,
color: '#ffffff',
position: { x: 960, y: 540 },
duration: 3,
},
],
},
});
console.log('Job ID:', job.id);Checking Status
const status = await client.render.get(job.id);
if (status.status === 'completed') {
console.log('Download URL:', status.outputUrl);
}Advanced Features
Effects and Filters
Apply 42 built-in GLSL effects:
{
"type": "video",
"src": "input.mp4",
"effects": [
{
"type": "bloom",
"intensity": 0.5
},
{
"type": "chromaticAberration",
"offset": 3.0
}
]
}Transitions
Add smooth transitions between scenes:
{
"type": "transition",
"from": "scene1",
"to": "scene2",
"effect": "fade",
"duration": 0.5
}Animations
Animate any property over time:
{
"animations": [
{
"property": "position.x",
"from": 0,
"to": 1920,
"duration": 2,
"easing": "easeInOutCubic"
}
]
}Render Targets
Choose where your video renders:
| Target | Use Case | Speed | Cost |
|--------|----------|-------|------|
| Browser | Client-side preview | Instant | Free |
| Server | High-quality export | 1-5 min | Credits |
| Edge | Webhook-triggered | 30s-2min | Credits |
Real-World Examples
Personalized Sales Videos
Generate a unique video for each prospect:
const prospects = await getProspects();
for (const prospect of prospects) {
const job = await client.render.create({
videoJson: generateSalesVideo(prospect),
});
await sendVideoEmail(prospect.email, job.id);
}Social Media Automation
Create platform-native videos from blog posts:
app.post('/webhook/blog-published', async (req) => {
const post = req.body;
const video = await client.render.create({
videoJson: blogToVideo(post),
});
await postToSocialMedia(video.outputUrl);
});E-Commerce Product Videos
Generate product showcase videos from catalog data:
const products = await getNewProducts();
const videos = await Promise.all(
products.map(p => client.render.create({
videoJson: productToVideo(p),
}))
);Performance Tips
1. **Reuse assets**: Upload images/videos once, reference by ID
2. **Batch renders**: Submit multiple jobs simultaneously
3. **Preview first**: Use browser renderer for instant feedback
4. **Cache results**: Store rendered videos in your CDN
5. **Monitor credits**: Track usage via the dashboard API
Pricing
API usage is credit-based:
- Free tier: 50 credits/month
- Pro: 500 credits/month (€25)
- Business: 1,500 credits/month (€50)
- Enterprise: Custom
1 credit ≈ 1 minute of 1080p render time.
Getting Started
1. Sign up at ilovevideoeditor.com
2. Get your API key from the dashboard
3. Install the SDK: `npm install @ilovevideoeditor/sdk-node`
4. Make your first render request