What it does
The remove.bg API removes the background from photos of people, products, animals or cars, for example to cut out product shots for a web shop automatically. Send a POST request with an image URL, an uploaded file or Base64 data, and get back a PNG, JPG, WebP or ZIP image, or JSON-encoded data. The key goes in the X-Api-Key header. Free with a free API key for the first 50 calls each month; paid plans for more.
At a glance
- API key
- Needed, free · More APIs with a free key
- Pricing
- Free with a free API key for the first 50 calls each month; paid plans for more.
- From the browser
- Yes (CORS)
- Formats
- JSON
- Interface
- REST
- Provider
- remove.bg
More information: https://www.remove.bg/api
Compare: remove.bg API vs Photoroom API
Is this your service? Show that it is listed
Put this badge on your website or in your README; it links to this page. About the badge
Example request
curl
curl -X POST 'https://api.remove.bg/v1.0/removebg' \
-H 'X-Api-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"image_url":"https://www.remove.bg/example.jpg","size":"auto"}'
JavaScript
const response = await fetch("https://api.remove.bg/v1.0/removebg", {
method: 'POST',
headers: {
"X-Api-Key": "YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({"image_url":"https://www.remove.bg/example.jpg","size":"auto"}),
});
const data = await response.json();
console.log(data);
Python
import requests
response = requests.post(
"https://api.remove.bg/v1.0/removebg",
headers={
"X-Api-Key": "YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"image_url": "https://www.remove.bg/example.jpg",
"size": "auto",
},
timeout=30,
)
print(response.json())
Replace YOUR_API_KEY with your own key. The JavaScript works in a web page as well as in Node.js 18 or newer.