Explore our API documentation and examples to integrate remove.bg into your application or workflow.
Get Api KeyOur API is a simple HTTP interface with various options:
Source images:
Direct uploads or URL reference
Result images:
Image file or JSON-encoded data
Output resolution:
up to 25 megapixels
Requires images that have a foreground (e.g. people, products, animals, cars, etc.)
Our API is a simple HTTP interface with various options:
Get your API Key.
Your first 50 API calls per month are on us (see Pricing).
Use the following code samples to get started quickly
Review the reference docs to adjust any parameters
// Requires "guzzle" to be installed (see guzzlephp.org)
// If you have problems with our SSL certificate with error 'Uncaught GuzzleHttp\Exception\RequestException: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://removebg.live/api/remove-bg'
// follow these steps to use the latest cacert certificate for cURL: https://github.com/guzzle/guzzle/issues/1935#issuecomment-371756738
$client = new GuzzleHttp\Client();
$res = $client->post('https://removebg.live/api/remove-bg', [
'multipart' => [
[
'name' => 'image_file',
'contents' => fopen('/path/to/file.jpg', 'r')
],
[
'name' => 'width',
'contents' => '300'
]
],
'headers' => [
'X-Api-Key' => 'INSERT_YOUR_API_KEY_HERE'
]
]);
$fp = fopen("no-bg.png", "wb");
fwrite($fp, $res->getBody());
fclose($fp);