Photobear API

Getting Started

First off. Here's your API key. Our docs will auto-populate this key in our code examples so you don't have to hunt around for it!

<<SIGN_UP_TO_GET_YOUR_KEY>>

We also support postman integration so you can try out our API without writing any code.

Run in Postman
Submitting a Photo

All of our photo processing is supported through a single API call named

/submit_photo
. Using this endpoint, you submit a photo to all of our supported operations. You can choose which operation you want to perform by setting mode to be one of the following strings:

background_removal
vectorization
super_resolution
compress

If you're not sure what these operations mean, please try out our interactive products page to see what outputs you get for each of these operations.

curl --location --request POST 'https://photobear.io/api/public/submit-photo' \ --header 'x-api-key: <<SIGN_UP_TO_GET_YOUR_KEY>>' \ --header 'Content-Type: application/json' \ --data-raw '{ "photo_url":"<<INSERT_URL_TO_YOUR_PHOTO>>", "mode":"background_removal"}'

The response is a JSON with the following schema:

statusa string, "success" if the request is successful, and "error" otherwise
data.result_urla url that points to the processed photo

Example response:

{ "status": "success", "data": { "result_url": "https:/some_url.jpg" } }
Submitting a Video

All of our photo processing is supported through a single API call named

/submit_video
The only supported mode mode is currently remove_video_background

curl --location 'https://photobear.io/api/public/submit-video' \ --header 'x-api-key: <<YOUR_API_KEY>>>' \ --header 'Content-Type: application/json' \ --data '{"input_video_url":"INPUT_VIDEO_URL", "mode":"remove_video_background", "full_video":true, "keep_sound":true }'

The response is a JSON with the following schema:

statusa string, "success" if the request is successful, and "error" otherwise
data.first_frame_urla url that points to the first frame in the video with background removed
data.video_urla url that points to where the background-removed video will become available. The video will be placed against a white format

NOTE: this url will initially be empty, and populate within 1-15 minutes depending on video duration

data.video_alpha_urla url that points to a video that contains only the foreground layer in the input video. You can overlay this on your original rgb video to crop out the relevant part or perform other edits.

NOTE: this url will initially be empty, and populate within 1-15 minutes depending on video duration

Example response:

{ "status": "success", "data": { "first_frame_url": "https:/some/path1/image.jpg", "video_url": "https:/some/path2/video.mp4", "video_alpha_url": "https:/some/path3/video.mp4" } }
Logo
© 2024 Hoss Technology Inc.TermsPrivacy