Image Editing API v1 In-Depth Tutorial [Legacy]
Last updated
Last updated
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
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 “Share”
Your Template ID is the last part of the link that was copied to your pasteboard:
https://www.photoroom.com/template/**TEMPLATE_ID**
Please make sure you don't skip clicking on “Share”: this action makes the template accessible by the API.
Here's a video that will walk you through these steps:
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.
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.
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!
Square, white background, 5% padding (templateId: 9124f52a-3512-48b7-80f1-2cb07a3607fb)
Square white background, 10% padding (templateId: 8c30bbc9-196a-4c9f-ab12-03f9dd28f28a)
Square, black background, 5% padding (templateId: 267f6020-2814-4c4f-83c5-9908e8f60d63)
Square, black background, 5% padding, 5-pixel outline (templateId: 781f84c0-89fa-4a93-a50f-d9c339c2cc23)
Shopify landscape, white background, 5% margin (templateId: e31818d4-6d3d-4287-afa3-f26ff13363f7)
Shopify landscape, white background, 10% margin (templateId: 3738aae0-45c3-4990-a6fc-2d742a57a632)
Square, custom plain color background, 5% padding (templateId: 592dd982-4a1b-4cd9-ab11-21481d5a0064)
Square, custom silk background, 5% padding (templateId: a2d6eb02-65fa-4133-8c20-b5aaa880bd72)
Square, custom watermark background, 5% padding (templateId: 4dc3ee88-5682-4727-84c6-45792dbef865)
Square, white background, custom logo, 5% padding (templateId: 071171b9-12ca-4b07-8242-eb785f4067b2)
Square, white background, 5% padding, sticker (templateId: bf39f706-b698-45aa-82e7-fe0d76730e88)
Square, wood custom background, 5% padding, custom text (templateId: 11c6dfd5-9ffc-4b21-a38e-bd61e00e3668)
Square, white background, 5% padding, 2D shadow (templateId: d07703ba-b71d-4c6d-b652-0a37c7dfbcae)
Square, white background, 5% padding, 3D shadow (templateId: 74a4fc24-ce32-4481-9cba-9a8f8d21fe43)
Square, Black Friday custom texture background, 5% padding (templateId: 95681f58-039d-4384-8f16-85a43b17aea2)
Square, marble custom background, 5% padding (templateId: 88a56429-6b29-4235-9778-54b971b189a0)
Square, white background, 5% padding, +10% brightness (templateId: f49108e1-af41-4e7a-bb5a-0992300061a2)