Which endpoints are available?
The Image Editing API exposes two endpoints.
GET endpoint
GET https://image-api.photoroom.com/v2/edit
The GET
endpoint expects you to:
configure the edits you want to apply through query string arguments
provide the input image as a URL, through the argument
imageUrl
This means that the images you process through that endpoint must already be hosted on the Internet.
Here's an example of an API call made using the GET
endpoint:
curl 'https://image-api.photoroom.com/v2/edit?shadow.mode=ai.soft&background.color=FFFFFF&padding=0.1&imageUrl=URL_OF_YOUR_IMAGE' \
--header 'x-api-key: YOUR_API_KEY' \
--output result-get-endpoint.png
POST endpoint
POST https://image-api.photoroom.com/v2/edit
The POST
endpoint allows you to:
directly upload an image file, through the argument
imageFile
configure the edits through the body of the request rather than the query string
Here's an example of an API call made using the POST
endpoint:
curl --request POST \
--url https://image-api.photoroom.com/v2/edit \
--header 'Accept: image/png, application/json' \
--header 'Content-Type: multipart/form-data' \
--header 'x-api-key: YOUR_API_KEY' \
--form imageFile=@/absolute/path/to/image.jpg \
--form shadow.mode=ai.soft \
--form background.color=FFFFFF \
--form padding=0.1 \
--output result-post-endpoint.png
Last updated
Was this helpful?