Infrastructure & Platform
Visualizations API
Render bar, line, and pie charts to SVG, PNG, or PDF.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Render bar, line, and pie charts to SVG, PNG, or PDF.
https://api.allternit.com/api/v1/viz
http://127.0.0.1:8013/api/v1/viz
| Method | Path | Description |
|---|---|---|
GET | /api/v1/viz | Service status and supported formats. |
POST | /api/v1/viz/render/svg | Render a chart to SVG. |
POST | /api/v1/viz/render/png | Render a chart to base64 PNG. |
POST | /api/v1/viz/render/pdf | Render a chart to base64 PDF. |
| Field | Type | Required | Description |
|---|---|---|---|
chart_type | string | No | bar, line, or pie; defaults to bar. |
title | string | No | Chart title. |
width | integer | No | Width in pixels; defaults to 800. |
height | integer | No | Height in pixels; defaults to 600. |
data | array | Yes | Array of { label, value } data points. |
colors | string[] | No | Color overrides. |
| Field | Type | Description |
|---|---|---|
label | string | Data point label. |
value | number | Data point value. |
POST /api/v1/viz/render/svg
curl -X POST https://api.allternit.com/api/v1/viz/render/svg \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"chart_type": "bar",
"title": "Monthly Active Users",
"width": 800,
"height": 400,
"data": [
{ "label": "Jan", "value": 120 },
{ "label": "Feb", "value": 190 },
{ "label": "Mar", "value": 150 }
],
"colors": ["#3b82f6", "#8b5cf6", "#ec4899"]
}'
{
"svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"800\" height=\"400\">...</svg>"
}
POST /api/v1/viz/render/png
{
"png_base64": "iVBORw0KGgoAAAANSUhEUg..."
}
POST /api/v1/viz/render/pdf
{
"pdf_base64": "JVBERi0xLjQK..."
}
GET /api/v1/viz
{
"status": "ok",
"service": "viz",
"renders": ["svg", "png", "pdf"]
}
| Status | Code | Meaning |
|---|---|---|
200 OK | — | Render succeeded. |
400 Bad Request | SVG_PARSE_ERROR | Could not parse generated SVG. |
401 Unauthorized | — | Missing or invalid bearer token. |
500 Internal Server Error | RENDER_ERROR / PNG_ENCODE_ERROR / PDF_SAVE_ERROR | Rendering or encoding failure. |