Transform
Beta — This endpoint returns a transformed URL but does not yet perform server-side pixel manipulation. The transform parameters are appended to the CDN URL for future processing. Full Sharp-based transforms are coming in a future release.
GET /api/v1/transform
Returns a URL for a resized, reformatted, or filtered version of an image file.
Query parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Required. File ID (must be an image) |
w | integer | Target width in pixels |
h | integer | Target height in pixels |
q | integer | Quality 1–100 (default: 80) |
f | string | Output format: jpeg, png, webp, avif |
crop | string | Crop mode: cover, contain, fill |
rotate | integer | Rotation in degrees |
blur | float | Blur radius |
brightness | integer | Brightness adjustment |
contrast | integer | Contrast adjustment |
saturation | integer | Saturation adjustment |
grayscale | flag | Convert to grayscale (no value needed) |
sepia | flag | Apply sepia filter (no value needed) |
Example
curl "https://medianest.app/api/v1/transform?id=clx1abc123&w=800&h=600&f=webp&q=85" \
-H "X-API-Key: mn_your_key"
Response
{
"success": true,
"data": {
"url": "https://...",
"cached": false,
"transforms": { "width": 800, "height": 600, "quality": 85, "format": "webp" }
}
}