> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hooked.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Remove Background Example

> Remove backgrounds from videos

## 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

```javascript theme={null}
const response = await fetch('https://api.hooked.so/v1/project/create/remove-background', {
  method: 'POST',
  headers: {
    'x-api-key': process.env.HOOKED_API_KEY,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    media: 'video_01'
  })
});

const data = await response.json();
console.log('Video ID:', data.data.videoId);
console.log('Project ID:', data.data.projectId);
```

## Complete Background Removal

```javascript theme={null}
const createProductVideo = async () => {
  const response = await fetch('https://api.hooked.so/v1/project/create/remove-background', {
    method: 'POST',
    headers: {
      'x-api-key': process.env.HOOKED_API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      media: 'product_demo',
      webhook: 'https://yoursite.com/webhook',
      metadata: {
        campaignId: 'summer-launch-2024',
        variant: 'A',
        createdBy: 'marketing-automation'
      }
    })
  });

  return await response.json();
};
```

## Tips for Background Removal

<Tip>**Use good lighting**: Videos with clear, even lighting produce the best results</Tip>
<Tip>**Clear separation**: Ensure good contrast between subject and background</Tip>
<Tip>**Avoid motion blur**: Sharper videos work better for background removal</Tip>
<Tip>**High quality source**: Start with the highest quality video possible</Tip>
<Tip>**Test different videos**: Some videos work better than others - experiment!</Tip>

***

## 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

```javascript theme={null}
// 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');
});
```
