ChartQuery

CLI

Install the ChartQuery CLI SDK and make your first API call.

The official ChartQuery command-line interface, with one command per endpoint.

Requirements

  • Node.js 20+

Install

npm install --global @chartquery/cli
chartquery --help
npx @chartquery/cli --help

Get your API key

Copy your API key from the ChartQuery dashboard and set it in the CHARTQUERY_API_KEY environment variable, which the SDK reads by default. Keep it out of source control.

export CHARTQUERY_API_KEY="YOUR_API_KEY"
$env:CHARTQUERY_API_KEY = "YOUR_API_KEY"

Usage

chartquery chart-ai --prompt 'Monthly revenue 2026 as a bar chart: Jan 10, Feb 14, Mar 18'
chartquery chart-ai --help     # parameters of one command
chartquery endpoints                # every command and its HTTP path
chartquery endpoints search         # filter the list
chartquery qrcode --data https://chartquery.com --format png -o qrcode.png
echo '{"prompt": "Monthly revenue 2026 as a bar chart: Jan 10, Feb 14, Mar 18"}' | chartquery chart-ai --params -
chartquery chart-ai --params params.json --compact
chartquery request get /v1/usage
chartquery request post /v1/some/new/endpoint --params body.json
chartquery chart-ai --prompt 'Monthly revenue 2026 as a bar chart: Jan 10, Feb 14, Mar 18' | jq .

Exit codes

  • 0: success
  • 1: API or network failure
  • 2: invalid usage, such as an unknown command, a missing API key or a missing parameter

On this page