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.
Baseline API key
Request URL: https://api.baseline.is/v1/background-remover/
Request method: POST
Return type: PNG image
Content-Type: multipart/form-data
The key should be prefixed by the string literal "Token", with whitespace separating the two strings. For example:
<br>
Status Code: 200
Status Code: 400
<!--
In case of going over limits, the response looks like this:
<!--
Wrong token, the response looks like this:
During the Beta period, every user is limited to 100 requests per day to begin with.
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
Parameter | Parameter Type | Description |
---|---|---|
Authorization | string | API Key |
Request Body parameters
Parameter | Description | Required |
---|---|---|
image_file | The Image File | If present, other image source parameters must be empty |
image_url | A URL to an Image | If 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
Thank you!