Skip to content
Last updated

All image URLs returned by the API are served through our CDN with automatic optimization. Images are compressed and converted to modern formats (WebP/AVIF) based on browser support.

Default Behavior

Images are returned at original dimensions (capped at 2048px max) with automatic format conversion. Use presets to request specific sizes.

Presets

Append a preset query parameter to any image URL for consistent sizing:

PresetDimensionsUse Case
thumb150×150Thumbnails, small icons
medium600×600Listings, card images
large1200×1200Detail views, galleries
hero1920×800Hero banners, headers
avatar200×200User avatars, profile pictures
card400×300Product cards, previews

Example

# Original (max 2048px, auto format)
https://cdn.example.com/images/photo.png

# Thumbnail
https://cdn.example.com/images/photo.png?preset=thumb

# Medium for listings
https://cdn.example.com/images/photo.png?preset=medium

# High quality large
https://cdn.example.com/images/photo.png?preset=large&q=95

Query Parameters

ParameterTypeDefaultDescription
presetstring-Resize preset (see table above)
qnumber80Quality (1-100)
fstringautoOutput format
fitstringinsideResize fit mode

Format Options (f)

ValueDescription
autoBest format based on browser support (recommended)
jpegForce JPEG
webpForce WebP
pngForce PNG (preserves transparency)
avifForce AVIF (best compression)

Fit Options (fit)

ValueDescription
insideFit within dimensions, maintain aspect ratio (default)
coverCover dimensions, crop overflow
containFit within dimensions with padding
fillStretch to exact dimensions

Supported Formats

Input: JPEG, PNG, WebP, GIF (animations preserved), AVIF

Output: Auto-selected based on browser support (WebP, AVIF, JPEG, PNG)

Error Codes

HTTP CodeDescription
200Success
404Image not found
5xxProcessing error (falls back to original)

Note: Invalid parameters are clamped to valid ranges automatically.