Background Remover API
This is a public version of the Background Remover API
This is a public version of the Background Remover API
Operations about process images
Lists the images you sent through this API, newest first, page by page. Each image shows its state and, when background removal is finished, the result.
Page number
Number of results per page. Max: 100
import { request } from 'undici'
const { statusCode, body } = await request('https://api-bgremover.icons8.com/api/v1/process_images?page=1&perPage=10', {
headers: {
Authorization: 'YOUR_SECRET_TOKEN'
}
})
{
"total": 3,
"images": [
{
"id": "5f6cea5d1744ceffd92c7a28",
"source": {
"width": 1200,
"height": 2400,
"type": ".jpg",
"url": "https://images-bgremover.icons8.com/584/32f5e562-bbbb-4d94-937a-f287df4eeb7f.jpg"
},
"processed": null,
"status": 0,
"statusName": "queue"
},
{
"id": "5f6c73741744cea26cb2e5f0",
"source": {
"width": 1200,
"height": 2400,
"type": ".jpg",
"url": "https://images-bgremover.icons8.com/584/32f5e562-bbbb-4d94-937a-f287df4eeb7f.jpg"
},
"processed": null,
"status": 1,
"statusName": "processing"
},
{
"id": "5f6c73731744cea26cb2e5ec",
"source": {
"width": 1200,
"height": 2400,
"type": ".jpg",
"url": "https://images-bgremover.icons8.com/584/32f5e562-bbbb-4d94-937a-f287df4eeb7f.jpg"
},
"processed": {
"width": 1200,
"height": 2400,
"type": ".png",
"url": "https://images-bgremover.icons8.com/143/c5e90f18-a2ae-4084-be5d-875a255f045b.png"
},
"status": 2,
"statusName": "ready"
}
]
}Response
Removes the background from an image that the service downloads from a link. The link must lead straight to a JPEG, PNG or WebP image, because redirects are not followed. You get either the cut-out image or only its transparency mask. The work runs in the background, so the answer comes back at once, without a result. Check the image until it is ready.
http(s) URL of a jpeg, png or webp image
import { request } from 'undici'
const { statusCode, body } = await request('https://api-bgremover.icons8.com/api/v1/process_image?image_url=&result_type=image', {
headers: {
Authorization: 'YOUR_SECRET_TOKEN'
}
})
{
"id": "5f6cea5d1744ceffd92c7a28",
"source": {
"width": 1200,
"height": 2400,
"type": ".jpg",
"url": "https://images-bgremover.icons8.com/584/32f5e562-bbbb-4d94-937a-f287df4eeb7f.jpg"
},
"processed": null,
"status": 0,
"statusName": "queue"
}Response
Removes the background from a JPEG, PNG or WebP file that you upload. You get either the cut-out image or only its transparency mask. The work runs in the background, so the answer comes back at once, without a result. Check the image until it is ready.
import { request } from 'undici'
const { statusCode, body } = await request('https://api-bgremover.icons8.com/api/v1/process_image', {
method: 'POST',
headers: {
'Content-Type': 'multipart/form-data',
Authorization: 'YOUR_SECRET_TOKEN'
},
body: undefined
})
{
"id": "5f6cea5d1744ceffd92c7a28",
"source": {
"width": 1200,
"height": 2400,
"type": ".jpg",
"url": "https://images-bgremover.icons8.com/584/32f5e562-bbbb-4d94-937a-f287df4eeb7f.jpg"
},
"processed": null,
"status": 0,
"statusName": "queue"
}Response
Shows the state of an image and, when background removal is finished, the result as a PNG. An image waits in the queue, then runs, then ends as ready or as an error. A failed image does not change again; send it again to retry. Only the images you sent through this API are found.
import { request } from 'undici'
const { statusCode, body } = await request('https://api-bgremover.icons8.com/api/v1/process_image/{id}', {
headers: {
Authorization: 'YOUR_SECRET_TOKEN'
}
})
{
"id": "5f6cea5d1744ceffd92c7a28",
"source": {
"width": 1200,
"height": 2400,
"type": ".jpg",
"url": "https://images-bgremover.icons8.com/584/32f5e562-bbbb-4d94-937a-f287df4eeb7f.jpg"
},
"processed": {
"width": 1200,
"height": 2400,
"type": ".png",
"url": "https://images-bgremover.icons8.com/143/c5e90f18-a2ae-4084-be5d-875a255f045b.png"
},
"status": 2,
"statusName": "ready"
}Response
Deletes an image together with its original and its result. Only an image in the ready state can be deleted. After the delete, the image can no longer be found.
import { request } from 'undici'
const { statusCode, body } = await request('https://api-bgremover.icons8.com/api/v1/process_image/{id}', {
method: 'DELETE',
headers: {
Authorization: 'YOUR_SECRET_TOKEN'
}
})
{
"success": true
}Response