Generate an opinion placard image. Accepts JSON with required fields and optional styling overrides.
All static UI text can be translated using the lang parameter.
Required Parameters
user_name
string
required
Display name of the user.
question
string
required
The poll question.
topic
string
required
Topic tag (e.g., "WORLD CUP").
votes
string
required
Vote count string (e.g., "50K VOTES").
percentage1
number
required
Percentage for the left bar (0–100).
percentage2
number
required
Percentage for the right bar (0–100).
Optional Content
timestamp
string
default: "just now"
Time since posted.
label1
string
default: "{percentage1}%"
Text label on the left bar.
label2
string
default: "{percentage2}%"
Text label on the right bar.
avatar_url
string (URL)
default: "" (initial)
URL of the user's avatar image. If empty, an initial letter is shown.
logo_url
string (URL)
default: default SCAPU logo
URL of the brand logo (40x40 px recommended).
Visual Overrides (all optional)
width
integer
default: 600
Output image width in pixels (informational).
height
integer
default: 450
Output image height in pixels (informational).
page_bg_color
string (CSS color)
default: "#ffffff"
Background color of the entire page.
card_bg_color
string (CSS color)
default: "#000000"
Background color of the card.
text_color
string (CSS color)
default: "#ffffff"
Main text color.
brand_color
string (CSS color)
default: "#F2F400"
Background color of the OPINION badge.
bar_color1
string (CSS color)
default: "#4ade80"
Color for the left progress bar.
bar_color2
string (CSS color)
default: "#ef4444"
Color for the right progress bar.
font_family
string (CSS font stack)
default: system fonts
CSS font-family value for the card.
Language
lang
string
default: "en"
Language for static UI text (the OPINION badge).
Supported values: en, fr, pt-BR, es-MX, es-ES, zh-CN.
Response
200 PNG image (binary)
400 Missing required fields
500 Rendering error
Example Request
curl -X POST http://localhost:8080/generate-placard \
-H "Content-Type: application/json" \
-d '{
"user_name": "John",
"question": "Best movie?",
"topic": "MOVIES",
"votes": "1K",
"percentage1": 70,
"percentage2": 30,
"lang": "fr",
"page_bg_color": "#ffffff",
"card_bg_color": "#000000",
"brand_color": "#F2F400"
}' --output placard.png