Photoroom API Documentation
Ask or search…
K

Image Editing API v1 In-Depth Tutorial [Legacy]

The Image Editing API v1 is now considered legacy.
We strongly recommend that you use the Image Editing API v2 instead.
The PhotoRoom Image Editing API allows you to easily generate high-quality images.
This API works by automatically applying a pre-defined template to an existing image.
Here's how a call to the API looks like:
As you can see, you need to provide 3 arguments:
  • apiKey: your personal PhotoRoom API key
  • templateId: the identifier of the template you want to apply
  • imageUrl: the URL of the image you want to use
The API has been designed so that it is very easy to integrate into an existing website.
You can notice that the last argument of the call is the imageUrl. This means that you can integrate the API simply by prefixing your existing image URL with the API call:
Here are a few before/after examples of the results the API can achieve:
Below you will find more details on the values you need to pass for the arguments apiKey and templateId, along with detailed steps to make your first call

Get an API key

Get a Template Id

To quickly get started, we recommend that you use one of our pre-configured templates.
If you need more control, you can create your own personalized template:
  • Click on “+ Create New”
  • Choose one of our starting points and customize it to your need
  • Click on the “...” button and select “Turn into Template”
  • In the Template menu, find the template you've created, click on the “...” button, and select “Copy collaborate link”
  • Your Template ID is the last part of the collaborate link:
    • https://www.photoroom.com/template/**TEMPLATE_ID**
Please make sure you don't skip clicking on “Copy collaborate link”: this action makes the template accessible by the API.
Here's a video that will walk you through these steps:

Render your Template

Now that you have your apiKey and your templateId, you're ready to generate your background!
We recommend you check out our API Reference, where you'll find code samples to implement the API call in several programming languages.

Template examples

Below are some examples of templates that you can use at your convenience, click on the hyperlink to try one! Please note that these templates are fully customizable to your own use case using the PhotoRoom web app.

Feedback

We'd love to learn about your use case for the API, bugs, and any feature requests you might have!
Feel free to join our Slack Community and ask our engineers!