Crop.photo
  1. Crop.photo API
Crop.photo
  • Crop.photo API
    • Introduction
    • Authentication
    • FAQs
    • Examples
    • Interactive API Testing
    • Auto Resize & Align
      POST
    • Body Aware Crop
      POST
    • Unrecognizable Crop
      POST
    • Remove Background
      POST
    • Create Banner Job
      POST
    • AI Lifestyle Crop
      POST
    • Banners Job Status
      POST
  1. Crop.photo API

Remove Background

POST
/crop/remove-background
The Remove Background API empowers you to effortlessly eliminate backgrounds from your images, delivering PNG files with transparent backgrounds. Whether you're enhancing product images for your e-commerce platform, refining portraits for professional use, or creating visually appealing designs, this API streamlines the process of background removal with precision and ease.
Example 1: Below given example removes the background from the image and streams it back to you.

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Body Params application/json
image_url
string <url>
required
Specifies the URL of the image. The URL should be a direct link to the image file, allowing the system to retrieve and process the image as needed.
The URL must be publicly accessible to ensure the system can retrieve the image without authentication barriers.
Supported image formats include .png, .jpg, .jpeg and .webp, etc. Ensure the URL points directly to a compatible image file.
Use a reliable hosting service to prevent issues with image availability or loading times.
This property is essential for operations that require an image as input, facilitating the integration of external images into the workflow.
Example:
https://acme.s3.aws.com/image.png
response_type
enum<string> 
required
Specifies the method by which the response is delivered to the client. Available options include:
stream - The response is streamed back in the same request. This option is optimal for immediate processing or display of the data without the need for a separate download step.
url - The response will be provided as a signed S3 URL. This method will be supported in the future and is ideal for cases where the response needs to be accessed multiple times or shared.
Note: Choosing the appropriate response type depends on the use case and the desired workflow for accessing the response data.
Allowed values:
streamurl
Default:
stream
Example:
stream
Example
{
  "image_url": "https://acme.s3.aws.com/image.png",
  "response_type": "stream"
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://us1-api.crop.photo/v1/crop/remove-background' \
--header 'Content-Type: application/json' \
--data-raw '{
    "image_url": "https://acme.s3.aws.com/image.png",
    "response_type": "stream"
}'

Responses

🟢200Success
application/octet-stream
Body
jobs
array [object {3}] 
required
An array of job objects, each representing the status of a specific job or jobs associated with specified tags.
job_id
string 
required
The unique identifier for the job.
status
enum<string> 
required
The current status of the job.
Allowed values:
pendingprocessingcompletedfailed
job_labels
array[string]
required
An array of associated job_labels to this job.
results
array [object {2}] 
required
output_image_url
string 
required
The URL to the output image, available only if the job is completed successfully.
crop_coordinates
object 
required
error_message
string 
required
An error message, provided if the job has failed.
🟠401Unauthorized
🟠400Invalid Input | Crop.photo
🟢200Image Crop Response JSON
Modified at 2025-03-18 06:41:55
Previous
Unrecognizable Crop
Next
Create Banner Job
Built with