SVG Placeholders

Placeholder Image API

Generate SVG placeholder images with custom dimensions, background colors, and text labels — all with a single GET request.

Parameters

ParamRequiredDescription
wOptionalWidth in pixels (default 300)
hOptionalHeight in pixels (default 200)
bgOptionalBackground color hex (default cccccc)
colorOptionalText color hex (default 333333)
textOptionalLabel text (default "WxH")

Code Examples

cURL

curl "https://api-snap.com/api/placeholder?w=600&h=400&bg=4f46e5&color=fff&text=Hero+Image" \
  -H "Authorization: Bearer snp_your_key" -o placeholder.svg

JavaScript

// Use directly in an img tag (server-side rendering)
const url = "https://api-snap.com/api/placeholder?w=300&h=200&text=Loading...";

// Or fetch the SVG content
const res = await fetch(
  "https://api-snap.com/api/placeholder?w=800&h=600&bg=1e293b&color=94a3b8",
  { headers: { Authorization: "Bearer snp_your_key" } }
);
const svg = await res.text();

Python

import requests

r = requests.get(
    "https://api-snap.com/api/placeholder",
    params={"w": 400, "h": 300, "bg": "f59e0b", "text": "Thumbnail"},
    headers={"Authorization": "Bearer snp_your_key"},
)
with open("placeholder.svg", "w") as f:
    f.write(r.text)

Common Use Cases

UI wireframing

Fill image slots in wireframes and mockups with correctly-sized placeholders

Loading states

Show placeholder images while real content is loading

Email templates

Use placeholder images during email template development

Documentation

Illustrate image dimensions and layouts in design documentation

Start Creating Placeholders

Custom size, color, and text. One GET request.

Get Your Free API Key