# AI Background Remover API: Remove BG to Transparent PNG (`deapi/background-remover`) Actor

Remove background from images in bulk with AI: transparent PNG or WebP cutouts, or white background JPG for Amazon and Shopify product photos. Background remover API and eraser, remove bg from image URLs, change background color, crop or square, full resolution up to 16 MP. $0.0013 per photo.

- **URL**: https://apify.com/deapi/background-remover.md
- **Developed by:** [deAPI](https://apify.com/deapi) (community)
- **Categories:** AI, E-commerce, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 image with background removeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## AI Background Remover API: Remove BG to Transparent PNG

**Remove the background from images** with AI, one picture or thousands at once. You get a **transparent PNG or WebP** cutout, or a **white background JPG** ready for Amazon, Shopify, eBay and Etsy listings. It is an automatic **background eraser** and **remove bg API**: paste image links, and the results keep the **full resolution of your photo** (up to 16 megapixels). You can crop them to the subject, center them on a square canvas or put them on any background color. You need no design skills, no GPU, no AI provider key and no subscription. It costs **$0.0013 per typical product photo, or $1.30 per 1,000**.

**deAPI AI tools**

- Product photos too small for zoom? → [AI Image Upscaler 4x: Upscale Images to 4K & 8K in Bulk](https://apify.com/deapi/image-upscaler-4x)
- Transcribing audio or video files? → [Audio & Video Transcription: MP3, MP4 & Podcast to Text](https://apify.com/deapi/audio-video-to-text)

### What does AI Background Remover do?

It is an automatic **background remover** that works from image links. For each link, the Actor:

1. Downloads the image and checks it.
2. Has an AI segmentation model find the foreground: a product, a person, a pet, a car or a logo.
3. Removes everything behind the subject. The edges stay soft and natural, which helps with hair and fur.
4. Saves the result to your Apify storage. It comes back as a download link with its size, its background and what was billed.

It also works as a **background removal API**: send links, get back cutouts as structured data. You can use it in bulk from Python, JavaScript, cURL, Make, Zapier or n8n. It is a **background color changer** too: the same run can put every cutout on white, black, gray or your brand color.

### Why use it?

- **Bulk background removal.** Paste a list of URLs or feed in the output of another Actor. Images run in parallel.
- **Transparent PNG, WebP or white JPG.** Use PNG for design tools, WebP for websites (files about 5× smaller) and JPG for marketplaces that require a white background.
- **Any background color.** Use `#FFFFFF` for pure white, a brand color, light gray or black.
- **Full resolution.** A 4000 × 3000 photo comes back at 4000 × 3000, not as a small preview.
- **Product photo layout.** Crop to the subject with a margin, or center the subject on a **1:1 square canvas** for Amazon, Shopify, Etsy and Instagram.
- **Every common format.** JPG/JPEG, PNG, WebP, BMP, GIF and TIFF are accepted, up to 25 MB per file. Phone photos are turned upright first.
- **Damaged files are caught, not billed.** Every image is fully decoded before anything is spent.
- **Pay per image, no subscription.** $0.0013 for a 1-megapixel product photo and $0.0046 for a 12-megapixel camera photo. Images that fail cost nothing.

### What data can you get?

| Data | Details |
|---|---|
| 🖼️ **Image without background** | A download link (`imageUrl`) to the file in your run's key-value store. |
| 📐 **Size** | `outputWidth`, `outputHeight` and the file size in MB. |
| 🎨 **Background** | Transparent, or the hex color it was placed on (`backgroundColor`). |
| 🎯 **Subject** | Whether a subject was found and how much of the picture it covers (`subjectCoverage`). |
| ✂️ **Layout** | Whether the result was cropped to the subject or placed on a square canvas. |
| 🔎 **Original** | Format, width and height of the picture you linked. |
| 💵 **Billing** | The megapixels billed for the image. |

### How to remove the background from an image

1. Paste one or more links into **Image URLs**. Each link must open the picture itself.
2. Pick an **Output format**:
   - **PNG** (default): transparent background, lossless.
   - **WebP**: transparent background, small files.
   - **JPG**: white or colored background.
3. Optionally:
   - set a **Background color**;
   - turn on **Crop to subject** or **Square canvas (1:1)**;
   - set the **Margin**.
4. Click **Start**. When the run finishes, open the **Images without background** view and click any link to download. You can also export the dataset as JSON, CSV or Excel, or read it from the [Apify API](https://docs.apify.com/api/v2).

#### Output options

| You want | Settings |
|---|---|
| Transparent PNG cutout (Canva, Photoshop, Figma, stickers) | `outputFormat: png` |
| Small transparent files for a website or online shop | `outputFormat: webp` |
| Amazon main image: pure white background, product filling the frame | `outputFormat: jpg`, `squareCanvas: true`, `marginPercent: 8` |
| Shopify or Etsy catalog on a light gray background | `outputFormat: jpg`, `backgroundColor: "#F5F5F5"`, `squareCanvas: true` |
| Tight cutout of the subject only | `cropToSubject: true`, `marginPercent: 0` |
| Profile photo on a brand color | `backgroundColor: "#1E40AF"`, `squareCanvas: true` |

#### Formats and sizes

| | Supported |
|---|---|
| **Input formats** | JPG / JPEG, PNG, WebP, BMP, GIF (first frame of an animation), TIFF |
| **Output formats** | PNG (transparent), WebP (transparent), JPG (solid background) |
| **Input file size** | Up to 25 MB and 25 megapixels (JPG up to 50 MP; 16 MP for images that already have transparency and for 16-bit images) |
| **Shape** | Up to 16,384 px on the long side, and at most 100 times longer than wide |
| **Output size** | Same as your image, up to 16 megapixels (8 MP for WebP). Larger images are scaled down to that, keeping their proportions. |
| **Smallest input** | 16 px on a side |

#### Which links work

| Link | Works |
|---|---|
| `https://example.com/photo.jpg` (or .png, .webp, .bmp, .gif, .tif) | ✅ Direct image link |
| Product image URLs from Amazon, Shopify, eBay or WooCommerce scrapers | ✅ |
| Image CDNs with resizing parameters, e.g. `...photo.jpg?w=1200` | ✅ |
| Web pages that *show* an image, share pages, galleries | ❌ Use the direct link of the image itself |
| Images behind a login | ❌ The link must be public |
| SVG, HEIC, AVIF, RAW, PDF | ❌ Convert to JPG or PNG first |

#### How fast is it?

A photo is usually ready in 5–15 seconds. Several images run in parallel.

### Input

| Field | Type | Description |
|---|---|---|
| `imageUrls` | Array of URLs (strings or `{"url": ...}`) | Direct links to the images. Required. |
| `outputFormat` | `png` · `webp` · `jpg` | Format of the results. Default `png`. The price is the same for every format; WebP output stops at 8 MP, so it is never more. |
| `backgroundColor` | String | Empty for transparent. Otherwise a hex color (`#FFFFFF`) or a color name (`white`). JPG uses white when it is empty. |
| `cropToSubject` | Boolean | Trim the empty space around the subject. Default `false`. |
| `squareCanvas` | Boolean | Center the subject on a 1:1 canvas. Default `false`. |
| `marginPercent` | Integer 0–40 | Space around the subject when cropping or squaring, in % of its longer side. Default 5. |
| `maxConcurrency` | Integer 1–10 | Images processed at the same time. Default 5. No effect on price. |

```json
{
    "imageUrls": ["https://upload.wikimedia.org/wikipedia/commons/thumb/1/1f/Coffee_Mug_%28Unsplash%29.jpg/1280px-Coffee_Mug_%28Unsplash%29.jpg"],
    "outputFormat": "jpg",
    "squareCanvas": true,
    "marginPercent": 8
}
```

### Output

This is the row for the prefilled sample, a CC0 product photo of an enamel mug on a wooden table:

```json
{
    "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/1/1f/Coffee_Mug_%28Unsplash%29.jpg/1280px-Coffee_Mug_%28Unsplash%29.jpg",
    "status": "success",
    "imageUrl": "https://api.apify.com/v2/key-value-stores/.../records/0001-1280px-Coffee_Mug_-Unsplash-no-bg.png",
    "kvsKey": "0001-1280px-Coffee_Mug_-Unsplash-no-bg.png",
    "outputFormat": "png",
    "outputWidth": 1280,
    "outputHeight": 720,
    "outputMB": 0.11,
    "transparentBackground": true,
    "backgroundColor": null,
    "subjectFound": true,
    "subjectCoverage": 0.0778,
    "croppedToSubject": false,
    "squareCanvas": false,
    "inputFormat": "JPEG",
    "inputWidth": 1280,
    "inputHeight": 720,
    "processedWidth": 1280,
    "processedHeight": 720,
    "downscaledToFit": false,
    "firstFrameOnly": false,
    "billedMegapixels": 1,
    "error": null
}
```

Every link you submit gets a row:

- **Failed:** images that could not be processed have `status: "failed"` and an `error` explaining why.
- **Skipped:** images left out by a run cost limit or a free-plan allowance, and repeats of a link already in the input, have `status: "skipped"`.

Neither is charged. When no foreground subject is found, for example in a plain texture or an empty landscape, the image is still delivered with `subjectFound: false`.

### How much does it cost?

**$0.0010 per image + $0.0003 per started megapixel** (1024 × 1024 pixels) of your image as processed. The price is the same for PNG, WebP and JPG, with or without a background color, crop or square canvas. WebP output is capped at 8 MP, so with WebP an image costs at most $0.0034.

The megapixels are counted on your image itself, capped at 16 MP, not on the cropped result.

| Your image | Megapixels billed | Price |
|---|---|---|
| 800 × 800 product photo | 1 | **$0.0013** |
| 1000 × 1000 (typical marketplace image) | 1 | **$0.0013** |
| 1280 × 720 | 1 | **$0.0013** |
| 1920 × 1080 (Full HD) | 2 | **$0.0016** |
| 2000 × 2000 | 4 | **$0.0022** |
| 4000 × 3000 (12 MP camera photo) | 12 | **$0.0046** |
| 6000 × 4000 (scaled to 16 MP) | 16 | **$0.0058** |
| **1,000 product photos of 1000 × 1000** | 1 each | **$1.30** |

Images that fail are **never charged**: unreachable, not an image, damaged or too large. Neither are images skipped by a run cost limit or a free-plan allowance.

Set **maximum cost per run** to cap your spend. The Actor checks each image before it processes it and skips anything the remaining budget cannot cover.

**Free plan:** 10 images per run and 50 per calendar month (resets at 00:00 UTC on the 1st), within a daily capacity shared by all free users. Any paid Apify plan removes the free-plan limits.

### Use cases

| Use case | Why remove the background |
|---|---|
| **Amazon, Walmart and eBay listings** | Amazon and Walmart require a pure white background for the main product image, and eBay recommends one. Use JPG, a square canvas and a small margin. |
| **Shopify, WooCommerce and Etsy stores** | A consistent white or gray background across the whole catalog, or transparent WebP for your theme. |
| **Product catalogs from a scraper** | Clean up thousands of supplier or competitor product photos in the same workflow that scraped them. |
| **Marketing and social media** | Cutouts for ads, banners, thumbnails, Instagram posts and YouTube thumbnails. |
| **Profile photos and team pages** | Portraits on one brand color for a company website or LinkedIn. |
| **Car dealers and real estate** | Vehicles and objects without a distracting background. |
| **Design and print-on-demand** | Transparent PNG artwork for T-shirts, stickers, mugs and mock-ups. |
| **Datasets and AI pipelines** | Foreground masks and cutouts for training data, or for compositing with generated images. |

### Tutorial: remove backgrounds with the API

#### 1. One image in the Console

Open the Actor, keep the prefilled mug photo and click **Start**. About ten seconds later, the **Images without background** view shows the transparent PNG with a preview. Click the link to download it.

#### 2. White background product photos for a marketplace

Paste your product image URLs into **Image URLs**, one per line. Set **Output format** to JPG and turn on **Square canvas (1:1)**, then start. Every row has a download link. Export the view as CSV to map the new files back to your products.

#### 3. From Python

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("deapi/background-remover").call(run_input={
    "imageUrls": [
        "https://upload.wikimedia.org/wikipedia/commons/thumb/1/1f/Coffee_Mug_%28Unsplash%29.jpg/1280px-Coffee_Mug_%28Unsplash%29.jpg",
    ],
    "outputFormat": "png",
})
store = client.key_value_store(run["defaultKeyValueStoreId"])
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    if row["status"] == "success":
        record = store.get_record(row["kvsKey"])
        with open(row["kvsKey"], "wb") as handle:
            handle.write(record["value"])
        print(row["kvsKey"], row["outputWidth"], "x", row["outputHeight"])
```

#### 4. From JavaScript or cURL

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('deapi/background-remover').call({
    imageUrls: ['https://upload.wikimedia.org/wikipedia/commons/thumb/1/1f/Coffee_Mug_%28Unsplash%29.jpg/1280px-Coffee_Mug_%28Unsplash%29.jpg'],
    outputFormat: 'webp',
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items[0].imageUrl);
```

```bash
curl -X POST "https://api.apify.com/v2/acts/deapi~background-remover/run-sync-get-dataset-items?token=<YOUR_APIFY_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"imageUrls": ["https://upload.wikimedia.org/wikipedia/commons/thumb/1/1f/Coffee_Mug_%28Unsplash%29.jpg/1280px-Coffee_Mug_%28Unsplash%29.jpg"], "outputFormat": "jpg", "squareCanvas": true}'
```

The synchronous endpoint waits at most 5 minutes. For large batches, start the run with `POST /v2/acts/deapi~background-remover/runs` and read the dataset when it finishes. Or use the Python and JavaScript clients above, which wait for you.

#### 5. Remove backgrounds from what another Actor scraped

Chain the Actor after a product or image scraper with an Apify [integration](https://docs.apify.com/platform/integrations):

1. Pass the scraped image URLs into `imageUrls`. Plain strings and objects with a `url` field both work.
2. Send the results on with a webhook, Make, Zapier, n8n or Google Drive.

### Background removal API and integrations

Every Apify Actor has:

- a [REST API](https://docs.apify.com/api/v2);
- a [scheduler](https://docs.apify.com/platform/schedules);
- [webhooks](https://docs.apify.com/platform/integrations/webhooks);
- official [JavaScript and Python clients](https://docs.apify.com/api/client/js).

It also runs from Make, Zapier and n8n, and as a tool for AI agents through the Apify MCP server.

### FAQ

#### How do I remove the background from an image?

Paste the image link into **Image URLs** and click **Start**. The result is a PNG with a transparent background. For a white background, choose JPG.

#### How do I make a picture's background transparent?

Use PNG or WebP output (PNG is the default). Everything behind the subject becomes transparent and the subject keeps its soft edges, so you can place it on any design.

#### How do I get a white background for Amazon product photos?

Choose **JPG** output, which puts the product on pure white (`#FFFFFF`). Turn on **Square canvas (1:1)** and set **Margin** to about 8 %, so the product fills roughly 85 % of the frame; Amazon asks for 85 % or more. For any other color, set **Background color**.

#### Can I remove backgrounds from images in bulk?

Yes. Paste as many links as you like, or pass a list from another Actor. Images run in parallel, 5 at a time by default and up to 10, and each one gets its own row and file. 1,000 product photos of 1000 × 1000 cost about $1.30.

#### Is there a background remover API? Do I need an API key?

The Actor is the API. Call it with your Apify token from Python, JavaScript, cURL or any HTTP client, as in the tutorial above. You do not need an account or a key with any AI provider.

#### How do I change the background color of a photo?

Set **Background color** to a hex code (`#FFFFFF`, `#000000`, `#F5F5F5`, `#1E40AF`) or a color name (`white`, `black`), and pick PNG, WebP or JPG. The background is removed and the subject is put on that color, at the same price.

#### PNG or WebP — which should I choose?

PNG is lossless and opens everywhere (Canva, Photoshop, Figma, Office), so it is the safe default for design work. WebP keeps the same transparent background in files about five times smaller, which is better for websites, online shops and anything you serve to browsers.

#### Is there a free background remover API?

You can try it for free: on the Apify free plan you get 10 images per run and 50 per calendar month, paid from Apify's free monthly credit, through the same API. Beyond that it is pay per image from $0.0013, with no subscription.

#### Can I use the results commercially?

Yes. The files are yours and we claim no rights to them; you only need the right to use the original images you send.

#### Does it work with Shopify, WooCommerce, Make, Zapier or n8n?

Yes. Pass product image URLs from your store export, a scraper or an automation tool into `imageUrls`, and send the results back with Make, Zapier, n8n, a webhook or the API. Apify has ready integrations for all of them.

#### Is it a remove.bg alternative?

Yes, for bulk and automated work. You get transparent PNG, WebP or a solid background, the full resolution of your image up to 16 MP, crop and square layout, and pay-per-image pricing from about $0.0013. There is no subscription and no credit packs.

#### Does it keep the original resolution?

Yes, up to 16 megapixels (8 MP for WebP output). A 4000 × 3000 photo comes back at 4000 × 3000. Larger images are scaled down to 16 MP, keeping their proportions, and the row then shows `downscaledToFit: true`.

#### Does it work on hair, fur and fine details?

The AI keeps soft, semi-transparent edges, so hair, fur and fuzzy outlines look natural. Very fine strands against a background of a similar color can lose some detail.

#### Which images work best?

Images with a clear main subject: products, people, pets, cars, food and logos. When there is no obvious foreground, such as a landscape, a texture or a crowded scene, the result may be empty or partial. An empty result is marked `subjectFound: false`.

#### Can I remove the background from a logo or a signature?

Yes. Logos and graphics on a plain background come out as transparent PNGs. For signatures, use a clear scan or photo on plain paper.

#### Which image formats are supported?

| | Formats |
|---|---|
| In | JPG/JPEG, PNG, WebP, BMP, GIF, TIFF |
| Out | PNG, WebP, JPG |

For an animated GIF, the first frame is used. HEIC, AVIF and RAW files must be converted to JPG or PNG first.

#### What does an image that already has transparency do?

The areas that are already transparent stay transparent, and the background around the subject is removed as usual.

#### Is it free to try?

Yes. On the Apify free plan you can process 10 images per run and 50 per calendar month. They are charged against the free monthly platform credit.

#### Can I upload an image from my computer?

The Actor needs a link. Put the image anywhere that gives a direct public link and paste that link: your website, a cloud bucket, or an Apify key-value store record.

#### How long are the result files kept?

They are stored in the run's key-value store in your own Apify account, under your plan's data retention. If you need them for longer, download them or copy them to your own storage with an integration.

#### Why did an image fail?

Usually for one of these reasons:

- the link opens a web page rather than the image itself;
- the image is behind a login;
- the file is damaged or incomplete;
- the format is not supported.

Failures are never charged. The reason is in the row's `error` field.

### Support / feedback

Found a bug, hit an image that comes out wrong, or want a feature? Open a ticket in the **Issues** tab of this Actor's Apify Store page. Include the image URL and the run ID where you can.

# Actor input Schema

## `imageUrls` (type: `array`):

Direct links to the images to remove the background from — each link must open the picture itself, without a login. **Formats: JPG/JPEG, PNG, WebP, BMP, GIF (first frame) and TIFF**, up to **25 MB** and **25 megapixels** per file (JPG up to 50 MP; 16 MP for transparent or 16-bit images), at least 16 px and at most 16,384 px on a side. Product photos, portraits, people, pets, cars, logos and graphics all work. Results keep the **original resolution up to 16 MP** (8 MP for WebP); larger pictures are scaled down to that, keeping their proportions. Plain strings or objects with a `url` field both work. **Free plan: 10 images per run and 50 per calendar month (resets 00:00 UTC on the 1st), within a daily capacity shared by all free users. Paid plans remove the free-plan limits.**

## `outputFormat` (type: `string`):

File format of the results. **PNG** keeps a transparent background in lossless quality — best for design tools, Canva, Photoshop, stickers and logos. **WebP** keeps the transparent background in files about five times smaller — best for websites and online shops. **JPG** has no transparency: the background becomes white (or the color below) — best for Amazon, eBay and marketplace listings that require a white background. The price is the same for every format; WebP output stops at 8 MP, so it is never more.

## `backgroundColor` (type: `string`):

Leave empty for a transparent background. Or put the cutout on a solid color: a hex code such as `#FFFFFF` (pure white, as Amazon requires for main images), `#F5F5F5` (light gray) or a color name such as `white` or `black`. JPG output is always on a solid color and uses white when this is empty.

## `cropToSubject` (type: `boolean`):

Trim the empty space around the subject, leaving the margin set below. A side where the subject is cut by the photo's own edge keeps no margin.

## `squareCanvas` (type: `boolean`):

Center the subject on a square canvas with the margin set below — the 1:1 format used by Amazon, Shopify, Etsy and Instagram product images. Combine with JPG or a background color for white-background marketplace photos.

## `marginPercent` (type: `integer`):

Space left around the subject when cropping or using a square canvas, as a percentage of the subject's longer side. 5 % is a tight product shot; for a product filling about 85 % of the frame, as Amazon recommends, use about 8 %.

## `maxConcurrency` (type: `integer`):

How many images are processed at the same time. It has no effect on price.

## Actor input object example

```json
{
  "imageUrls": [
    "https://upload.wikimedia.org/wikipedia/commons/thumb/1/1f/Coffee_Mug_%28Unsplash%29.jpg/1280px-Coffee_Mug_%28Unsplash%29.jpg"
  ],
  "outputFormat": "png",
  "cropToSubject": false,
  "squareCanvas": false,
  "marginPercent": 5,
  "maxConcurrency": 5
}
```

# Actor output Schema

## `images` (type: `string`):

One row per image link: a download link to the image without its background (imageUrl), its format, width, height and size, whether the background is transparent or which color it is, whether a subject was found and how much of the picture it covers, the original's format and dimensions, and what was billed. Every link you submit produces a row. Images that could not be processed carry status 'failed' with an 'error' field and are not charged. Images left out because a free-plan allowance or a run cost limit was reached carry status 'skipped' with the reason in 'error', and are not charged either.

## `files` (type: `string`):

The images without background, stored in the run's key-value store under keys like 0001-photo-no-bg.png.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "imageUrls": [
        "https://upload.wikimedia.org/wikipedia/commons/thumb/1/1f/Coffee_Mug_%28Unsplash%29.jpg/1280px-Coffee_Mug_%28Unsplash%29.jpg"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("deapi/background-remover").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "imageUrls": ["https://upload.wikimedia.org/wikipedia/commons/thumb/1/1f/Coffee_Mug_%28Unsplash%29.jpg/1280px-Coffee_Mug_%28Unsplash%29.jpg"] }

# Run the Actor and wait for it to finish
run = client.actor("deapi/background-remover").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "imageUrls": [
    "https://upload.wikimedia.org/wikipedia/commons/thumb/1/1f/Coffee_Mug_%28Unsplash%29.jpg/1280px-Coffee_Mug_%28Unsplash%29.jpg"
  ]
}' |
apify call deapi/background-remover --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,deapi/background-remover"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/t7qVkWNVQfLDGBefV/builds/1fYEtsxJxa0oNymSH/openapi.json
