Overview
Remove the background from any video to create professional, overlay-ready content. Perfect for product demos, presentations, and social media content.
Basic Background Removal
const response = await fetch('https://api.tryhooked.ai/v1/project/create/remove-background', {
method: 'POST',
headers: {
'x-api-key': process.env.HOOKED_API_KEY,
'Content-Type': 'application/json'
},
body: JSON.stringify({
media: {
id: 'video_01',
url: 'https://your-cdn.com/talking-head.mp4'
}
})
});
const data = await response.json();
console.log('Video ID:', data.data.videoId);
console.log('Project ID:', data.data.projectId);
Complete Background Removal
const createProductVideo = async () => {
const response = await fetch('https://api.tryhooked.ai/v1/project/create/remove-background', {
method: 'POST',
headers: {
'x-api-key': process.env.HOOKED_API_KEY,
'Content-Type': 'application/json'
},
body: JSON.stringify({
media: {
id: 'product_demo',
url: 'https://your-cdn.com/product-showcase.mp4'
},
webhook: 'https://yoursite.com/webhook',
metadata: {
campaignId: 'summer-launch-2024',
variant: 'A',
createdBy: 'marketing-automation'
}
})
});
return await response.json();
};
Tips for Background Removal
Use good lighting: Videos with clear, even lighting produce the best results
Clear separation: Ensure good contrast between subject and background
Avoid motion blur: Sharper videos work better for background removal
High quality source: Start with the highest quality video possible
Test different videos: Some videos work better than others - experiment!
Common Use Cases
- E-commerce: Create clean product videos without distracting backgrounds
- Education: Professional-looking instructor videos
- Marketing: Eye-catching social media content
- Corporate: Professional presentations and announcements
- Content Creation: Overlay creators on custom backgrounds
Handling the Webhook Response
// Express.js webhook handler
app.post('/webhook', (req, res) => {
const { data, status, message } = req.body;
if (status === "COMPLETED") {
const { videoId, status: videoStatus, url, shareUrl } = data;
console.log('Video completed!');
console.log('Video ID:', videoId);
console.log('Download URL:', url);
console.log('Share URL:', shareUrl);
// Save to your database, notify team, etc.
}
res.status(200).send('OK');
});