Skip to content

Chart image API

Send chart data as JSON in a URL or a POST body to https://render.cuelark.com/v1/chart and get a PNG or SVG image back, cached at the edge.

Simplest call: a URL

text
https://render.cuelark.com/v1/chart?type=bar&title=Signups&labels=Mon,Tue,Wed,Thu,Fri&data=12,19,8,15,22

Full JSON in the URL

text
https://render.cuelark.com/v1/chart?c={"type":"line","labels":["Q1","Q2","Q3"],"datasets":[{"label":"MRR","data":[4.1,5.3,6.8]}],"prefix":"$","suffix":"K"}

POST from code

bash
curl -X POST https://render.cuelark.com/v1/chart \
  -H "content-type: application/json" \
  -d '{"chart":{"type":"pie","labels":["Yes","No"],"datasets":[{"data":[61,39]}]},"format":"png","scale":2}' \
  -o chart.png

Parameters

FieldValuesDefault
typebar, horizontalBar, line, area, pie, doughnutbar
labels / datasetsarrays (or Chart.js data, or shorthand data)-
title, subtitle, xLabel, yLabeltext-
stacked, showValues, legendtrue / falsefalse, false, true
prefix, suffixe.g. $ and %-
themelight, darklight
width, height200-2000, 150-1500 px800 × 450
format, scalepng or svg; 1-3png, 1

Speed and caching

Charts are drawn in the Cloudflare Worker that answers the request, as SVG rasterized with resvg. There's no headless browser, so a fresh chart usually renders in tens of milliseconds and repeat GET URLs come from Cloudflare's cache.

Call it from an AI assistant

AI assistants call the same endpoint through the MCP server. See the Render API reference and the MCP setup guide.

MCP tool call: render_chart

json
{
  "method": "tools/call",
  "params": {
    "name": "render_chart",
    "arguments": {
      "type": "bar",
      "title": "Signups",
      "labels": [
        "Mon",
        "Tue",
        "Wed"
      ],
      "datasets": [
        {
          "data": [
            12,
            19,
            8
          ]
        }
      ]
    }
  }
}

Frequently asked questions

Is the chart API free?

Yes. Chart and social card images are free within a rate limit of 120 requests per minute per IP. Cached image URLs don't count against it.

Do I need an API key?

No. Chart and card URLs work without one. A free API key from your Cuelark account (auth.cuelark.com) raises the PDF and screenshot allowance to 50 a day and gives your scripts their own per-minute limit.

Can I embed the chart in an email?

Yes. Use the GET URL as an <img src>. Email clients fetch it like any other image.

Is it a QuickChart alternative?

For static bar, line, pie and doughnut charts, yes. It reads Chart.js-style JSON. It doesn't run Chart.js plugins or JavaScript callbacks.

Updated November 10, 2026 by the Cuelark Team.