IMAGE
open-graph
1200×630px
Product Card
E-commerce product sharing card with product image, name, price, and tagline.
Use Cases
- E-commerce product social sharing
- Product launch announcements
- Sale and discount posts
- Online store og:image tags
Tags
product
ecommerce
shopping
open-graph
price
social-sharing
Template Variables
| Variable | Type | Default | Description |
|---|---|---|---|
| product_name | string | Premium Widget Pro | Product name |
| tagline | string | Designed for professionals | Short product tagline |
| price | string | $49 | Formatted price string |
| badge_text | string | New | Badge label (e.g. New, Sale, Hot) |
| product_image_url | url | https://picsum.photos/seed/product/500/500 | Product photo URL |
| brand_name | string | Acme Co | Brand or company name |
| bg_color | color | #ffffff | Card background colour |
| accent_color | color | #f59e0b | Accent and badge 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/og-product.html", "variables": {"product_name": "Premium Widget Pro", "tagline": "Designed for professionals", "price": "$49", "badge_text": "New", "product_image_url": "https://picsum.photos/seed/product/500/500", "brand_name": "Acme Co", "bg_color": "#ffffff", "accent_color": "#f59e0b"}, "width": 1200, "height": 630, "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/og-product.html",
"variables": {
"product_name": "Premium Widget Pro",
"tagline": "Designed for professionals",
"price": "$49",
"badge_text": "New",
"product_image_url": "https://picsum.photos/seed/product/500/500",
"brand_name": "Acme Co",
"bg_color": "#ffffff",
"accent_color": "#f59e0b"
},
"width": 1200,
"height": 630,
"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/og-product.html",
"variables": {
"product_name": "Premium Widget Pro",
"tagline": "Designed for professionals",
"price": "$49",
"badge_text": "New",
"product_image_url": "https://picsum.photos/seed/product/500/500",
"brand_name": "Acme Co",
"bg_color": "#ffffff",
"accent_color": "#f59e0b"
},
"width": 1200,
"height": 630,
"format": "png"
}),
});
const data = await response.json();
// data.image is a base64-encoded PNG
$body = @{
template_url = "https://toolkitapi.io/static/templates/image/og-product.html"
variables = {
"product_name": "Premium Widget Pro",
"tagline": "Designed for professionals",
"price": "$49",
"badge_text": "New",
"product_image_url": "https://picsum.photos/seed/product/500/500",
"brand_name": "Acme Co",
"bg_color": "#ffffff",
"accent_color": "#f59e0b"
}
width = 1200
height = 630
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