Find the people in a photo

post/v2/agent/pose

The people in a photo, with MediaPipe's 33 body points for each (at most two people). It is the server fallback of the shopper widget's "See it on you" photo check, which normally runs the same models in the browser: the widget calls it only in a browser with neither WebGL nor WebAssembly. Deciding what the points mean (one person, face in view, head to shin) is the caller's.

The photo is the request body itself: the raw bytes, with Content-Type: image/jpeg, image/png or image/webp, at most 2 MB. It is read in memory and dropped, never stored or logged. The photo is turned upright and read at up to 1280px on its long edge; width and height are the size it was read at.

bash
curl https://stylor.ai/api/v2/agent/pose \
  -H "Authorization: Bearer $STYLOR_API_KEY" \
  -H "Content-Type: image/jpeg" \
  --data-binary @photo.jpg

It is metered on api.v2.agent.pose, which is unlimited on every plan.

Public keyapi.v2.agent.poseDemo key OK

Request body

image/jpegrequired
string (binary)

The photo's bytes. image/png and image/webp are accepted the same way.

maxLength: 2097152

Response

200The people found.

Response headers

X-RateLimit-Resource

The quota resource this endpoint is metered against: api.v2.agent.chat for the chat endpoint, api.v2.agent.looks.render for the looks endpoint (api.v2.agent.looks on a plan not yet moved to it), api.v2.agent.match for shop the look, api.v2.agent.looks.complete for complete the look and api.v2.agent.pose for the pose endpoint. These are separate from the v1 resources, so Agent API usage never draws down a v1 allowance.

X-RateLimit-Quota-Limit

Requests allowed in the current billing period, or unlimited.

X-RateLimit-Quota-Remaining

Requests left in the current billing period, or unlimited.

X-RateLimit-Quota-Reset

Unix epoch seconds at which the billing period resets.

X-RateLimit-RPM-Limit

Requests allowed per minute for this resource.

X-RateLimit-RPM-Remaining

Requests left in the current one-minute window.

X-RateLimit-RPM-Reset

Unix epoch seconds at which the one-minute window resets.

peoplearray<array<array<number>>>required

One entry per person found, each 33 points in MediaPipe Pose's order, each point [x, y, z, visibility, presence]. x and y are fractions of the photo's width and height as read, z is the model's depth estimate, and visibility and presence are 0 to 1. Rounded to five decimals. Empty when nobody is found.

maxItems: 2
widthintegerrequired

The width the photo was read at, upright.

e.g. 960
heightintegerrequired

The height the photo was read at, upright.

e.g. 1280
msintegerrequired

How long finding the people took, in milliseconds.

e.g. 41

Errors

20

Every error is JSON with a single error string unless noted. Match on the status code; the message is for humans.

400
The request body is empty: send the photo as the body.

The body has no bytes.

400
The body could not be read as a JPEG, PNG or WebP photo.

The bytes are not an image in the declared format, or the image is over 40 million pixels.

413
The photo is <size> KB; the most this endpoint reads is 2048 KB. Send it smaller.

The Content-Length header declares more than 2 MB (refused without reading the body), or the body is larger than 2 MB. Checked after the API key and Content-Type.

415
Send the photo as the request body with Content-Type image/jpeg, image/png, image/webp.

Content-Type is not image/jpeg, image/png or image/webp.

curl -X POST "https://stylor.ai/api/v2/agent/pose" \
  -H "Authorization: Bearer $STYLOR_API_KEY"
Response · 200
{
  "people": [
    [
      [
        0.51234,
        0.18321,
        -0.41023,
        0.99871,
        0.99912
      ],
      [
        0.52011,
        0.16544,
        -0.39871,
        0.99702,
        0.99854
      ]
    ]
  ],
  "width": 960,
  "height": 1280,
  "ms": 41
}