Skip to content
moxon home

Placeholder

The /placeholder endpoint generates SVG placeholders: simple images or animated skeleton loaders.

gethttps://api.moxon.dev/v6/placeholder
Try itget/v6/placeholder

Parameters

  • type"image" | "skeleton"required

    image or skeleton

    —
  • widthnumberoptional

    Width in pixels (1–4000)

    Default: 800.

  • heightnumberoptional

    Height in pixels (1–4000)

    Default: 600.

  • bgstringoptional

    Background color (hex)

    Default: #cccccc / #e5e5e5.

  • colorstringoptional

    Text / highlight color (hex)

    Default: #333333 / #f5f5f5.

  • textstringoptional

    Displayed text (image only)

    Default: 800×600.

  • rowsnumberoptional

    Number of lines (skeleton only, 0–20)

    Default: 3.

  • avatarstringoptional

    Avatar shape: circle, rounded, square or true

    —
    • true
    • circle
    • rounded
    • square
  • linesnumberoptional

    Text lines next to avatar (skeleton only)

    Default: 2.

  • animate"shimmer" | "pulse" | "none"optional

    Animation: shimmer, pulse, none

    Default: shimmer.

  • speednumberoptional

    Animation speed (0.1–10)

    Default: 1.5.

  • radiusnumberoptional

    Border radius of blocks (0–50)

    Default: 4.

Good to know

The bg and color defaults differ between types: image uses #cccccc/#333333, skeleton uses #e5e5e5/#f5f5f5.

Response

The response is an image/svg+xml file for both types.

Code Examples

Error Handling

If parameters are missing or invalid, the API will return an error:

  • 400Type must be one of: image, skeletonThe type parameter is invalid
  • 400width must be a numberWidth is not a valid number
  • 400width must be between 1 and 4000Width is out of range
  • 400Invalid color (use hex like #ff6600)A color parameter is malformed
  • 400avatar must be one of: circle, rounded, squareInvalid avatar shape
  • 400animate must be one of: shimmer, pulse, noneInvalid animation mode
  • 400speed must be between 0.1 and 10Speed is out of range
  • 400radius must be between 0 and 50Radius is out of range