# Chart Generator API

> Chart Generator is a chart API that turns your data into chart and graph images. Supports bar, line, pie, doughnut, radar, polar area, scatter and bubble charts with customizable styling.

**Endpoint:** `POST https://api.apiverve.com/v1/chartgenerator`  
**Category:** Data Generation  
**Cost:** 10 credits per call  
**Canonical page:** https://apiverve.com/marketplace/chartgenerator

## Overview

For advanced users, Chart Generator supports all Chart.js dataset properties as passthrough options, giving you full control over fills, gradients, point styles, and more.

## Authentication

Every call carries your key in an `x-api-key` header. The same key works across the whole
APIVerve catalog — there are no per-API subscriptions. Responses always use the same three
top-level keys: `status`, `error`, and `data`.

## Example request

```bash
curl -X POST "https://api.apiverve.com/v1/chartgenerator" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"datasets":[{"name":"Sales","values":[50,60,70,180]},{"name":"Revenue","values":[100,200,300,400]}],"type":"bar","labels":["Q1","Q2","Q3","Q4"],"title":"Quarterly Report","width":1,"height":1,"format":"value","backgroundColor":"value"}'
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `type` | string | No | Chart type. default bar. One of: bar, line, pie, doughnut, radar, polarArea, scatter, bubble |
| `labels` | array | No | Array of labels for the x-axis or chart segments. Required except for scatter and bubble charts, whose points carry their own x values |
| `datasets` | array | Yes | Array of datasets with 'name' and 'values' |
| `title` | string | No | Optional title displayed on the chart |
| `width` | integer | No | Image width in pixels. default 500. range 100-1024. Premium field |
| `height` | integer | No | Image height in pixels. default 300. range 100-1024. Premium field |
| `format` | string | No | Output format. default png. One of: png, jpeg, svg. Premium field |
| `backgroundColor` | string | No | Canvas background: a colour name, #hex, rgb()/rgba(), or transparent (PNG and SVG only; JPEG falls back to white). Defaults to white. default white. Premium field |

## Response fields

- `id` — string · Unique identifier for the generated chart
- `format` — string · File format of the generated chart image
- `expires` — number · Unix timestamp when the chart URL expires
- `type` — string · Type of chart that was generated
- `downloadURL` — string · Temporary URL to download the generated chart

## Sample response

```json
{
  "status": "ok",
  "error": null,
  "data": {
    "id": "6a783c9c-f959-4a88-80cb-84580b8c788d",
    "format": ".png",
    "expires": 1766010059346,
    "type": "bar",
    "downloadURL": "https://storage.googleapis.com/apiverve/APIData/chartgenerator/6a783c9c-f959-4a88-80cb-84580b8c788d.png?GoogleAccessId=635500398038-compute%40developer.gserviceaccount.com&Expires=1766010059&Signature=Iud%2B7hoPRtPbWoJXQAAnhN9nqUHObHQ7PaiJCtkWQzEzpMexPMRR3BIPKkwOUMAwT6YcNbvywgnLvU2SV7498rbp%2FZbktuAR3Ok1E3O6p4ZJJ4s%2FpW8HAZgIBJpDlPUQt%2FjulQLtwP2I2GUPVmgWheXitnWsWq1S3E2k4viysXwS8H2%2B8BBdxjS%2Bv1ruGXbqd4RpdzdLst4e9YtHGWNZuiaL8zX8%2FHA1zreyrewY2fpB4g0pHnh%2B3IDE48eIohb4HQoDc9vXy4s8sIoqLScmTLyxyq1pPYlak1n1PWdbLcz4TBr41JnLELzF%2BBwCkyrLts9dhisSseaIB7d4g4JQnw%3D%3D"
  }
}
```

## Use cases

- **Automated Email Digests** — SaaS products embed rendered line or bar chart image URLs directly into weekly performance emails sent to active workspace members.
- **Monthly PDF Reports** — When compiling monthly investor reports, fintech backend services render polar area or doughnut chart images to insert directly into downloadable document pages.
- **Support Dashboard Metrics** — Internal admin consoles fetch generated radar chart images to show support agents an account's recent activity breakdown across multiple service tiers.
- **Chat Alert Previews** — Send budget summary doughnut chart images directly to users inside chat applications when monthly spending thresholds trigger an alert.

## SDKs

- **npm** — `npm install @apiverve/chartgenerator` (https://www.npmjs.com/package/@apiverve/chartgenerator)
- **PyPI** — `pip install apiverve-chartgenerator` (https://pypi.org/project/apiverve-chartgenerator/)
- **NuGet** — `dotnet add package APIVerve.API.ChartGenerator` (https://www.nuget.org/packages/APIVerve.API.ChartGenerator)
- **Source** — https://github.com/apiverve/chartgenerator-api

## More

- Full reference: https://docs.apiverve.com/ref/chartgenerator
- Get an API key: https://dashboard.apiverve.com
- Full catalog: https://apiverve.com/marketplace
