IMAGE
social-post
1080×1080px
Stat / Metric Card
Single impressive metric or statistic card — ideal for milestones and data highlights.
Use Cases
- Monthly growth milestone posts
- Revenue or user count announcements
- Year-in-review stats
- Fundraising or campaign progress
Tags
metric
milestone
data
social-media
instagram
stats
number
1080x1080
Template Variables
| Variable | Type | Default | Description |
|---|---|---|---|
| number | string | 10,000+ | The headline number or metric |
| label | string | Happy Customers | Label describing the metric |
| sublabel | string | and growing every day | Supporting subtext |
| icon | string | 👥 | Emoji or single character icon |
| bg_color | color | #0ea5e9 | Background colour |
| text_color | color | #ffffff | Text colour |
API Example
POST to
https://image.toolkitapi.io/v1/image/from-template
with your template URL and variable values.
curl -X POST "https://image.toolkitapi.io/v1/image/from-template" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"template_url": "https://toolkitapi.io/static/templates/image/sm-stat.html", "variables": {"number": "10,000+", "label": "Happy Customers", "sublabel": "and growing every day", "icon": "\ud83d\udc65", "bg_color": "#0ea5e9", "text_color": "#ffffff"}, "width": 1080, "height": 1080, "format": "png"}'
import httpx, base64
resp = httpx.post(
"https://image.toolkitapi.io/v1/image/from-template",
headers={"X-API-Key": "YOUR_API_KEY"},
json={
"template_url": "https://toolkitapi.io/static/templates/image/sm-stat.html",
"variables": {
"number": "10,000+",
"label": "Happy Customers",
"sublabel": "and growing every day",
"icon": "\ud83d\udc65",
"bg_color": "#0ea5e9",
"text_color": "#ffffff"
},
"width": 1080,
"height": 1080,
"format": "png"
},
)
image_bytes = base64.b64decode(resp.json()["image"])
with open("result.png", "wb") as f:
f.write(image_bytes)
const response = await fetch("https://image.toolkitapi.io/v1/image/from-template", {
method: "POST",
headers: {
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
"template_url": "https://toolkitapi.io/static/templates/image/sm-stat.html",
"variables": {
"number": "10,000+",
"label": "Happy Customers",
"sublabel": "and growing every day",
"icon": "\ud83d\udc65",
"bg_color": "#0ea5e9",
"text_color": "#ffffff"
},
"width": 1080,
"height": 1080,
"format": "png"
}),
});
const data = await response.json();
// data.image is a base64-encoded PNG
$body = @{
template_url = "https://toolkitapi.io/static/templates/image/sm-stat.html"
variables = {
"number": "10,000+",
"label": "Happy Customers",
"sublabel": "and growing every day",
"icon": "\ud83d\udc65",
"bg_color": "#0ea5e9",
"text_color": "#ffffff"
}
width = 1080
height = 1080
format = "png"
} | ConvertTo-Json -Depth 5
Invoke-RestMethod -Method POST `
-Uri "https://image.toolkitapi.io/v1/image/from-template" `
-Headers @{"X-API-Key" = "YOUR_API_KEY"} `
-ContentType "application/json" `
-Body $body