GET /render/fan/{hash}
Renders a set of cards fanned out in a circular arc and returns raw PNG bytes. The {hash} path segment encodes a FanRenderRequestData JSON object.
Path parameter
Base64 standard alphabet, no-padding encoding of a
FanRenderRequestData JSON object. The struct contains an array of cards and an optional top-level save_name. See Hash encoding.Fan layout
Cards are rendered in parallel and then composited into a single image:- Each card is rotated by 5.0° × its position index around a circle whose centre is 3,000 pixels below the bottom edge of the card stack.
- Stacking order: the centre card is drawn on top of all others; outer cards are drawn underneath their inner neighbours. In a 5-card fan, the draw order from bottom to top is: outermost-left, outermost-right, next-left, next-right, centre.
- Output dimensions are calculated dynamically to contain all rotated cards without clipping.
Because the output size depends on the number and rotation of cards, there is no fixed output resolution for the fan endpoint.
Examples
Response
200 OK — Raw PNG bytes.| Header | Value |
|---|---|
Content-Type | image/png |
X-Source | rendered on request or loaded from disk cache |
X-Processing-Time | e.g. 48.210ms |
Errors
| Status | Body | Cause |
|---|---|---|
400 | bad request - provided card hash is invalid | {hash} failed base64 decoding |
400 | bad request - provided card hash is a valid json but does not follow API structure | JSON decoded but does not match FanRenderRequestData |
500 | failed request - invalid frame type provided | A card’s frame_type is not 0, 1, or 2 |
500 | failed request - missing main image asset. | A character image file was not found |
500 | failed request - failed to decode main image asset. | A character image file could not be decoded |
500 | server error - failed to copy character | Error compositing a character layer |
500 | server error - missing required asset: {key} | A frame asset file is missing |
500 | server error - cannot write card image to buffer | PNG encoding failed |
500 | gateway timeout - asset render took more than 5 seconds | Render exceeded the 5-second timeout |
Related
FanRenderRequestData— full field reference for the JSON payloadCardRenderRequestData— field reference for each card in thecardsarray- Hash encoding — how to construct the
{hash}segment