Analytics
Read analytics for the active product from the terminal. Analytics commands are read-only and require a token or API key with theanalytics:read scope.
Run
tpc product switch <product-slug> first — every analytics command is scoped to the active product.Explore: build your own analytics query
tpc analytics explore is the flexible query surface behind the fixed commands above. Pick one metric, group it by at most one value with --by, then scope it with filters and a date window. It calls the POST /api/v1/analytics/explore endpoint, so anything you can do here you can also do from the API or the exploreAnalytics MCP tool.
| Metric | Group by (--by) | Filters |
|---|---|---|
sov | date, prompt, topic, engine, competitor | --view, --prompt, --topic, --engine, --region |
citations | source, category, type, author, model, date | --view, --topic, --region, --category, --content-type, --model, --author, --query, --product-mentioned |
traffic | date, page, model, category | --traffic-type, --provider, --category |
sentiment | prompt | --view, --prompt, --topic |
--last 7d|30d|90d, or --from and --to together for an exact range.
The response is a generic table: the API returns column metadata alongside flat rows, so every metric renders the same way. Add --json to get the machine-readable response for scripting:
tpc analytics explore --help for the full flag reference.