BiRefNet Video Background Remover API
Remove backgrounds from videos using BiRefNet v2 video segmentation. Process entire video clips to produce transparent background outputs, perfect for green-screen replacement, video compositing, and content creation workflows.
Quick Start
Remove video backgrounds programmatically
Get Your API Key
Sign in to your account to get your API key and see it automatically filled in all code examples.
Don't have an account? Sign up for free
import requests
response = requests.post(
"https://netwrck.com/api/remove-background-video",
json={
"api_key": "YOUR_API_KEY",
"video_url": "https://example.com/clip.mp4"
}
)
result = response.json()
print(f"Result: {result['result']['video']['url']}")
fetch('https://netwrck.com/api/remove-background-video', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
api_key: 'YOUR_API_KEY',
video_url: 'https://example.com/clip.mp4'
})
})
.then(res => res.json())
.then(data => console.log('Result:', data.result.video.url))
.catch(err => console.error('Error:', err));
curl -X POST https://netwrck.com/api/remove-background-video \
-H 'Content-Type: application/json' \
-d '{
"api_key": "YOUR_API_KEY",
"video_url": "https://example.com/clip.mp4"
}'
Authentication
All API requests require your API key. Sign in to get your API key and see it automatically filled in all code examples.
{
"api_key": "YOUR_API_KEY"
}
Pricing & Credits
Cost Per Video
$0.02 USD
Per video background removal
Billing Policy
Success: Credits charged
Failed: No charge
Only pay for successful removals
API Reference
POST /api/remove-background-video
Remove the background from a video using BiRefNet v2
Request Format
Send a POST request with a JSON body containing these parameters:
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | string | Required | Your API key obtained from your account page |
| video_url | string | Required | URL of the video to remove the background from. Must be publicly accessible. Supported formats: MP4, WebM, MOV. |
| response_mode | string | Optional | Set to "polling" to receive a job ID and status URL instead of waiting inline |
Complete Code Examples
import requests
url = "https://netwrck.com/api/remove-background-video"
api_key = "YOUR_API_KEY"
payload = {
"api_key": api_key,
"video_url": "https://example.com/talking-head.mp4"
}
try:
response = requests.post(url, json=payload, timeout=300)
response.raise_for_status()
result = response.json()
print("Video background removed!")
print(f"Video URL: {result['result']['video']['url']}")
except requests.exceptions.RequestException as e:
print(f"Error: {e}")
if hasattr(e, 'response') and e.response:
print(f"Response: {e.response.text}")
const url = 'https://netwrck.com/api/remove-background-video';
const apiKey = 'YOUR_API_KEY';
fetch(url, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
api_key: apiKey,
video_url: 'https://example.com/talking-head.mp4'
})
})
.then(response => {
if (!response.ok) throw new Error(`HTTP error! Status: ${response.status}`);
return response.json();
})
.then(data => {
console.log('Video background removed!');
console.log('Video URL:', data.result.video.url);
})
.catch(error => console.error('Error:', error));
const axios = require('axios');
const url = 'https://netwrck.com/api/remove-background-video';
const apiKey = 'YOUR_API_KEY';
axios.post(url, {
api_key: apiKey,
video_url: 'https://example.com/talking-head.mp4'
}, {
headers: { 'Content-Type': 'application/json' },
timeout: 300000
})
.then(response => {
console.log('Video background removed!');
console.log('Video URL:', response.data.result.video.url);
})
.catch(error => {
console.error('Error:', error.response ? error.response.data : error.message);
});
curl -X POST \
https://netwrck.com/api/remove-background-video \
-H 'Content-Type: application/json' \
-d '{
"api_key": "YOUR_API_KEY",
"video_url": "https://example.com/talking-head.mp4"
}'
Response Examples
Success Response (200 OK)
{
"result": {
"video": {
"url": "https://v3.fal.media/files/output/video_no_bg.mp4",
"content_type": "video/mp4"
}
}
}
Queued Response (202 Accepted)
{
"job_id": "job_xxx",
"status": "in_progress",
"status_url": "/api/fal/status/job_xxx"
}
Error Responses
401 Unauthorized: Invalid API key.
{ "error": "Invalid API key", "status": 401 }
402 Payment Required: Insufficient credits.
{ "error": "Insufficient credits", "status": 402 }
400 Bad Request: Missing or invalid parameters.
{ "error": "missing required field: video_url", "status": 400 }
Use Cases
Video Production
- Virtual background replacement
- Green-screen alternative
- Video compositing pipelines
Content Creation
- Social media video effects
- Presentation overlays
- Streaming scene setup
Tips
- Shorter clips process faster -- split long videos into segments for best results
- Good lighting and contrast between subject and background improves accuracy
- Use the polling response mode for longer videos to avoid timeout
Netwrck