Troubleshooting
On this page, you will find some common questions or issues you might encounter when integrating the Photoroom API, along with their answer.
Q: Why do I get the error "Unauthorized"
when calling the API?
"Unauthorized"
when calling the API?A: If your call is resulting in this error:
Then it's likely that you either forgot to put your apiKey in the headers of your call or that your credit balance has reached zero.
You can learn how to get your apiKey here and how to monitor your credit balance here.
Q: Can I send my image in Base64 format?
A: Yes, sending your image in Base64 format is possible for the Remove Background API.
Here's are some sample codes in JavaScript and Python:
Q: When I call the Remove Background API, the result image gets rotated
A: An image can be rotated through a value set inside the EXIF metadata of the image.
Because the Remove Background API doesn’t carry over EXIF metadata into the result image, the rotation will then get lost in the process.
The best solution to this problem is to physically perform the rotation by rotating the image itself before making the API call.
Here’s an example of how to do it when using the JavaScript library sharp
:
This problem should not happen when using the Image Editing API.
Q: I'm using Axios to make the API call, but I can't decode the result image
A: Calls to the Photoroom API will return a binary image in the body of the HTTP response.
In order to properly decode the image when using Axios to make the API call, you'll need to configure the call with the option { responseType: 'arraybuffer' }
:
Q: I'm using requests
in Python and I get a 500 error
requests
in Python and I get a 500 errorA: If you're using the requests
library in Python to make your API call and you're getting a 500 error, please make sure that you are not manually setting the HTTP header Content-Type: multipart/form-data
.
This header is already being automatically added by the requests
library, so adding it a second time in your code will lead to a malformed request.
Q: Photoroom API has stopped working/answering
A: The Photoroom API is used by the Photoroom iOS, Android, and Web apps. Timeouts are unlikely to happen or would impact our own products in a critical way.
If Photoroom API has stopped working on your side, please check the following points:
Do you still have credits? Visit your dashboard and check your remaining credits, you can buy more credits directly from your dashboard if needed.
Is the API returning an error or an erroneous image? Report your technical bug or issue using the procedure explained in the following question.
Q: I have a technical issue/bug with Photoroom API
A: We currently don't provide technical support for implementing the API over email.
In case of an integration issue or of a bug on Photoroom's side:
Share with us:
A standalone code to reproduce the bug
The original input image you used
The output image returned by Photoroom API
A detailed description or visual example of the expected image you would have liked to get
We will investigate the issue and come back to you shortly.
Last updated