Render a muscle diagram
Return a themed muscle diagram for a chosen figure and side, with primary and secondary highlights, as WebP or PNG.
Use the URL directly in an image element. The path requires both the figure and the side. Neither has a default.
/v1/{publishableKey}/body/{figure}/{side}.{webp|png} <img
src="https://cdn.gymassets.dev/v1/{key}/body/female/back.webp?primary=glutes,hamstrings&secondary=lats&w=480"
alt="Back muscles highlighted on a female figure"
/>content-type: image/webp
cache-control: public, max-age=60
access-control-allow-origin: *
access-control-expose-headers: x-muscles-not-drawn, x-muscles-unknown, x-quota-status, x-width-clampedPath parameters
| Parameter | Values | Required |
|---|---|---|
publishableKey | A live pk_… key | Yes |
figure | male, female | Yes |
side | front, back | Yes |
| extension | webp, png | Yes |
Choose a format
Reach for .webp on a web page: at the same width and quality it is roughly half
the bytes of the PNG. Reach for .png where WebP is awkward — an older embedded
webview, a PDF or print pipeline, a native toolkit, a spreadsheet — and get the same
render losslessly rather than re-encoding ours.
A cache entry belongs to exactly one format, and a proxy cannot serve the other one
in its place. The format is part of the path rather than an Accept header. An
extension that is neither returns 400 unsupported_format.
Query parameters
| Parameter | Default | Behavior |
|---|---|---|
primary | Empty | Comma-separated muscle ids rendered with the primary highlight |
secondary | Empty | Comma-separated muscle ids rendered with the secondary highlight |
theme | The theme on the key | A published theme id to paint this request in |
w | 176 | Output width in pixels, clamped from 16 through 960 |
crop | Full figure | Set primary to crop around the primary highlights |
fit | square | With crop=primary, choose square or bbox |
Partial highlights still return an image
Asking for a muscle the chosen view does not draw is not an error. The figure comes back without it, and the response names what it could not light:
/v1/{publishableKey}/body/male/front.webp?primary=lats&secondary=biceps curl -I 'https://cdn.gymassets.dev/v1/{key}/body/male/front.webp?primary=lats&secondary=biceps'content-type: image/webp
x-muscles-not-drawn: latsUnknown ids appear in x-muscles-unknown. Both headers are exposed to browser
JavaScript.