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

ParameterTypeDescription
idstringRequired. File ID (must be an image)
wintegerTarget width in pixels
hintegerTarget height in pixels
qintegerQuality 1–100 (default: 80)
fstringOutput format: jpeg, png, webp, avif
cropstringCrop mode: cover, contain, fill
rotateintegerRotation in degrees
blurfloatBlur radius
brightnessintegerBrightness adjustment
contrastintegerContrast adjustment
saturationintegerSaturation adjustment
grayscaleflagConvert to grayscale (no value needed)
sepiaflagApply 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" }
  }
}