curl 'https://backgroundly.io/api/v1/backgroundly'
-H 'x-api-key: YOUR_BACKGROUNDLY_API_KEY'
-H 'Content-Type: application/json'
--data-raw '{"input": { "url": SOURCE IMAGE URL }}'
{
"input": {
"url": "string",
"callbackUrl": "string"
}
}
url : URL of the input image from which the background is to be eliminated.
• Currently, the accepted input file formats are JPG and PNG
• The supported color spaces are RBG, Grayscale, and palette-based color spaces. CMYK and other color spaces are currently not supported.
This parameter is optional. If you specify this parameter, a callback will be made when the operation is completed.
{
"id": "string",
"status": "string",
"output": {
"url": "string"
},
"exception": {
"status": "string",
"title": "string",
"detail": "string"
},
"input": {
"url": "string",
"callbackUrl": "string"
}
}
Parameter Value | Description |
---|---|
id | Unique ID of the request. This value is generated automatically. It is useful while polling asynchronous results or processing callback responses. |
status | Status of the request: completed, running, or failed. |
Output | |
info | |
inputWidth | Width of the input image in pixels. |
inputHeight | Height of the input image in pixels. |
outputWidth | Width of the output image in pixels. |
outputHeight | Height of the output image in pixels. |
remarks | Additional remarks on the output image (if any). |
url | URL of the output image. The output URLs generated by Backgroundly are valid only for a limited time. It is recommended that the user downloads and stores the output images if he/she would like to reuse the output images later. |
callbackUrl | Displayed only if you have defined its value in the input parameters. |
exception | |
status | Status code of the error. |
title | Title of the error. |
detail | Additional information about the error. |
input | As described in input parameters. |
The status of your API call will be either Completed, Running, or Failed.
• Completed: Response Code 200 or 201 : Job successful.
• Running: Response Code 202 : Job accepting and running. You can poll the response via GET to
https://backgroundly.io/api/v1/backgroundly/{id}
• Failed: Response Code 4XX or 5XX: Job failed, or error occurred.
Status | Title | Detail |
---|---|---|
400 | invalidInput | Request parameter url is missing. |
unreachableURL | 404 Client Error: Not Found for url: "link of url" | |
badInput | Unable to load the image embedded in the URL. | |
inputTooLarge | Image above 100 megapixels cannot be handled. | |
inputTooSmall | Image size should be greater than 80 pixels. |