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
Authorization
ApiKeyAuth Your API key. Include it in the x-api-key header for every request.
In: header
Query Parameters
Describe your chart in plain English (max 1000 chars). Be specific: mention chart type, data topic, colors, style.
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.
Override the chart title generated by AI.
Override the chart subtitle.
Legend position or visibility. Use "false" to hide.
"top""top" | "bottom" | "left" | "right" | "chartArea" | "false"Output format. Default: "png".
"png""png" | "svg"Image width in pixels (50–4000). Default: 1200.
Image height in pixels (50–4000). Default: 600.
Background color as a hex value. Default: #ffffff.
Device pixel ratio for the rendered image. Default: 1.
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.
"false""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"{
"error": "Bad Request"
}{
"error": "Invalid API Key"
}{
"error": "Payment required"
}{
"error": "Rate limit exceeded for the API key: quota monthly"
}{
"error": "Internal Error"
}