Browse API Reference

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.

GET /v1/{publishableKey}/body/{figure}/{side}.{webp|png}
HTML
<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"
/>
Response · image/webp 200
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-clamped

Path parameters

ParameterValuesRequired
publishableKeyA live pk_… keyYes
figuremale, femaleYes
sidefront, backYes
extensionwebp, pngYes

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

ParameterDefaultBehavior
primaryEmptyComma-separated muscle ids rendered with the primary highlight
secondaryEmptyComma-separated muscle ids rendered with the secondary highlight
themeThe theme on the keyA published theme id to paint this request in
w176Output width in pixels, clamped from 16 through 960
cropFull figureSet primary to crop around the primary highlights
fitsquareWith 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:

GET /v1/{publishableKey}/body/male/front.webp?primary=lats&secondary=biceps
cURL
curl -I 'https://cdn.gymassets.dev/v1/{key}/body/male/front.webp?primary=lats&secondary=biceps'
Response · image/webp 200
content-type: image/webp
x-muscles-not-drawn: lats

Unknown ids appear in x-muscles-unknown. Both headers are exposed to browser JavaScript.