Overview
Three ways to reach your analytics outside the dashboard: the statsy command line tool, the MCP server for AI assistants, and the REST API.
Everything the dashboard shows is available outside it. There are three doors, and they all read the same data with the same permissions you have in the workspace.
Three ways in
- Command line.
statsyprints overviews, breakdowns, funnels, visitors and attribution as tables, or as JSON for scripts. Best for a quick look without leaving the terminal, and for cron jobs. See Command line interface. - MCP server. Connect Claude Code, the Claude app, Cursor or VS Code and ask questions in plain language. The assistant reads real numbers instead of guessing. See MCP server for AI assistants.
- REST API. JSON over HTTPS at
https://statsy.co/api/v1, for dashboards, warehouses and anything else you build. Start at REST API overview.
You need a token first
All three authenticate with an API token you create in Site settings › API tokens. There are two kinds. An account token (sta_) acts for the whole workspace with owner permissions; a site token (st_) is limited to one site and behaves like an editor. The CLI and the MCP server need an account token; the REST API takes either.
A token is shown once, at creation. Only a SHA-256 hash is stored, so a lost token cannot be recovered, only revoked and replaced. Tokens never expire on their own. Read API tokens and roles before you create one.
Watch out. An account token carries owner power over the workspace. Keep it in a secret manager or an environment variable, never in a repository or a browser bundle.
Which one to pick
| You want to | Use |
|---|---|
| Check yesterday’s numbers without opening a browser | The CLI: statsy stats --period 24h |
| Ask why revenue moved, in a conversation | The MCP server |
| Pipe a breakdown into a spreadsheet or warehouse | The CLI’s statsy export, or GET /export |
| Send payments from a system we do not integrate with | The Payment API |
| Build an internal dashboard | The REST API |
Rate limits apply to all of them. Token-authenticated API requests get 60 per minute; the MCP server allows 120 per minute. Details are on the REST API overview.
Last updated · Markdown version