ChartKit URL parameters
ChartKit draws a chart image from a single GET request. You add plain query parameters - no JSON body for this URL. Anything that can load a remote image (HTML `<img>`, Markdown, many email clients) can load the same address.
Use the chart URL generator for a live form; this page is the cheat sheet for hand-editing or for ChatGPT and Claude when you want query strings only.
Use cases
- You write a static blog or docs site and want charts without bundling a chart library or running Node at build time for every edit.
- You reuse one URL in a Markdown README, a newsletter’s HTML `<img>`, or a client report - anywhere remote images are allowed. The chart maker is the fastest way to tune the same parameters visually.
- You teach an LLM to output `https://getchartkit.com/api/chart?…` so drafts include a real preview instead of a placeholder figure.
Parameters
| Parameter | Required | Description |
|---|---|---|
type | Yes | bar, line, area, pie, donut, or horizontal-bar. |
labels | Yes | Comma-separated labels (categories or pie slices). Same count as each series after trimming. |
s0, s1, … | Yes | Comma-separated numbers per series. At least s0 is required. Optional s1 adds a second series (bars/lines/area - not a second pie ring). |
s0name, s1name, … | No | Legend label for each series. |
title | No | Chart title. Use + or %20 for spaces in the query string. |
w | No | Width in pixels (default 600). |
h | No | Height in pixels (default 400). |
legend | No | true or false (default true). |
valueFormat | No | number (default), currency, percent, or compact (K/M/B-style ticks). |
currencySymbol | No | Symbol when valueFormat is currency. Default $. Encode non-ASCII symbols (e.g. €) in the URL. |
format | No | svg (default), png, or jpg. |
Add valueFormat=compact when you pass large raw numbers but want short axis labels. Add valueFormat=currency and currencySymbol (URL-encoded if needed) for money. Add format=png or jpg when your channel needs a bitmap instead of SVG.
Examples
1. Basic bar chart
https://getchartkit.com/api/chart?type=bar&labels=Jan,Feb,Mar&s0=100,200,300&s0name=Revenue&title=Monthly+Revenue2. Line chart with two series
https://getchartkit.com/api/chart?type=line&labels=Q1,Q2,Q3,Q4&s0=12,18,22,28&s0name=2024&s1=10,15,19,24&s1name=2025&title=Growth&legend=true&format=svg3. Pie chart
https://getchartkit.com/api/chart?type=pie&labels=North,South,East,West&s0=35,28,22,15&s0name=Share&title=RegionsHow it works
- The server reads
type, splitslabelson commas, and parses eachs0,s1, … into numbers. - Lengths are aligned: if one series is shorter, the chart uses the overlap. Fix counts at the source when you need strict control.
- The response is an image (SVG or raster). Cache behavior follows normal HTTP rules; changing any parameter changes the picture.
Use with ChatGPT or Claude
Paste the parameter table above (or link to this page) and ask for a single line URL starting with `https://getchartkit.com/api/chart`. Tell the model not to return Chart.js JSON or fenced config blocks.
For a ready-made instruction block, open the AI chart generator or ChatGPT chart generator and copy the AI prompt from the tool.
FAQ
- Is this chart API free to call?
You can use the public https://getchartkit.com/api/chart endpoint for normal testing. Automated or high-volume use may hit rate limits; check current terms and branding on output.
- Can I embed the chart in HTML?
Yes. Set an `<img src="…">` to the full chart URL. No script is required on the page that displays it.
- Can I use the chart in Markdown?
Yes. Use `!description` everywhere your Markdown renderer allows remote images.
- Can ChatGPT generate ChartKit URLs?
Yes, if you give it this parameter list and the base URL. The AI chart generator page ships a copy-ready prompt.
- Do I need JavaScript in the reader’s browser?
Not for an image embed: the URL returns SVG or a raster. A separate script embed exists for live DOM charts - see the main documentation.