API reference

SuprAnalytics CLI

Read your account from the terminal with npx @supranalytics/cli: every website's traffic and revenue, health, uptime, site audit findings and peak hours, as tables or JSON.

Your account from the terminal: traffic, revenue, uptime and what to fix on every website, without opening the dashboard. It only reads: it can't change anything in your account. It needs Node 18.3 or later.

npx @supranalytics/cli login
npx @supranalytics/cli overview

To type less, install it with npm i -g @supranalytics/cli, and then run supranalytics overview.

Signing in

login opens your browser, where you sign in and Allow it. Leave Also share visitors' personal data unticked: none of the commands use it. logout signs you out and ends the sign-in on the server too.

For scripts and CI, create an account API key (pa_…) under API / MCP and set it as SUPRANALYTICS_API_KEY, or pass --key. Website keys (pk_…) only send data, so they don't work here.

Commands

CommandWhat it shows
loginSign in through your browser, or with --key.
logoutSign out.
whoamiWho's signed in, with what access.
sitesYour websites, with your role on the ones shared with you.
use <website>Set the default website, so later commands can leave it out.
overviewEvery website in a table: visitors and change, revenue, uptime, who's online, site score, conversion, bounce rate, pageviews and session time. Columns drop out to fit a narrow terminal.
healthOnly what needs attention: websites down, checks that have stopped, low site scores, and SSL certificates or domains about to expire.
report [website]What changed in the period, top channels and pages, goals, and the website's health.
sources [website]Channels and referrers, with gains and drops against the period before.
uptime [website]Status, uptime from 24 hours to a year, response times and latest incidents.
insights [website]The latest site audit's scores and what to fix, worst first. --prompts adds a prompt to paste into an AI coding tool.
peak [website]The busiest hours of the week as a text heatmap. --metric visits, goals, sales or revenue.

Options

OptionWhat it does
--periodDate range: today, 24h, 7d (the default), 30d, 90d, 12m, mtd, lastmonth, ytd or all.
--rangeFor peak: 7d, 30d, 90d or 12m (all time by default). For uptime's response times: 1h, 24h, 7d or 30d.
--filterNarrow report, sources and peak, like country=US or channel!=Direct. Repeat it for more.
--limitHow many rows, for sources and insights.
--jsonThe data as JSON, for scripts.
--keyAn account API key to use instead of your sign-in.
--no-browserFor login: print the address without opening it.

In scripts

SUPRANALYTICS_API_KEY=pa_YOUR_KEY npx @supranalytics/cli health --json

It exits with 0 when it worked, 1 when it didn't and 2 when it was asked wrongly. A report with no data yet says so and counts as worked. health still exits with 0 when something needs attention, so check its JSON.

Your data

  • Your sign-in is kept in your config directory (~/.config/supranalytics on Mac and Linux), readable only by you.
  • The CLI sends no analytics of its own, and it talks only to SuprAnalytics.
  • It has no commands for visitors' personal data, whatever you allow.

Not available yet

It can't start a new site audit, and it doesn't cover visitors, chats, recordings or settings. For more reports, use the read API or MCP.

AI agent or LLM? Read this page as Markdown