How it works
Every chart is described entirely by its URL. Send a GET request to https://www.createpiechart.com/api/pie with your labels and values, and you get back an SVG image. The same URL always returns the same image, so it’s cached worldwide and loads fast.
https://www.createpiechart.com/api/pie?labels=Yes,No,Maybe&values=62,30,8&title=Survey
Parameters
| Parameter | What it does | Example |
|---|---|---|
labels | Slice names, separated by commas (or | if a name contains a comma). | labels=Rent,Food,Fun |
values | Slice values in the same order. Plain numbers; $ and % are ignored. | values=1200,400,150 |
data | Labels and values together, instead of labels + values. | data=Rent:1200,Food:400 |
title | Title shown above the chart. | title=Monthly%20Budget |
type | pie (default) or donut. | type=donut |
show | What the slice labels show: percent (default), value, label or none. | show=label |
legend | Show the legend: 1 (default) or 0. | legend=0 |
width / height | Image size in pixels, 200 to 2000. Height is chosen automatically if left out. | width=800 |
theme | light (default) or dark. | theme=dark |
palette | classic, vibrant, pastel, corporate, colorblind, ocean, sunset, earth, neon or mono. | palette=pastel |
colors | Your own slice colors as hex codes, without #. | colors=2563eb,f97316 |
bg / text | Background and text colors as hex codes, or bg=transparent. | bg=transparent |
prefix / suffix | Added around values, e.g. currency or units. | prefix=$ |
decimals | Decimal places in percentages, 0 to 2. | decimals=1 |
center | Text in the middle of a donut (defaults to the total). | center=72%25 |
Values can be raw numbers; percentages are worked out for you. Up to 40 slices are allowed, but a pie chart reads best with seven or fewer (see when not to use a pie chart). If something is wrong with the URL, the image shows a short error message instead of a chart.
Where to use it
- GitHub READMEs and docs: show language breakdowns, survey results or budget splits with one line of Markdown.
- Notion, Confluence and wikis: paste the image URL or the Markdown snippet.
- Websites, blogs and dashboards: drop the HTML snippet into any page, CMS or internal tool that accepts images.
- Your own app: generate the URL in code and set it as an
<img>source. No server-side chart library needed.
Need more than a flat pie?
The API covers the most common case. For 3D pie charts, half pies, nested rings, patterns, exploded slices, PNG and PDF downloads or interactive embeds, use the free online editor.
Frequently asked questions
Is the pie chart API free?
Yes. There's no API key, no sign-up and no watermark. Please use it fairly: images are cached, so the same URL is cheap to serve, but don't generate millions of unique charts per day.
What format are the images?
SVG, a vector format that stays sharp at any size and works in browsers, GitHub, Notion and design tools. Some places don't accept SVG, including Gmail and many other email apps; for those, make the chart in the pie chart maker and download a PNG.
Can I use it in a GitHub README?
Yes. Paste the Markdown snippet from the builder above. GitHub loads the image through its own proxy, and the chart updates whenever you change the URL.
Is my data stored?
No. The chart is drawn from the numbers in the URL and nothing is saved. Remember that anyone who sees the URL can read the numbers in it, so don't put private data in public links.
Can I make 3D or nested charts with the API?
The API makes flat pie and donut charts. For 3D, half pie and nested charts, use the online editor, then download an image or copy the embed code.