ChartQuery

Chart AI

Describe a chart in plain English via GET and get a rendered image back. Powered by AI.

Credit cost: 10 credits per call

GET
/v1/chart/ai

Authorization

ApiKeyAuth
x-api-key<token>

Your API key. Include it in the x-api-key header for every request.

In: header

Query Parameters

prompt*string

Describe your chart in plain English (max 1000 chars). Be specific: mention chart type, data topic, colors, style.

raw_data?string

Raw data for the chart — URL-encoded string, CSV, or JSON. AI will parse and structure it.

Examples:

  • String: Jan: 12400, Feb: 18900, Mar: 15200
  • JSON array: [{"month":"Jan","a":120,"b":85},{"month":"Feb","a":145,"b":102}]
  • JSON object: {"Organic":38,"Paid":24,"Direct":18}

Limit: 10 000 characters / 500 items. Need more? Open a support ticket.

title?string

Override the chart title generated by AI.

subtitle?string

Override the chart subtitle.

legend?string

Legend position or visibility. Use "false" to hide.

Default"top"
Value in"top" | "bottom" | "left" | "right" | "chartArea" | "false"
format?string

Output format. Default: "png".

Default"png"
Value in"png" | "svg"
width?number

Image width in pixels (50–4000). Default: 1200.

height?number

Image height in pixels (50–4000). Default: 600.

background?string

Background color as a hex value. Default: #ffffff.

device_pixel_ratio?number

Device pixel ratio for the rendered image. Default: 1.

share?boolean

Set share=true to persist the config and receive JSON instead of an image: { id, render_url, view_url, embed_url, expires_in }. Free plan: 3-day expiry with watermark. Paid plan: 6-month expiry, no branding.

Default"false"
Value in"false" | "true"

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://api.chartquery.com/v1/chart/ai?prompt=string"
Empty
{
  "error": "Bad Request"
}
{
  "error": "Invalid API Key"
}
{
  "error": "Payment required"
}
{
  "error": "Rate limit exceeded for the API key: quota monthly"
}
{
  "error": "Internal Error"
}