Documentation
Welcome to the PresetBot docs.
Apply Presets via the API
To apply an XMP preset to an image, you call the https://api.presetbot.com/preset/apply
endpoint with an API key header, files, and optional URL parameters.
API Key Header
You must authenticate using the x-api-key
header. You can retrieve your API key on your account dashboard. Make sure this is kept secure and not embedded into any user clients!
Input Files
We accept the input files using multipart/form-data
, which requires a file identifier and the file itself. Two files are required:
image
- The input image in either JPEG or AVIF file format. Must be less than 60MP.
preset
- The XMP Lightroom preset.
- We only apply color-based settings (contrast, brightness, gamma, etc).
- We do not support dynamic effects such as grain, vignetting, and sharpening.
- We do not support lrtemplate files.
- We do not support XMP files from other image editors.
Optional URL Parameters
output
- type: string
- allowed: jpeg, avif
- default: jpeg
quality
- type: integer
- allowed: 1 to 100, inclusive
- default: 80
If you use cURL, you can use -o output.jpg
write the result to a file called output.jpg
.
Languages
Python
To access PresetBot with Python, you can use the requests
library:
Ensure you have the requests
library installed in your Python environment or install it:
Replace "YOUR_API_KEY" with your actual API key from your dashboard. Also, ensure that the files 'input.jpg' and 'preset.xmp' exist in the same directory as your script, or provide the correct path to them. This script sends a POST request to the API endpoint, attaches the image and preset files, and writes the output to 'output.jpg' if the request is successful.
JavaScript/TypeScript/Node (axios)
To access PresetBot with JavaScript, Typescript, or Node, you can use axios
and the form-data
library:
Ensure you have form-data
and axios
installed in your environment or install them:
Replace "YOUR_API_KEY" with your actual API key from your dashboard. Also, ensure you specify the correct paths to the input files.
This script sends a POST request to the API endpoint, attaches the image and preset files, and writes the output to 'output.jpg' if the request is successful.
Remember to only access PresetBot on your server, so clients cannot access your API key!
JavaScript/TypeScript/Node (fetch)
To access PresetBot with JavaScript, Typescript, or Node, you can use fetch
and the form-data
library:
Ensure you have the form-data
and node-fetch
libraries installed in your environment or install them:
Replace "YOUR_API_KEY" with your actual API key from your dashboard. Also, ensure you specify the correct paths to the input files.
This script sends a POST request to the API endpoint, attaches the image and preset files, and writes the output to 'output.jpg' if the request is successful.
Remember to only access PresetBot on your server, so clients cannot access your API key!
Rate Limits
We currently limit users to a rate of 10 requests / sec. These limits are put into place to prevent abuse and to prevent overloading our systems, but we are happy to bump this for reasonable use cases. If you need higher throughput, please contact us.
Billing
Each of our monthly plans include a number of megapixels processed through our endpoints. We only count requests where our servers successfully process your image.
Latency
Most requests are limited by the upload/download speed of images. Larger images will take a longer time to transfer. Processing times on our servers (excluding file transfers) are generally less than a couple seconds. If you have any questions about latency or want to talk to us about setting up dedicated infrastructure for your use case, please contact us.