Developers
Developer API documentation, headers, and discovery
Published by TubeAnalytics, founded by Mike Holp. Data sources and limitations · Corrections and support.
The external API, API key workflow, MCP transport, and machine-readable discovery files are documented here with the live paths used by the product.
API keys
Create and revoke keys in Dashboard > Settings > API Keys, or use the signed-in management routes.
Professional and Enterprise only.
REST API
Call https://www.tubeanalytics.net/api/external/v1 with Bearer auth.
JSON responses with structured errors.
MCP transport
Connect agents to https://www.tubeanalytics.net/api/mcp or use npm run mcp:stdio.
Streamable HTTP and stdio supported.
Discovery files
Use /openapi.json, /mcp.json, /ai-pricing.json, and /ai.txt as the machine-readable source of truth.
Always current with the live routes.
Quick start
Try a live endpoint. Replace channel_id and YOUR_API_KEY with real values:
curl -X GET "https://www.tubeanalytics.net/api/external/v1/analytics?channel_id=<channel_id>&range=28d" \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Accept: application/json"JavaScript
const res = await fetch("https://www.tubeanalytics.net/api/external/v1/analytics?channel_id=<id>&range=28d", {
headers: { Authorization: "Bearer <api_key>" }
});
const data = await res.json();Python
import httpx
res = httpx.get(
f"{apiBase}/analytics",
params={"channel_id": "<id>", "range": "28d"},
headers={"Authorization": "Bearer <api_key>"}
)
data = res.json()channel_id accepts either the TubeAnalytics channel ID or the YouTube channel ID. The same Bearer key works for every external endpoint below. API access requires a Professional or Enterprise plan.How to connect
Connect a YouTube channel in the dashboard
External API data comes from connected channels. Sign in, connect a channel, and wait for the initial sync to complete before making server-to-server calls.
Create an API key
Open Dashboard > Settings > API Keys on a Professional or Enterprise account, or call POST /api/v1/keys from an authenticated session.
Send Bearer-authenticated requests
Use Authorization: Bearer <api_key> on every external request. Keep keys server-side and do not embed them in client code.
Use discovery files for tools and agents
Pull the OpenAPI spec, MCP manifest, ai-pricing manifest, and ai.txt file when generating clients, connecting agents, or validating integrations.
Reference endpoints
Query parameters
Most external API endpoints accept common query parameters for filtering, pagination, and sorting. The full schema per endpoint is in the OpenAPI spec.
channel_idrangelimitoffsetsortAuthentication and headers
External requests use the Bearer API key scheme in the Authorization header. Keep the key server-side. Create and rotate keys from Dashboard > Settings > API Keys or the signed-in management routes.
- Authorization
- Bearer <api_key>
- Accept
- application/json
- Content-Type
- application/json
- Rate-limit headers
- X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
- Retry header
- Retry-After on 429 responses
Signed-in management routes
These routes are for authenticated dashboard sessions, not server-to-server API clients:
GET /api/v1/keyslist API keysPOST /api/v1/keyscreate a new API keyDELETE /api/v1/keys/:keyIdrevoke a keyGET /api/v1/users/profile and related dashboard session routesremain separate
Access and limits
The pricing surface advertises monthly API call allowances by plan, while the live external API enforces a sliding-window request limit and returns rate-limit headers on every response. Keep both in mind when building client retries and quota dashboards.
In the current implementation, the external API returns X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset on successful responses, plus Retry-After when a request is limited.
Error format
External API routes return structured JSON errors with error.code and error.message. Use the code to branch on error handling and the message for human-readable logs.
{
"error": {
"code": "BAD_REQUEST",
"message": "channel_id query parameter is required"
}
}Common statuses
- 400 Missing or invalid request parameters
- 401 Missing or invalid API key
- 403 API key valid but the plan is not eligible
- 404 Connected channel or resource not found
- 429 Rate limit exceeded
- 500 Unexpected server error
Ready to build?
Sign up for a Professional or Enterprise plan to get API access. Already have an account? Jump to the dashboard to create API keys.