Articles on: API

Background Remover API Documentation

Remove backgrounds from images using our simple API. The Background Remover separates the foreground from the background and returns your image with a transparent background instead.

Requirements



Baseline API key

Using Baseline Remover API



Request



Request URL: https://api.baseline.is/v1/background-remover/
Request method: POST
Return type: PNG image
Content-Type: multipart/form-data

Request Header parameters:



The key should be prefixed by the string literal "Token", with whitespace separating the two strings. For example:

Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b



ParameterParameter TypeDescription
AuthorizationstringAPI Key


Request Body parameters



ParameterDescriptionRequired
image_fileThe Image FileIf present, other image source parameters must be empty
image_urlA URL to an ImageIf present, other image source parameters must be empty


<br>

Response



Successful responses look like this:



Status Code: 200

{
      "content": "iVBORw0KGgoAAAANSUhEUgAABQAAA...", // Base64 coded binary image
  }


Unsuccessful responses look like this:



Status Code: 400

{
    "detail": "Image parameters missing, use either image_url or image_file",
  }

<!--
In case of going over limits, the response looks like this:

{
    "detail": "Request was throttled. Expected available in 86390 seconds."
}
-->
<!--
Wrong token, the response looks like this:

{
    "detail": "Invalid token."
}
{
    "code": "image_error",
    "message": "The submitted data was not a file. Check the encoding type on the form."
}
-->

During the Beta period, every user is limited to 100 requests per day to begin with.

Updated on: 30/09/2023

Was this article helpful?

Share your feedback

Cancel

Thank you!