{
  "openapi": "3.0.1",
  "info": {
    "title": "Background Remover — Transparent PNG & White Background AI",
    "description": "Remove the background from images in bulk with AI (BiRefNet): transparent PNG/WebP cutouts or JPG on white, any color or blur. Crop, square or Amazon-ready 2000×2000 main images. Links, uploads, Drive or scraper datasets.",
    "version": "1.0",
    "x-build-id": "98mSjp2myHT0ATgbj"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/tidydata~background-remover/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-tidydata-background-remover",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/tidydata~background-remover/runs": {
      "post": {
        "operationId": "runs-sync-tidydata-background-remover",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/tidydata~background-remover/run-sync": {
      "post": {
        "operationId": "run-sync-tidydata-background-remover",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "imageUrls": {
            "title": "Image links",
            "type": "array",
            "description": "One link per line to an image (JPG, PNG, WebP, AVIF, HEIC, GIF, BMP, TIFF). Google Drive, Dropbox and OneDrive share links work too. Product photos, people, pets, cars, food, logos…",
            "items": {
              "type": "string"
            }
          },
          "uploadedImages": {
            "title": "Or upload images",
            "type": "array",
            "description": "Upload images from your computer."
          },
          "datasetId": {
            "title": "Or: dataset of another Actor (chain it)",
            "type": "string",
            "description": "Pick the dataset of a scraper (Amazon, Shopify, eBay, Etsy, Instagram…) to cut out the image of every row. Each output row keeps the source row number and the ID you choose below."
          },
          "datasetImageField": {
            "title": "Dataset field with the image link(s)",
            "type": "string",
            "description": "For example image, thumbnailUrl, images or images.0.url. Leave empty to detect it automatically."
          },
          "datasetIdField": {
            "title": "Dataset field to copy as ID",
            "type": "string",
            "description": "Optional: e.g. asin, sku or url. Copied to each output row and used in the file name, so you can join the results back."
          },
          "maxImagesPerRow": {
            "title": "Max images per dataset row",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "1 = only the main image of each product. 0 = all images of the row.",
            "default": 1
          },
          "keyValueStoreId": {
            "title": "Or: images of a key-value store",
            "type": "string",
            "description": "Process the images saved in one of your key-value stores."
          },
          "keyValueStoreKeys": {
            "title": "Only these keys of the store",
            "type": "array",
            "description": "Optional. Empty = every key ending in .jpg, .png, .webp…",
            "items": {
              "type": "string"
            }
          },
          "layout": {
            "title": "Layout",
            "enum": [
              "original",
              "crop",
              "square",
              "amazon"
            ],
            "type": "string",
            "description": "Amazon main image follows Amazon's rules: pure white (RGB 255) background, square, product filling about 85 % of the frame, JPG.",
            "default": "original"
          },
          "background": {
            "title": "Background",
            "enum": [
              "transparent",
              "white",
              "color",
              "blur"
            ],
            "type": "string",
            "description": "What goes behind the subject. Transparent needs PNG or WebP. Blurred original keeps the photo's own background, softly blurred, like a phone's portrait mode.",
            "default": "transparent"
          },
          "backgroundColor": {
            "title": "Background color",
            "type": "string",
            "description": "Hex color used when Background = A color. E.g. #F2F2F2, #000, #FFE4E1.",
            "default": "#F2F2F2"
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "auto",
              "png",
              "webp",
              "jpg"
            ],
            "type": "string",
            "description": "PNG keeps transparency and is lossless. WebP keeps transparency and is 3-6× smaller. JPG is the most compatible but has no transparency (the cutout goes on white).",
            "default": "auto"
          },
          "outputSize": {
            "title": "Output size (px)",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Longest side of the result (the side of the square for square and Amazon layouts). 0 = keep the photo's resolution (Amazon: 2000).",
            "default": 0
          },
          "marginPercent": {
            "title": "Margin around the subject (%)",
            "minimum": 0,
            "maximum": 40,
            "type": "integer",
            "description": "Empty space around the subject on each side, for crop, square and Amazon layouts. Leave empty for the recommended value: 5 % (Amazon: 7.5 %, so the product fills about 85 % of the frame)."
          },
          "shadow": {
            "title": "Add a soft shadow under the subject",
            "type": "boolean",
            "description": "A natural contact shadow, nice for product photos on white or colored backgrounds.",
            "default": false
          },
          "cleanEdges": {
            "title": "Clean edge colors",
            "type": "boolean",
            "description": "Removes the old background's color from hair, fur and soft edges (no green or gray halo). Recommended.",
            "default": true
          },
          "includeMask": {
            "title": "Also save the mask",
            "type": "boolean",
            "description": "Saves a black-and-white mask PNG of every image as well (for designers and other tools).",
            "default": false
          },
          "jpgQuality": {
            "title": "JPG / WebP quality",
            "minimum": 50,
            "maximum": 100,
            "type": "integer",
            "description": "Compression quality for JPG and WebP files (92 = high quality, about 3× smaller than PNG). PNG is always lossless.",
            "default": 92
          },
          "maxImages": {
            "title": "Max images",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Stops after this many images. You are charged only for finished images.",
            "default": 200
          },
          "maxFileSizeMb": {
            "title": "Max image file size (MB)",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Bigger files are skipped for free (not downloaded).",
            "default": 30
          },
          "maxConcurrency": {
            "title": "Parallel downloads",
            "minimum": 1,
            "maximum": 16,
            "type": "integer",
            "description": "Images downloaded at the same time while the AI works on the previous one. Lower it if a server answers 'too many requests'.",
            "default": 4
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}