GET
/api/img/i.jpgJPEG Product Share Image
Allowlisted, SSRF-protected JPEG image optimizer. Optional share canvas requires exactly w=1200, h=630 and fit=contain together; other height/fit combinations return 400. Products are centred without enlargement on the design system sand background. Versioned source URLs cache immutably for one year; unversioned sources cache at the edge for seven days. No Accept negotiation.
The same-origin /api/erp relay accepts only storefront allow-listed paths and methods; other routes return 404. Browser-supplied API keys are discarded. Direct public API endpoints remain available at their documented URLs.
seoimagessharing
Use Cases
- Render listing product photos for Open Graph and Twitter large image cards
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
url | string | Required | Absolute public HTTP(S) source image on an allowed host. Preserve its v content version. |
w | number | Optional | Allowed image width; the share canvas requires exactly 1200. |
h | number | Optional | Share canvas height. Only 630 with w=1200 and fit=contain is supported. |
fit | string | Optional | Only contain with w=1200 and h=630; never crops or enlarges the product. |
q | number | Optional | JPEG quality, clamped to 1–100. |
Allowed values for fit:
containRequest Example
cURL
curl "https://autrex.ca/api/img/i.jpg?url=https://assets.autrex.ca/catalog/product.png?v=abc123&w=1200&h=630&fit=contain"JavaScript
fetch("https://autrex.ca/api/img/i.jpg?url=https://assets.autrex.ca/catalog/product.png?v=abc123&w=1200&h=630&fit=contain")Response
200JPEG bytes (1200×630 for the share canvas) (image/jpeg)
400Invalid URL or unsupported share canvas (text/plain)
403Host or resolved address not allowed (text/plain)
422Undecodable source image (text/plain)
503Resize capacity busy (retry after five seconds), or share canvas background temporarily unavailable (text/plain)