POST/v1/charts
A bar, line, area, pie or donut chart from a list of numbers, as SVG or PNG; no template needed
Numbers in, a chart at a hosted URL out. format svg (the default) is drawn in the worker with no browser: a few KB, sharp at any size, ready for a web page, a README or a slide. Use png, jpeg or webp for email and social cards, which do not show SVG. values and labels take an array or a comma-separated string. The same chart fits inside a template as a chart layer with these properties. The record is an image: fetch it again with get_image.
REQUEST BODY · APPLICATION/JSON · REQUIRED
{
"kind": "bar",
"values": [
120,
180,
150,
210,
260,
190,
174
],
"labels": "Mon,Tue,Wed,Thu,Fri,Sat,Sun",
"show_values": true,
"padding": 24
}
REQUEST
curl -X POST "https://api.imageapis.com/v1/charts" \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"kind": "bar",
"values": [
120,
180,
150,
210,
260,
190,
174
],
"labels": "Mon,Tue,Wed,Thu,Fri,Sat,Sun",
"show_values": true,
"padding": 24
}'
import requests
r = requests.post("https://api.imageapis.com/v1/charts", headers={"X-API-Key": "YOUR_KEY"}, json={
"kind": "bar",
"values": [
120,
180,
150,
210,
260,
190,
174
],
"labels": "Mon,Tue,Wed,Thu,Fri,Sat,Sun",
"show_values": True,
"padding": 24
})
print(r.status_code, r.headers.get("X-Gw-Remaining"))
print(r.json())
const r = await fetch("https://api.imageapis.com/v1/charts", {
method: "POST",
headers: { "X-API-Key": "YOUR_KEY", "Content-Type": "application/json" },
body: JSON.stringify({
"kind": "bar",
"values": [
120,
180,
150,
210,
260,
190,
174
],
"labels": "Mon,Tue,Wed,Thu,Fri,Sat,Sun",
"show_values": true,
"padding": 24
})
});
console.log(r.status, r.headers.get("X-Gw-Remaining"));
console.log(await r.json());
RESPONSE
200With response=binary: the file itself, with X-Image-Id and X-Image-Url headers
201Created
{
"id": "img_3vq8kd2mzr7xw4hbnc6t",
"object": "image",
"status": "completed",
"url": "https://img.imageapis.com/i/img_3vq8kd2mzr7xw4hbnc6t.svg",
"format": "svg",
"width": 800,
"height": 400,
"template": "chart",
"bytes": 2259,
"units": 1,
"created": "2026-10-10T18:04:11Z",
"completed": "2026-10-10T18:04:12Z",
"expires": "2026-11-09T18:04:11Z"
}
202Accepted: rendering in the background; the record has status pending and the webhook gets the finished one
{
"id": "img_3vq8kd2mzr7xw4hbnc6t",
"object": "image",
"status": "completed",
"url": "https://img.imageapis.com/i/img_3vq8kd2mzr7xw4hbnc6t.svg",
"format": "svg",
"width": 800,
"height": 400,
"template": "chart",
"bytes": 2259,
"units": 1,
"created": "2026-10-10T18:04:11Z",
"completed": "2026-10-10T18:04:12Z",
"expires": "2026-11-09T18:04:11Z"
}