# Pull analytics across all accounts

Source: https://developers.tokportal.com/agents/for/analytics-multi-account/
Markdown: https://developers.tokportal.com/agents/for/analytics-multi-account.md

From any MCP-capable agent, one call summarizes every managed account: `get_analytics_dashboard` (filters `platform`, `country`, `account`, `from`/`to`), `get_analytics_series` for daily or weekly curves of views/likes/comments/shares/followers, `list_account_video_analytics` per account, `get_comment_pulse` for what people say, and `export_analytics_videos` / `create_analytics_report` for the CSV or branded report. TokPortal collects the numbers because it operates the accounts — no per-account OAuth, no Business-account requirement, no scraping on your side.

## Try the workflow without spending

For this trial, use the remote MCP endpoint `https://app.tokportal.com/api/ext/mcp`, local `tokportal-mcp` **1.15.1 or later**, or the REST API. Upgrade and restart an older local server first. Version 1.15.0 does not forward the dry-run header; do not use its write tools for a simulation. If you cannot verify the installed local version, use the remote endpoint or REST.

Use the [sandbox](https://developers.tokportal.com/sandbox) for the first attempt. MCP write tools accept `dry_run: true` as a top-level argument, beside `body`; REST writes accept the `X-TokPortal-Dry-Run: true` header. Keep your usual authentication and scopes. Each simulated write validates the request and returns `credits_would_charge` with `credits_charged: 0`. Nothing is created or published.

Simulated IDs start with `00000000-0000-4000-8000-`. Use them only in later dry-run writes. GET requests read real data, so skip publish-readiness checks and polling for synthetic IDs. Simulations have no cross-call memory and upload URLs are placeholders: do not upload files to them.

To run for real, review the returned price and confirm **before the first live write**. Bundle creation charges credits immediately; publishing hands the order to a manager. Repeat creation without dry-run mode and use the new real IDs for configuration and publishing. A synthetic ID cannot be reused in a live request.

## How it works

Analytics in TokPortal are workspace-wide and account-scoped at once. Start with `get_analytics_contract` once — it tells the agent which metrics, granularities and freshness guarantees apply to your workspace — then `get_analytics_dashboard` for the headline numbers over `from`/`to`, filtered by repeatable `platform`, `country` and `account` params. `get_analytics_series` returns time series with `metric` (`views`, `likes`, `comments`, `shares`, `followers`), `granularity` (`day`, `week`) and `mode` (`cumulative`, `gained`, `snapshot`) — `gained` per day is what most dashboards want.

Per account, `get_analytics_account` (or `get_account_analytics`) gives the profile-level snapshot and `list_account_video_analytics` the per-video table (paginated, `sort_by`/`sort_order`), which the agent can rank to find winning hooks. Comments: `get_comment_pulse` for the aggregate mood and `list_analytics_account_comments` for the text. If a number looks stale, `can_refresh_account_analytics` says whether a refresh is allowed and `refresh_account_analytics` triggers it — refreshes are rate-limited by design.

For deliverables, `export_analytics_videos` returns a CSV filtered by `account`, `platform`, `country`, `q`, `from`, `to`; `create_analytics_report` returns a structured report and `export_analytics_report_html` a branded HTML page. From any MCP-capable agent the useful pattern is a scheduled digest: every morning, dashboard for yesterday, top 5 videos, accounts with zero posts in 7 days (join with `list_accounts`), any new entries in `list_account_bans` — posted to Slack or written to a sheet.

## Tool sequence

1. `tokportal_get_analytics_contract` — Metrics, granularities and freshness rules for your workspace.
2. `tokportal_get_analytics_dashboard` — Totals over `from`/`to` with `platform`/`country`/`account` filters.
3. `tokportal_get_analytics_series` — `metric`, `granularity`, `mode`, optional `account`.
4. `tokportal_list_accounts` — Enumerate accounts (`platform`, `country`, `banned=false`) to iterate.
5. `tokportal_list_account_video_analytics` — Per-video table per account, sortable.
6. `tokportal_get_comment_pulse` — Aggregate comment signal across accounts.
7. `tokportal_refresh_account_analytics` — Force a refresh when `can_refresh_account_analytics` allows.
8. `tokportal_export_analytics_videos` — CSV for spreadsheets.
9. `tokportal_create_analytics_report` — Structured report (or `export_analytics_report_html`).

## Pick your agent

- [Pull analytics across all accounts with Claude](https://developers.tokportal.com/agents/claude/analytics-multi-account) — Anthropic's assistant on claude.ai, the mobile apps and Claude Desktop, with custom MCP connectors.
- [Pull analytics across all accounts with Claude Code](https://developers.tokportal.com/agents/claude-code/analytics-multi-account) — Anthropic's terminal coding agent; MCP servers are added with `claude mcp add` and used in any session.
- [Pull analytics across all accounts with ChatGPT](https://developers.tokportal.com/agents/chatgpt/analytics-multi-account) — OpenAI's assistant; plans with developer mode can add remote MCP servers as custom connectors.
- [Pull analytics across all accounts with OpenAI Codex](https://developers.tokportal.com/agents/codex/analytics-multi-account) — OpenAI's coding agent (Codex CLI and IDE extension); MCP servers live in `~/.codex/config.toml`.
- [Pull analytics across all accounts with Cursor](https://developers.tokportal.com/agents/cursor/analytics-multi-account) — AI code editor with an agent mode; MCP servers are configured in `.cursor/mcp.json` or via a one-click deeplink.
- [Pull analytics across all accounts with Windsurf](https://developers.tokportal.com/agents/windsurf/analytics-multi-account) — Codeium's agentic IDE (Cascade); MCP servers are declared in `~/.codeium/windsurf/mcp_config.json`.
- [Pull analytics across all accounts with Cline](https://developers.tokportal.com/agents/cline/analytics-multi-account) — Open-source autonomous coding agent for VS Code with an MCP marketplace and per-tool approval.
- [Pull analytics across all accounts with OpenClaw](https://developers.tokportal.com/agents/openclaw/analytics-multi-account) — Open-source autonomous agent runtime with a skills registry (ClawHub); TokPortal ships as a first-party skill.
- [Pull analytics across all accounts with Hermes Agent](https://developers.tokportal.com/agents/hermes-agent/analytics-multi-account) — Nous Research's open-source agent runtime; MCP servers are declared under `mcp_servers` in `~/.hermes/config.yaml`.
- [Pull analytics across all accounts with Gemini CLI](https://developers.tokportal.com/agents/gemini-cli/analytics-multi-account) — Google's open-source terminal agent for Gemini; MCP servers via `gemini mcp add` or `~/.gemini/settings.json`, plus extensions.
- [Pull analytics across all accounts with Goose](https://developers.tokportal.com/agents/goose/analytics-multi-account) — Block's open-source local agent; remote MCP servers are added as extensions (Streaming HTTP) or via a `goose://` deeplink.
- [Pull analytics across all accounts with Perplexity](https://developers.tokportal.com/agents/perplexity/analytics-multi-account) — Answer engine with custom MCP connectors on paid plans; good for read-only research over your TokPortal data.
- [Pull analytics across all accounts with Microsoft Copilot Studio](https://developers.tokportal.com/agents/copilot-studio/analytics-multi-account) — Microsoft's low-code agent builder; MCP servers are added as tools through the MCP onboarding wizard (Streamable transport).
- [Pull analytics across all accounts with Factory Droid](https://developers.tokportal.com/agents/factory-droid/analytics-multi-account) — Factory's software-engineering agent (`droid` CLI); HTTP MCP servers are added with `droid mcp add`.
- [Pull analytics across all accounts with n8n](https://developers.tokportal.com/agents/n8n/analytics-multi-account) — Open-source workflow automation; use the built-in MCP Client Tool node with an AI Agent, or the community node `n8n-nodes-tokportal` for deterministic steps.
- [Pull analytics across all accounts with Make](https://developers.tokportal.com/agents/make/analytics-multi-account) — Visual automation platform (ex-Integromat); call TokPortal from HTTP modules with `X-API-Key`, or from Make's MCP Client module where available.
- [Pull analytics across all accounts with Zapier](https://developers.tokportal.com/agents/zapier/analytics-multi-account) — Automation platform; today TokPortal is used via Webhooks by Zapier (REST) — a native TokPortal app is coming.
- [Pull analytics across all accounts with Pipedream](https://developers.tokportal.com/agents/pipedream/analytics-multi-account) — Serverless integration platform for developers; call TokPortal from a Node.js/Python code step or the HTTP action, and receive webhooks on an HTTP trigger.
- [Pull analytics across all accounts with Dify](https://developers.tokportal.com/agents/dify/analytics-multi-account) — Open-source LLM app platform; MCP servers are registered under Tools → MCP and used by Agent nodes and Agent apps.
- [Pull analytics across all accounts with Flowise](https://developers.tokportal.com/agents/flowise/analytics-multi-account) — Open-source visual builder for LLM flows; the Custom MCP node connects any Streamable HTTP server to Agentflow / tool agents.
- [Pull analytics across all accounts with Langflow](https://developers.tokportal.com/agents/langflow/analytics-multi-account) — Open-source visual framework for agents; the MCP Tools component connects to servers registered in Settings → MCP Servers.
- [Pull analytics across all accounts with CrewAI](https://developers.tokportal.com/agents/crewai/analytics-multi-account) — Python multi-agent framework; `MCPServerAdapter` from `crewai-tools` turns any MCP server into agent tools.
- [Pull analytics across all accounts with LangChain](https://developers.tokportal.com/agents/langchain/analytics-multi-account) — LangChain / LangGraph agents load MCP tools with `langchain-mcp-adapters` (`MultiServerMCPClient`).
- [Pull analytics across all accounts with Vercel AI SDK](https://developers.tokportal.com/agents/vercel-ai-sdk/analytics-multi-account) — TypeScript toolkit for AI apps; the MCP client (`@ai-sdk/mcp`, formerly `experimental_createMCPClient` in `ai`) turns TokPortal tools into `generateText`/`streamText` tools.
- [Pull analytics across all accounts with Mastra](https://developers.tokportal.com/agents/mastra/analytics-multi-account) — TypeScript agent framework; `MCPClient` from `@mastra/mcp` connects HTTP or stdio MCP servers and hands their tools to an `Agent`.

## Related

- [Analytics API](https://developers.tokportal.com/analytics)
- [Saved accounts](https://developers.tokportal.com/saved-accounts)
- [Agency multi-client](https://developers.tokportal.com/use-cases/industry/agency-multi-client-management)
- [Webhooks](https://developers.tokportal.com/webhooks)
- [MCP server](https://developers.tokportal.com/mcp)
- [All agents](https://developers.tokportal.com/agents)
