v1.0.0
OpenAPI 2.0

Background Remover API

This is a public version of the Background Remover API

Server:https://api-bgremover.icons8.com/api
Client Libraries

Process images

​

List your processed 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.

Query Parameters

  • Page number

  • Number of results per page. Max: 100

Responses

  • application/json
  • application/json
Request Example for get/v1/process_images
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"
    }
  ]
}

Remove background from an image url

​

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.

Query Parameters

  • http(s) URL of a jpeg, png or webp image

Responses

  • application/json
  • application/json
  • application/json
Request Example for get/v1/process_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"
}

Remove background from an uploaded image

​

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.

Body

application/json

Responses

  • application/json
  • application/json
  • application/json
Request Example for post/v1/process_image
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"
}

Get a processed image

​

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.

Path Parameters

Responses

  • application/json
  • application/json
  • application/json
Request Example for get/v1/process_image/{id}
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"
}

Delete a processed image

​

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.

Path Parameters

Responses

  • application/json
  • application/json
  • application/json
  • application/json
Request Example for delete/v1/process_image/{id}
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
}