Guides

Background removal API guides: curl, Python, Node.js and PHP

Each guide is a short, tested example that sends one image to the LassoCut API and saves the cut-out, then lists the options and errors you will meet in that language.

The LassoCut API takes the same request as the remove.bg API: POST /v1.0/removebg with your key in the X-Api-Key header, an image file or URL, and the usual size, type, format and bg_color options. If you already call remove.bg from your code, the guides show where to change the base URL and the key. If you are starting from scratch, create a free account first: every account gets 50 free previews a month (up to 10 a day), and full-size images use credits that never expire.

curl

Remove a background from the command line with one curl call, with the options and errors you will meet.

Python

Remove image backgrounds in Python with requests: a working example, size and format options, and common errors.

Node.js

Remove image backgrounds in Node.js with the built-in fetch, no dependency, plus the options you will use most.

PHP

Remove image backgrounds in PHP with cURL, and tips for keeping an existing remove.bg client library.

More for developers