TubeAnalytics API

Connect with the authenticated external API, or use the MCP transport for agents.

API Keys

Create and revoke API keys from Dashboard β†’ Settings β†’ API Keys, or via the authenticated `GET /api/v1/keys` and `POST /api/v1/keys` routes.

Professional+ plan

REST API

Call the external API at `https://www.tubeanalytics.net/api/external/v1` with a Bearer token in the `Authorization` header.

JSON responses

MCP Transport

Connect agents to `https://www.tubeanalytics.net/api/mcp` or run `npm run mcp:stdio` locally for a stdio transport.

Agent ready

Discovery Files

Use `/openapi.json`, `/mcp.json`, and `/ai.txt` as the machine-readable source of truth for integrations and agents.

Machine-readable

How to connect

1

Connect a YouTube channel first

Sign in, complete the subscription flow, and connect a channel from the dashboard. The authenticated management route is `GET /api/v1/channels/connect` for the current account and `POST /api/v1/channels/connect` to connect or refresh a channel.

2

Create an API key

Go to Dashboard β†’ Settings β†’ API Keys and create a key, or use the authenticated `POST /api/v1/keys` route. API keys are available on the Professional and Enterprise plans.

3

Call the external API

Use the Bearer key against `https://www.tubeanalytics.net/api/external/v1`. Example: `GET /analytics?channel_id=<id>&range=28d` or `GET /videos?channel_id=<id>&limit=20`.

4

Connect an agent

For MCP clients, point to `https://www.tubeanalytics.net/api/mcp` over HTTP, or run `npm run mcp:stdio` for local stdio transport.

Common endpoints

Endpoint
Method
Description
/api/external/v1/channels
GET
List channels connected to the authenticated account
/api/external/v1/channels/:channelId
GET
Fetch one connected channel by internal ID or YouTube channel ID
/api/external/v1/analytics?channel_id=...
GET
Get aggregated analytics for a channel
/api/external/v1/videos?channel_id=...
GET
List channel videos with paging and sorting
/api/external/v1/audience?channel_id=...
GET
Get audience demographics and segments
/api/external/v1/competitors
GET
List tracked competitor channels
/api/v1/keys
GET / POST
Manage API keys from a signed-in dashboard session
/api/mcp
GET / POST / DELETE
Streamable HTTP transport for MCP clients and agents
The full contract is always in /openapi.json and the agent transport contract is in /mcp.json.

Authentication and access

External API requests must include a valid API key in the Authorization header using the Bearer token scheme. Keep the key server-side and never expose it in client-side code or commit it to version control.

To generate or rotate an API key, go to Dashboard β†’ Settings β†’ API Keys. You can also manage keys from an authenticated session with GET /api/v1/keys, POST /api/v1/keys, and DELETE /api/v1/keys/:keyId.

Starter

1 channel Β· Creators validating one channel before spending more.

Professional

3 channels Β· Creators and small teams growing more than one channel.

Enterprise

5 channels Β· Agencies and multi-channel teams with reporting overhead.

curl -X GET https://www.tubeanalytics.net/api/external/v1/analytics?channel_id=<channel_id>&range=28d \
Β Β -H "Authorization: Bearer YOUR_API_KEY"

Example external API request. `channel_id` can be the internal DB ID or the YouTube channel ID.

Limits and errors

External API access is available on the Professional and Enterprise plans. Requests are rate-limited by plan tier and return 429 with rate-limit headers when you go over the limit.

Plan
External API
Limit
Starter
No external API access
Upgrade to Professional
Professional
5,000 calls / month
1,000 req / hour
Enterprise
20,000 calls / month
10,000 req / hour

Authenticated external requests use the Bearer API key flow. Session-only management routes such as `/api/v1/keys` and `/api/v1/channels/connect` are for the signed-in dashboard session, not for server-to-server API key calls.

Error Codes

The external API returns structured JSON errors with error.code and error.message. Signed-in dashboard routes may still return a plain error string, so check the route or the OpenAPI spec for the exact shape.

Code
Status
Meaning
400
Bad Request
Invalid or missing request parameters
401
Unauthorized
Missing or invalid API key
403
Forbidden
Endpoint not included in your plan
404
Not Found
Resource does not exist
429
Too Many Requests
Rate limit exceeded β€” check Retry-After header
500
Server Error
Unexpected error β€” retry with exponential backoff

What You Can Build

Custom Analytics Dashboards

Pull channel metrics from https://www.tubeanalytics.net/api/external/v1 into your own tools β€” embed charts in internal portals, client reports, or BI platforms like Metabase or Grafana.

Automated Reporting

Schedule nightly syncs into Google Sheets, Notion, or your warehouse by calling the external API from your backend or automation worker.

Agent Workflows

Use https://www.tubeanalytics.net/api/mcp or local stdio transport to give agents access to the same product contract, analytics, and account data.

Internal Operations

Combine API data with ads, CRM, or finance systems to keep channel performance aligned with the rest of your stack.

Related Developer Paths

Use these pages to move from endpoint discovery to production integration and workflow deployment.

Get API Access

API access is available on the Professional and Enterprise plans. Sign up, connect a channel, then create an API key and start calling the external API or MCP transport.