BiRefNet Image Background Remover API
Remove backgrounds from images instantly using BiRefNet v2, a state-of-the-art bilateral reference network for high-resolution image segmentation. Get clean, transparent PNG outputs perfect for product photos, profile pictures, compositing, and design work.
Quick Start
Remove image backgrounds in seconds
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",
json={
"api_key": "YOUR_API_KEY",
"image_url": "https://example.com/photo.jpg"
}
)
result = response.json()
print(f"Result: {result['result']['image']['url']}")
fetch('https://netwrck.com/api/remove-background', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
api_key: 'YOUR_API_KEY',
image_url: 'https://example.com/photo.jpg'
})
})
.then(res => res.json())
.then(data => console.log('Result:', data.result.image.url))
.catch(err => console.error('Error:', err));
curl -X POST https://netwrck.com/api/remove-background \
-H 'Content-Type: application/json' \
-d '{
"api_key": "YOUR_API_KEY",
"image_url": "https://example.com/photo.jpg"
}'
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 Image
$0.02 USD
Per background removal
Billing Policy
Success: Credits charged
Failed: No charge
Only pay for successful removals
API Reference
POST /api/remove-background
Remove the background from an image using BiRefNet v2
Alias: /api/birefnet
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 |
| image_url | string | Required | URL of the image to remove the background from. Must be publicly accessible. |
| output_format | string | Optional | Output image format. Default: "png". Options: "png", "webp" |
| 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"
api_key = "YOUR_API_KEY"
payload = {
"api_key": api_key,
"image_url": "https://example.com/product-photo.jpg",
"output_format": "png"
}
try:
response = requests.post(url, json=payload, timeout=120)
response.raise_for_status()
result = response.json()
print("Background removed!")
print(f"Image URL: {result['result']['image']['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';
const apiKey = 'YOUR_API_KEY';
fetch(url, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
api_key: apiKey,
image_url: 'https://example.com/product-photo.jpg',
output_format: 'png'
})
})
.then(response => {
if (!response.ok) throw new Error(`HTTP error! Status: ${response.status}`);
return response.json();
})
.then(data => {
console.log('Background removed!');
console.log('Image URL:', data.result.image.url);
})
.catch(error => console.error('Error:', error));
const axios = require('axios');
const url = 'https://netwrck.com/api/remove-background';
const apiKey = 'YOUR_API_KEY';
axios.post(url, {
api_key: apiKey,
image_url: 'https://example.com/product-photo.jpg',
output_format: 'png'
}, {
headers: { 'Content-Type': 'application/json' },
timeout: 120000
})
.then(response => {
console.log('Background removed!');
console.log('Image URL:', response.data.result.image.url);
})
.catch(error => {
console.error('Error:', error.response ? error.response.data : error.message);
});
curl -X POST \
https://netwrck.com/api/remove-background \
-H 'Content-Type: application/json' \
-d '{
"api_key": "YOUR_API_KEY",
"image_url": "https://example.com/product-photo.jpg",
"output_format": "png"
}'
Response Examples
Success Response (200 OK)
{
"result": {
"image": {
"url": "https://v3.fal.media/files/output/image_no_bg.png",
"content_type": "image/png",
"width": 1024,
"height": 1024
}
}
}
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: image_url", "status": 400 }
Use Cases
E-commerce
- Product photo cleanup
- Catalog image standardization
- Marketplace listing preparation
Design & Creative
- Photo compositing
- Social media graphics
- Profile picture extraction
Netwrck