# Quickstart
URL: /api
***
title: Quickstart
description: Unlock powerful YouTube automation workflows with TubeLab's API
icon: intro
-----------
import { Step, Steps } from "fumadocs-ui/components/steps";
import { DynamicCodeBlock } from "fumadocs-ui/components/dynamic-codeblock";
import { Icon } from "@/components/ui/icon";
[TubeLab](https://tubelab.net/)'s API gives you access to the [Niche Finder](https://tubelab.net/youtube-niche-finder) & [Outliers Finder](https://tubelab.net/youtube-outliers-finder) data - including 400K+ channels, 4M+ outliers, and YouTube scans. Updated everyday, in real-time.
This unlocks powerful YouTube automation workflows, such as:
* Automatically finding new niches
* Automatically tracking trends based on a niche
* AI-powered ideation based on outliers
**Why code when AI can do it for you?**
Use our [Agent Skill](/api/agent-skill) to give any AI agent full knowledge of TubeLab's API.
You can also paste [this link](https://tubelab.net/docs/llms-full.txt) in your coding AI.
```
https://tubelab.net/docs/llms-full.txt
```
## Call the API
### Create a TubeLab Account
Sign-up to [TubeLab](https://tubelab.net/login) if you don't have an account yet.
### Create an API Key
You must have an [active subscription with available credits](https://tubelab.net/settings).
Create an API key [here](https://tubelab.net/developers) and copy it.
**Beaware, this key won't be shown again.**
### Make your first request
Authenticate by using the `Authorization` header and value as `Api-Key your-api-key`:
response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));`}
/>
## Next steps
Now that you have made your first TubeLab API request, it's time to explore what else is possible:
}>
Use our powerful n8n templates to automate niche finding, competition
tracking, trends, ideation and much more.
}>
Understand what YouTube data is available, and how to use it.
# Introduction
URL: /api/introduction
***
title: Introduction
description: Find new niches automatically, track your competition, new trends and more.
----------------------------------------------------------------------------------------
The [TubeLab](https://tubelab.net/) API is organized around [REST](https://en.wikipedia.org/wiki/REST). The API returns [JSON-encoded](https://www.json.org/json-en.html) responses, and uses standard HTTP response codes, authentication, and verbs.
To use TubeLab's API you must have an [API Key](https://tubelab.net/developers) and an [active subscription](https://tubelab.net/pricing) with [available credits](https://tubelab.net/credits).
`https://public-api.tubelab.net/v1`
## Authentication
[Create an API key here](https://tubelab.net/developers).
All requests to the TubeLab API must include an `Authorization` header with your API key. You'll need to send this header yourself as `Authorization: Api-Key `.
Here's an example with `curl`:
```bash
curl --location 'https://public-api.tubelab.net/v1/search/outliers?query=minecraft' \
-H 'Authorization: Api-Key '
```
## Rate limits
To mitigate misuse and manage capacity on our API, we have implemented limits per api key.
**You're limited to `10` requests every minute per api-key within your available credits.**
Limits are designed to prevent API abuse, while minimizing impact on common customer usage patterns.
## Content types
TubeLab's API accepts JSON in request bodies and returns JSON in response bodies. You will need to send the content-type: `application/json` header in requests.
## Request size limits
The API has a maximum request body size of `100kb` per request.
## Status page
Check the availability of TubeLab's APIs at our [status page](https://status.tubelab.net/).
# Pricing
URL: /api/pricing
***
title: Pricing
description: Learn about TubeLab's API pricing structure
--------------------------------------------------------
For the latest pricing updates, check out [tubelab.net/pricing](https://tubelab.net/pricing).
## Credits System
Search and scan endpoints use credits from your account. Your [credit balance](https://tubelab.net/credits) determines how many requests you can make.
YouTube data endpoints (channel videos, shorts, video details, transcripts, and comments) are free with an active subscription.
Different search and scan endpoints require different credit amounts per request.
### How does the credits system work?
Some **subscriptions comes with credits that refresh each billing cycle** and don't expire right away. Monthly subscribers can use their credits for up to two months - so January credits work through February.
**Annual subscribers get all their credits upfront** and can use them flexibly throughout their subscription, with credits staying active for over a month into the following year.
**Purchased credits** never expire but you must have an active subscription to use them.
## Pricing Table
| Endpoint | Cost per request |
| ------------------------------ | ------------------- |
| `GET /search/outliers` | `2 credits` |
| `GET /search/outliers/related` | `2 credits` |
| `GET /search/channels` | `5 credits` |
| `GET /search/channels/related` | `5 credits` |
| `GET /channel/videos/:id` | `free` |
| `GET /channel/shorts/:id` | `free` |
| `GET /video/:id` | `free` |
| `GET /video/transcript/:id` | `free` |
| `GET /video/comments/:id` | `free` |
| `POST /scan` | `50 to 100 credits` |
| `GET /scan/:id` | `free` |
**Note:** The cost of a [scan](/api/scanning) is based on the mode you choose.
| Mode | Cost |
| -------- | --------------- |
| Fast | **50** credits |
| Standard | **100** credits |
**Cached responses do not use credits**. This means that if you make a request to the same endpoint within a short period of time, you will not be charged extra credits.
## How to get credits?
You can get credits by subscribing to a [TubeLab Pro plan](https://tubelab.net/pricing) and by [topping-up your credits](https://tubelab.net/credits/top-up).
## What happens if I run out of credits?
You can purchase more credits at any time.
These extra credits work alongside your regular subscription credits and stay valid while your subscription is active.
## What happens when a request fails?
When a request fails, the credit will be refunded (reverted).
# Scanning
URL: /api/scanning
***
title: Scanning
description: TubeLab's API let's you scan YouTube to find public channels and outliers in any topic.
----------------------------------------------------------------------------------------------------
You can trigger new YouTube scans, for any niche.
**Allowing for tailored competitor research, in real-time.**
## Starting a YouTube Scan
You can trigger a new YouTube scan by calling the [`/scan` endpoint](/api/reference/post-scan).
**To successfully trigger a scan you need to have an [active subscription with available credits](https://tubelab.net/settings).**
## Searching the results
Once a scan is complete, you can search for the results by calling the [`/search/outliers` endpoint](/api/reference/search-outliers) with the `referenceId` property set to the desired scan `id`.
```bash
curl -X GET "https://public-api.tubelab.net/v1/search/outliers?referenceId=8794a2ba-b4ca-40ca-9585-ca3fc501e31d" \
-H "Authorization: Api-Key "
```
## Webhooks
You can get notified when a scan status changes by creating a [webhook](/api/webhooks).
Once you've set your [webhook](/api/webhooks), you will receive a payload when the scan status changes:
[TubeLab n8n Node](https://www.npmjs.com/package/n8n-nodes-tubelab) does this
automatically for you.
```json
// body payload
{
"type": "ProcessStatus",
"time": "2025-09-20T14:36:52.211Z",
"data": {
"id": "8794a2ba-b4ca-40ca-9585-ca3fc501e31d",
"status": "Running",
"endedAt": null,
"updatedAt": "2025-09-20T14:36:52.186Z"
}
}
```
## Scan Modes and Pricing
Scans are **resource intensive** and can **take a while to complete**.
There's two available modes that will stop the scan when one of the thresholds is reached.
| Mode | Outliers Threshold | Channels Threshold | Cost | Estimated Time |
| -------- | ------------------ | ------------------ | --------------- | ------------------ |
| Fast | 1000 | 100 | **50** credits | 30 mins to 2 hours |
| Standard | 2500 | 250 | **100** credits | 2-4 hours |
Scans are queued and processed in order, so the expected time is an estimate and can vary.
# Webhooks
URL: /api/webhooks
***
title: Webhooks
description: Listen for Tubelab events on your webhook endpoint so you can automatically trigger reactions.
-----------------------------------------------------------------------------------------------------------
import { Step, Steps } from "fumadocs-ui/components/steps";
import { Accordion, Accordions } from "fumadocs-ui/components/accordion";
[TubeLab's n8n Node](https://www.npmjs.com/package/n8n-nodes-tubelab) handles
webhooks automatically for you.
## Get started
To start receiving webhook events in your app:
1. Create a webhook endpoint handler to receive event data POST requests.
2. Test your webhook endpoint handler locally with our [mock request example](/api/webhooks#2-test-your-handler).
3. Register an enpoint in the Tubelab's [Developers dashboard](https://tubelab.net/developers).
4. Secure your webhook (optional)
**n8n Integration**:
If you're using n8n this is done automatically for you.
### 1. Create a handler
Set up your endpoint function so that it:
* Handles POST requests with JSON payloads
* Quickly returns a successfull status code `2xx` prior to any complex operations
that might cause a timeout
### 2. Test your handler
Before you go-live with your webhook endpoint function, we recommend that you test your application integration.
You can simply POST to your webhook endpoint with the following payload for a completed scan:
```json
{
"type": "ProcessStatus",
"time": "2025-09-20T14:36:52.211Z",
"data": {
"id": "8794a2ba-b4ca-40ca-9585-ca3fc501e31d",
"status": "Completed",
"endedAt": "2025-09-20T14:36:52.186Z",
"updatedAt": "2025-09-20T14:36:52.186Z"
}
}
```
* `type`: always `"ProcessStatus"`
* `status`: one of `"Running" | "Completed" | "ContinuedAsNew" | "Failed" | "Terminated" | "Suspended"`
* `endedAt` present when `status` is `"Completed" | "Failed" | "Terminated" `
### 3. Register your webhook
Create your webhook in [TubeLab's Developer Dashboard](https://tubelab.net/developers).
Scroll down to the "Webhooks" section and click "Create Webhook" then fill in the following:
* `Payload URL`: the URL of your webhook endpoint
* `Secret`: define a secret key to secure your webhook (optional)
Payload URLs must be **Secure HTTPS URLs** and be in the following format:
```bash
https:///
```
### 4. Secure your webhook (optional)
You can set a secret to verify that a webhook delivery is from TubeLab.
**To do this, you need to:**
1. Create a secret token for your webhook
2. Store the secret on your server
3. Validate incoming requests using the payload & secret
Start by going to [TubeLab's Developer Dashboard](https://tubelab.net/developers). On the webhook row, click on the actions and "Edit". **Here you can set the secret token or change an existing one.**
When a secret is set, all requests will include a `X-TubeLab-Signature-256` header with a HMAC-SHA256 signature of the request body.
Headers example:
```json
// headers
"x-tubelab-signature-256": "sha256=9db81febbc4334e338ce23e783e9114a012d68aae59e51eba375ed9493d67f80",
"x-tubelab-delivery": "6f8a7b0b-5602-49b8-9dbf-a1c7bc02bb5f",
"x-tubelab-event": "ProcessStatus",
"x-tubelab-hook-id": "d0b88613-9ca6-4de2-b692-31b869173e76",
```
```ts
import * as crypto from "crypto";
// signature is the value of the x-tubelab-signature-256 header
function verifySignature(payload: string, signature: string) {
if (!signature) return false;
const secret = "your-webhook-secret";
const expectedSignature =
"sha256=" +
crypto
.createHmac("sha256", secret)
.update(payload, "utf8") // Use payload directly, don't JSON.stringify again
.digest("hex");
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(expectedSignature),
);
}
```
This webhook implementation follows Github's [Webhook Signature Verification](https://docs.github.com/en/webhooks/using-webhooks/validating-webhook-deliveries#validating-webhook-deliveries) practises. Please refer to it for further details.
# Quickstart
URL: /api/automation/quickstart
***
title: Quickstart
description: Learn how to setup TubeLab with n8n and create your first workflow.
--------------------------------------------------------------------------------
import { Step, Steps } from "fumadocs-ui/components/steps";
You can easily integrate [TubeLab](https://tubelab.net/) with [n8n](https://n8n.io/) to create powerful YouTube automation workflows.
This is a practical guide, and we'll create a competetition tracker workflow for your YouTube channel.
* [**YouTube Trends Tracker**](/api/automation/trends-tracker): leverages TubeLab and AI to automatically create trends reports, analysis of top competitors and new viral ideas based on your channel.
### Pre-requisites
* An active [TubeLab](https://tubelab.net/) subscription
* A valid [TubeLab API Key](https://tubelab.net/developers)
## Setup n8n with TubeLab
### Install TubeLab's Node
[TubeLab's n8n node](https://www.npmjs.com/package/n8n-nodes-tubelab) is now officially available directly in n8n as a node!
1. Go to any **Workflow** > right click **Add Node**
2. Search for **TubeLab** and select **Install**.

### Setup Credentials
You must first authenticate with TubeLab by setting the `Api Key` in the node.
1. Use **TubeLab's node**
2. Under Credential to connect with, click **Create New Credential**.
3. Paste your **TubeLab API key** and save.

## Next steps
Now that you have setup TubeLab with n8n, it's time to create your [trends tracker workflow](/api/automation/trends-tracker).
# YouTube Trends Tracker
URL: /api/automation/trends-tracker
***
title: YouTube Trends Tracker
description: Learn how to create an n8n workflow to track your YouTube competitors
----------------------------------------------------------------------------------
import { Step, Steps } from "fumadocs-ui/components/steps";
import { DynamicCodeBlock } from "fumadocs-ui/components/dynamic-codeblock";
import { Accordion, Accordions } from "fumadocs-ui/components/accordion";

Instead of manually searching for what's trending on your niche, you can automate the process with [TubeLab](https://tubelab.net/) and [n8n](https://n8n.io/).
Before setting up the workflow, it helps to break down the process in smaller steps:
1. **Research**: we'll start by analysing your channel with Gemini and then using TubeLab to find outliers from your competitors;
2. **Analysis**: we then fetch the transcript of the top-performing videos and prompt Gemini to analyse them;
3. **Report**: finally we prompt Claude to create a report with the findings and generate new ideas for your channel.
## Pre-requisites
1. Refer to the [Quickstart](/api/automation/quickstart) guide to setup n8n with TubeLab and create the workflow.
2. Setup [OpenRouter credentials](https://jannicknijholt.nl/integrate-openrouter-in-n8n/) in n8n with the OpenAI node.
3. Setup a [Discord Webhook](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks) to send the report to.
We've chosen to use OpenRouter because it let's you use multiple AI models without having to setup multiple credentials and different nodes.
Here's the step-by-step guide:
1. Go to [OpenRouter](https://openrouter.ai/settings/credits) and add $5 to your account.
2. Create an API key [here](https://openrouter.ai/settings/keys) and copy it.
3. Go to your n8n credentials and click on **Create Credential**.
4. Select **OpenAI** as the provider.
5. **Paste your OpenRouter API key**.
6. Update the **Base URL** to `https://openrouter.ai/api/v1` and save.
Now you're all set, just add an **OpenAI** node and select the credential your just created.
You can use any OpenRouter model by selecting the **Model** by ID.
To send the report to a Discord channel of your choice you need to get that channel's webhook URL.
Here's the step-by-step guide:
1. Open your Server Settings and head into the Integrations tab:
2. Click the "Create Webhook" button to create a new webhook!
3. Copy the webhook URL.
4. Go to the your n8n credentials and click on **Create Credential**.
5. Select **Discord Webhook**.
6. **Paste** your Discord webhook URL.
7. Save.
Now on the workflow, go to the last node and select the **Discord Webhook** credential you just created.
## Configuring the workflow
Assuming you have the pre-requisites setup, all you need to do is:
1. Copy this link: `http://tubelab.ai/docs/youtube-trends-tracker.json`.
2. Create a new workflow in n8n and click on the top-right corner '...' > **Import from URL**.
3. Paste the link and click on **Import**.

4. Open the `Get Videos` node and set your `Channel ID`.

**How to find channel IDs?** Paste any video in [TubeLab's Video
Extractor](https://tubelab.net/video-extractor) and copy the channel ID.
## Research

We need to collect data first. This is done by:
1. [Analysing your channel](/api/automation/trends-tracker#analysing-your-channel) with Gemini to understand your niche and audience interests;
2. [Searching for outlier videos](/api/automation/trends-tracker#searching-for-outliers-from-your-competitors-and-adjacent-niches) from your competitors and adjacent audience interests.
### Analysing your channel
We'll use TubeLab to fetch your channel's videos and prompt Gemini to analyse your niche & audience.
### Searching for outliers from your competitors and adjacent niches
We'll be using TubeLab's real-time outlier data to search for high-performing videos from your competitors and adjacent niches based on your audience interests.
**This data is fundamental to extract the winning patterns that will get you more views.**
## Analysis

Now that we have the data, let's extract the viral patterns of the data we've collected:
* title formulas
* hook formulas
* trending topics
This is done by using TubeLab to get the transcripts of the top-performing videos and prompting Gemini to extract those patterns.
## Create a Report

Finally we have all the data we need to understand what get's more views.
We'll be using Claude to create a report with the findings and generate new ideas for your channel.
Then we'll send the report to a Discord channel.
## That's it!
Imagine trying to do all of this manually. It would take you hours to search for this outliers and then you would need to manually analyse the videos and write up the report.
With TubeLab and n8n you can automate the process and get the report every week without any effort.
## Next steps
Now that you've setup this workflow, you can extend it and create your own use cases.
Such as:
* Generating new ideas from your channel's comments;
* Generating scripts based on any YouTube video;
Explore TubeLab's API easily directly within n8n.
# ChatGPT
URL: /api/mcp-server/chatgpt
***
title: ChatGPT
description: Connect TubeLab to ChatGPT and turn it into your YouTube research assistant.
-----------------------------------------------------------------------------------------
import { Step, Steps } from "fumadocs-ui/components/steps";
Connect your TubeLab account to [ChatGPT](https://chatgpt.com/) and it becomes your YouTube research assistant — searching channels, finding viral videos, pulling transcripts — all within your chat.
## Setup
### 1. Enable developer mode
In ChatGPT, go to **Settings** → **Apps** → **Advanced** and enable **Developer mode**. This lets you add custom MCP servers.
### 2. Create the TubeLab app
Go back to **Settings** → **Apps** and click **Create app**. Fill in:
1. Name: **TubeLab**
2. MCP server URL:
```
https://public-api.tubelab.net/mcp
```
### 3. Connect to TubeLab
1. Click **Connect** > **Connect to TubeLab**
2. You'll be redirected to TubeLab's login page
3. Log in with your TubeLab account (Google or Magic Link)
4. A consent screen appears — click **Approve** to grant ChatGPT access
5. You're redirected back to ChatGPT with TubeLab connected
### 4. Add TubeLab to Chat
1. Click on the **+** "plus" button.
2. Then on **More** > Select **TubeLab**
Done. TubeLab is now available in ChatGPT.
## Example prompts
Ask ChatGPT anything about YouTube and it will call TubeLab's tools behind the scenes:
* *"Search for cooking channels with over 100K subscribers"*
* *"Get me the transcript of this video: dQw4w9WgXcQ"*
* *"What are the top comments on this video?"*
* *"Find channels similar to @mkbhd"*
* *"What viral videos are there about home automation this month?"*
* *"How many credits do I have left?"*
## Tools
Once connected, ChatGPT has access to 11 TubeLab tools:
| Tool | What it does | Cost |
| ------------------------- | -------------------------------------------------------------------------------------------------- | ----------- |
| `search_channels` | Search YouTube channels by keyword with filters (subscribers, views, language, monetization, etc.) | `5 credits` |
| `search_related_channels` | Find channels similar to a given channel | `5 credits` |
| `search_outliers` | Find viral or underperforming videos across YouTube by keyword | `2 credits` |
| `search_related_outliers` | Find outlier videos from channels similar to a given channel | `2 credits` |
| `get_channel` | Get info about a YouTube channel (accepts ID, URL, or @handle) | `free` |
| `get_channel_videos` | Get recent videos from a channel | `free` |
| `get_channel_shorts` | Get recent Shorts from a channel | `free` |
| `get_video` | Get detailed info about a specific video | `free` |
| `get_video_transcript` | Get the transcript/captions of a video | `free` |
| `get_video_comments` | Get top comments from a video | `free` |
| `get_credits_balance` | Check your TubeLab credit balance | `free` |
You don't need to call these by name. Just ask ChatGPT what you need in plain language and it picks the right tools automatically.
## Good to know
* Tools consume your TubeLab [credits](/api/pricing) at the same rate as the TubeLab app or [API](/api/introduction)
* If your session expires, ChatGPT refreshes it automatically — no need to reconnect
* Check your balance anytime: *"What's my TubeLab credit balance?"*
## How it works
TubeLab's ChatGPT integration uses [MCP (Model Context Protocol)](https://modelcontextprotocol.io/docs/getting-started/intro) — an open standard that lets AI assistants use external tools directly inside a conversation. When you add TubeLab as a custom app, ChatGPT can call TubeLab's API on your behalf without you writing any code or leaving the chat.
# Claude
URL: /api/mcp-server/claude-connector
***
title: Claude
description: Connect TubeLab to Claude and turn it into your YouTube research assistant.
----------------------------------------------------------------------------------------
import { Step, Steps } from "fumadocs-ui/components/steps";
Connect your TubeLab account to [Claude](https://claude.ai/) and it becomes your YouTube research assistant — searching channels, finding viral videos, pulling transcripts — all within your chat.
## Setup
### 1. Open connectors in Claude
Go to [claude.ai/settings/connectors](https://claude.ai/settings/connectors) and click **"Add custom connector"**.
### 2. Add TubeLab
1. Set the name to **TubeLab**
2. Set the MCP server URL to:
```
https://public-api.tubelab.net/mcp
```
### 3. Connect to TubeLab
1. Click on **Connect**
2. You'll be redirected to TubeLab's login page
3. Log in with your TubeLab account (Google or Magic Link)
4. A consent screen appears — click **Approve** to grant Claude access
5. You're redirected back to Claude with TubeLab connected
### 4. Enable always allow
Click **Configure** on the TubeLab connector and toggle **"Always allow"**. This lets Claude use TubeLab's tools without asking for permission each time.
Done. TubeLab is now available in every Claude conversation.
## Workflows
TubeLab comes with pre-built research workflows you can launch directly from any chat. Click the **+** icon in the chat input, then **Connectors** → **Add from TubeLab** and pick one:
| Workflow | What it does |
| -------------------- | ---------------------------------------------------------------------------------------- |
| **Niche Research** | Discovers unsaturated, high-demand niches with real monetization potential |
| **Niche Analysis** | Analyses a specific niche: saturation, what's working, content gaps, viability |
| **Channel Analysis** | Builds a tactical playbook for a channel: strengths, weaknesses, competitor intel, ideas |
| **Trend Report** | Finds what's trending in a niche: winning patterns, title formulas, actionable insights |
| **Video Ideation** | Generates concrete video ideas backed by real outlier data, tailored to your channel |
You provide the inputs, Claude handles the rest — orchestrating multiple TubeLab tools behind the scenes to deliver a complete analysis.
You can also skip templates and ask Claude anything directly:
* *"Search for cooking channels with over 100K subscribers"*
* *"Get me the transcript of this video: dQw4w9WgXcQ"*
* *"What are the top comments on this video?"*
* *"Find channels similar to @mkbhd"*
* *"What viral videos are there about home automation this month?"*
* *"How many credits do I have left?"*
## Tools
Once connected, Claude has access to 11 TubeLab tools:
| Tool | What it does | Cost |
| ------------------------- | -------------------------------------------------------------------------------------------------- | ----------- |
| `search_channels` | Search YouTube channels by keyword with filters (subscribers, views, language, monetization, etc.) | `5 credits` |
| `search_related_channels` | Find channels similar to a given channel | `5 credits` |
| `search_outliers` | Find viral or underperforming videos across YouTube by keyword | `2 credits` |
| `search_related_outliers` | Find outlier videos from channels similar to a given channel | `2 credits` |
| `get_channel` | Get info about a YouTube channel (accepts ID, URL, or @handle) | `free` |
| `get_channel_videos` | Get recent videos from a channel | `free` |
| `get_channel_shorts` | Get recent Shorts from a channel | `free` |
| `get_video` | Get detailed info about a specific video | `free` |
| `get_video_transcript` | Get the transcript/captions of a video | `free` |
| `get_video_comments` | Get top comments from a video | `free` |
| `get_credits_balance` | Check your TubeLab credit balance | `free` |
You don't need to call these by name. Just ask Claude what you need in plain language and it picks the right tools automatically.
## Good to know
* Tools consume your TubeLab [credits](/api/pricing) at the same rate as the TubeLab app or [API](/api/introduction)
* Prompt templates are free — credits are only consumed when Claude actually calls a tool
* If your session expires, Claude refreshes it automatically — no need to reconnect
* Check your balance anytime: *"What's my TubeLab credit balance?"*
## How it works
TubeLab's Claude integration uses [MCP (Model Context Protocol)](https://modelcontextprotocol.io/docs/getting-started/intro) — an open standard that lets AI assistants use external tools directly inside a conversation. When you add TubeLab as a connector, Claude can call TubeLab's API on your behalf without you writing any code or leaving the chat.
# Codex
URL: /api/mcp-server/codex
***
title: Codex
description: Connect TubeLab to Codex and turn it into your YouTube research assistant.
---------------------------------------------------------------------------------------
import { Step, Steps } from "fumadocs-ui/components/steps";
Connect your TubeLab account to [Codex](https://chatgpt.com/codex) and it becomes your YouTube research assistant — searching channels, finding viral videos, pulling transcripts — all within your chat.
## Setup
### 1. Create a TubeLab API key
You must have an [active subscription with available
credits](https://tubelab.net/settings).
Create an API key [here](https://tubelab.net/developers) and copy it.
**Be aware, this key won't be shown again.**
### 2. Add the MCP server
In Codex, go to **Settings** → **MCP Servers** and click **Add server**. Fill in:
1. MCP server name: **TubeLab**
2. Select **Streamable HTTP**
3. URL:
```
https://public-api.tubelab.net/mcp
```
4. **Bearer token**: paste the API key from the previous step
### 3. Start using TubeLab
Save the server and TubeLab's tools are now available to Codex in every chat.
Done. TubeLab is now available in Codex.
## Example prompts
Ask Codex anything about YouTube and it will call TubeLab's tools behind the scenes:
* *"Search for cooking channels with over 100K subscribers"*
* *"Get me the transcript of this video: dQw4w9WgXcQ"*
* *"What are the top comments on this video?"*
* *"Find channels similar to @mkbhd"*
* *"What viral videos are there about home automation this month?"*
* *"How many credits do I have left?"*
## Tools
Once connected, Codex has access to 11 TubeLab tools:
| Tool | What it does | Cost |
| ------------------------- | -------------------------------------------------------------------------------------------------- | ----------- |
| `search_channels` | Search YouTube channels by keyword with filters (subscribers, views, language, monetization, etc.) | `5 credits` |
| `search_related_channels` | Find channels similar to a given channel | `5 credits` |
| `search_outliers` | Find viral or underperforming videos across YouTube by keyword | `2 credits` |
| `search_related_outliers` | Find outlier videos from channels similar to a given channel | `2 credits` |
| `get_channel` | Get info about a YouTube channel (accepts ID, URL, or @handle) | `free` |
| `get_channel_videos` | Get recent videos from a channel | `free` |
| `get_channel_shorts` | Get recent Shorts from a channel | `free` |
| `get_video` | Get detailed info about a specific video | `free` |
| `get_video_transcript` | Get the transcript/captions of a video | `free` |
| `get_video_comments` | Get top comments from a video | `free` |
| `get_credits_balance` | Check your TubeLab credit balance | `free` |
You don't need to call these by name. Just ask Codex what you need in plain language and it picks the right tools automatically.
## Good to know
* Tools consume your TubeLab [credits](/api/pricing) at the same rate as the TubeLab app or [API](/api/introduction)
* The Bearer token authenticates as your account — treat it like a password
* Check your balance anytime: *"What's my TubeLab credit balance?"*
## How it works
TubeLab's Codex integration uses [MCP (Model Context Protocol)](https://modelcontextprotocol.io/docs/getting-started/intro) — an open standard that lets AI assistants use external tools directly inside a conversation. When you add TubeLab as an MCP server, Codex can call TubeLab's API on your behalf without you writing any code or leaving the chat.
# Cursor
URL: /api/mcp-server/cursor
***
title: Cursor
description: Connect TubeLab to Cursor and turn it into your YouTube research assistant.
----------------------------------------------------------------------------------------
import { Step, Steps } from "fumadocs-ui/components/steps";
Connect your TubeLab account to [Cursor](https://cursor.com/) and it becomes your YouTube research assistant — searching channels, finding viral videos, pulling transcripts — all within your editor.
## Setup
### 1. Create a TubeLab API key
You must have an [active subscription with available
credits](https://tubelab.net/settings).
Create an API key [here](https://tubelab.net/developers) and copy it.
**Be aware, this key won't be shown again.**
### 2. Open MCP settings
In Cursor, go to **Settings** → **MCP** → **+ Add new MCP server**.
### 3. Paste this config
```json
{
"mcpServers": {
"tubelab": {
"url": "https://public-api.tubelab.net/mcp",
"headers": {
"Authorization": "Bearer your-api-key-here"
}
}
}
}
```
Replace `your-api-key-here` with the API key from step 1.
### 4. Restart Cursor
Restart Cursor to connect. No installation needed — this connects directly to TubeLab's hosted MCP server.
Done. TubeLab is now available in Cursor.
## Example prompts
Ask Cursor anything about YouTube and it will call TubeLab's tools behind the scenes:
* *"Search for cooking channels with over 100K subscribers"*
* *"Get me the transcript of this video: dQw4w9WgXcQ"*
* *"What are the top comments on this video?"*
* *"Find channels similar to @mkbhd"*
* *"What viral videos are there about home automation this month?"*
* *"How many credits do I have left?"*
## Tools
Once connected, Cursor has access to 11 TubeLab tools:
| Tool | What it does | Cost |
| ------------------------- | -------------------------------------------------------------------------------------------------- | ----------- |
| `search_channels` | Search YouTube channels by keyword with filters (subscribers, views, language, monetization, etc.) | `5 credits` |
| `search_related_channels` | Find channels similar to a given channel | `5 credits` |
| `search_outliers` | Find viral or underperforming videos across YouTube by keyword | `2 credits` |
| `search_related_outliers` | Find outlier videos from channels similar to a given channel | `2 credits` |
| `get_channel` | Get info about a YouTube channel (accepts ID, URL, or @handle) | `free` |
| `get_channel_videos` | Get recent videos from a channel | `free` |
| `get_channel_shorts` | Get recent Shorts from a channel | `free` |
| `get_video` | Get detailed info about a specific video | `free` |
| `get_video_transcript` | Get the transcript/captions of a video | `free` |
| `get_video_comments` | Get top comments from a video | `free` |
| `get_credits_balance` | Check your TubeLab credit balance | `free` |
You don't need to call these by name. Just ask Cursor what you need in plain language and it picks the right tools automatically.
## Good to know
* Tools consume your TubeLab [credits](/api/pricing) at the same rate as the TubeLab app or [API](/api/introduction)
* The Bearer token authenticates as your account — treat it like a password
* Check your balance anytime: *"What's my TubeLab credit balance?"*
## How it works
TubeLab's Cursor integration uses [MCP (Model Context Protocol)](https://modelcontextprotocol.io/docs/getting-started/intro) — an open standard that lets AI assistants use external tools directly inside a conversation. When you add TubeLab as an MCP server, Cursor can call TubeLab's API on your behalf without you writing any code or leaving the editor.
# YouTube MCP Server
URL: /api/mcp-server
***
title: YouTube MCP Server
description: Access YouTube data via Claude, ChatGPT, Codex, Cursor, and any MCP-compatible AI agent.
-----------------------------------------------------------------------------------------------------
TubeLab runs a **YouTube MCP** server that lets [Claude](/api/mcp-server/claude-connector), [ChatGPT](/api/mcp-server/chatgpt), [Codex](/api/mcp-server/codex), [Cursor](/api/mcp-server/cursor), and any other MCP-compatible agent read **YouTube data** directly from chat — channel stats, viral outliers, transcripts, comments, and more.
No code, no API wiring, no scripts.
`https://public-api.tubelab.net/mcp`
## Access YouTube data from your favourite AI
Pick your AI client and follow the setup guide:
Connect YouTube data to Claude via Settings → Connectors. OAuth.
Connect YouTube data to ChatGPT as a custom app. OAuth.
Add the YouTube MCP server to Codex. API key.
Paste a JSON config into Cursor's MCP settings. API key.
## Authentication
The YouTube MCP server supports two authentication methods depending on the client:
* **OAuth** — used by Claude and ChatGPT. Log into TubeLab in a browser redirect, approve access, and the connector handles session refresh automatically. No API key to manage.
* **API key (Bearer token)** — used by Codex, Cursor, and any custom agent. [Create a key](https://tubelab.net/developers) and paste it as the Bearer token. Treat it like a password.
## Available YouTube data
Once connected, your AI agent has access to 11 tools covering the full TubeLab YouTube dataset:
| Tool | What it does | Cost |
| ------------------------- | -------------------------------------------------------------------------------------------------- | ----------- |
| `search_channels` | Search YouTube channels by keyword with filters (subscribers, views, language, monetization, etc.) | `5 credits` |
| `search_related_channels` | Find channels similar to a given channel | `5 credits` |
| `search_outliers` | Find viral or underperforming videos across YouTube by keyword | `2 credits` |
| `search_related_outliers` | Find outlier videos from channels similar to a given channel | `2 credits` |
| `get_channel` | Get info about a YouTube channel (accepts ID, URL, or @handle) | `free` |
| `get_channel_videos` | Get recent videos from a channel | `free` |
| `get_channel_shorts` | Get recent Shorts from a channel | `free` |
| `get_video` | Get detailed info about a specific video | `free` |
| `get_video_transcript` | Get the transcript/captions of a video | `free` |
| `get_video_comments` | Get top comments from a video | `free` |
| `get_credits_balance` | Check your TubeLab credit balance | `free` |
You don't need to call these by name. Just ask your agent what you need in plain language and it picks the right tools automatically.
## Prompts
Ready-to-use prompt templates for channel teardowns, niche research, trend reports and more — paste them into any MCP-connected chat.
Copy-paste prompts for the most common YouTube research workflows.
## What you can ask
Once the YouTube MCP server is connected, interact with YouTube data in plain language — niche research, competitor analysis, outlier discovery, transcript extraction, comments mining, and more. For battle-tested prompts you can copy-paste straight into chat, head to the prompts library.
Copy-paste prompts for channel teardowns, niche research, trend reports,
video ideation and comments analysis.
## Agents without MCP support
For agents that can't use MCP (custom scripts, curl-based automation, older chat interfaces), we also publish a [skill file](https://tubelab.net/docs/skill.md) documenting every endpoint with curl examples. Include it in your agent's system prompt or context and it will generate correct requests against TubeLab's YouTube data endpoints.
```bash
curl -o SKILL.md https://tubelab.net/docs/skill.md
```
The skill is auto-generated from the [OpenAPI spec](/api/reference) and stays in sync with the API.
# Prompts
URL: /api/mcp-server/prompts
***
title: Prompts
description: Ready-to-use prompts for getting the most out of TubeLab's MCP connectors.
---------------------------------------------------------------------------------------
import { Accordion, Accordions } from "fumadocs-ui/components/accordion";
A collection of battle-tested prompts for YouTube research — channel teardowns, niche analysis, trend reports, video ideation, and more.
These prompts are **already pre-included in the TubeLab MCP server** and can be launched natively by clients that support MCP prompts. [Claude is one such client](/api/mcp-server/claude-connector#workflows) — you can pick a workflow from the chat's **+** menu without copy-pasting anything.
Not every MCP client surfaces server-provided prompts yet (ChatGPT, Codex, Cursor). On those, use the copy-paste versions below.
## Requirements
Before running any of these prompts, make sure you have:
* An [active TubeLab subscription](https://tubelab.net/settings) with available credits
* The TubeLab MCP connector set up on your AI client — [Claude](/api/mcp-server/claude-connector), [ChatGPT](/api/mcp-server/chatgpt), [Codex](/api/mcp-server/codex), or [Cursor](/api/mcp-server/cursor)
* A chat session where the connector is enabled and allowed to call tools
Without these, the prompts will run but the model won't be able to fetch any YouTube data.
## Prompt library
```text
Produce a packaging teardown of ${channelUrl}. Output is a long-form essay — short punchy paragraphs, bold claims backed by data, no bullets/tables/numbered lists in the body.
Pull data in this order: `get_channel` for subs, averages, median, variation, outlier count. `get_channel_videos` (fallback `get_channel_shorts`) for every title, views, date, outlier ratios. `get_video` on the biggest outlier hit plus 1–2 recent underperformers. Only call `get_video_transcript` when verifying a suspected content-contract mismatch or rewriting titles — never pull every transcript.
Then `search_outliers` in the channel's niche with publishedAtFrom "${sixMonthsAgo}", sorted by averageViewsRatio, language matched to the channel, viewCountFrom set to ~2–5x the channel's average (scale with channel size). Run 2–3 passes across different niche angles. Use `search_related_channels` for competitor intel.
Compute: median views (not average — average is inflated), last-4 average, variation coefficient, positive and negative outliers, and any title format reused 3+ times with declining views (the decay pattern).
Write it as an essay with this flow. Open with a TL;DR: the diagnosis in 1–2 bold sentences plus 3–5 numbered actions, each 1–2 sentences, self-contained so a TL;DR-only reader knows exactly what to change. Then a divider. Then open with the contradiction — best metric vs. worst recent metric (e.g. "One video hit 182K. The last four averaged 1,597. Same channel. What broke?"). If any title format was reused 3+ times, show the decay trajectory with date, exact title, views.
Apply only the mistake lenses that fit: (a) missing authority signal — titles making claims without showing why this channel gets to make them; (b) wrong promise rung — Rung 1 bare promise, Rung 2 promise+constraint, Rung 3 named mechanism, Rung 4 implicit promise with mechanism carrying everything; check where competitors sit, that's where the audience is; (c) content contract — title promises X, video delivers Y (verify via transcript only when suspected); (d) thumbnail echoing title instead of doing a second job (only if thumbnails are visible); (e) exhausted formats with decay data. For each: name the specific title and its view count, say why it's failing, name the fix principle.
Then strategic recs specific to this channel (not generic): 2–3 content pillars based on what worked and what's working in the space; packaging rules for this channel's size/niche/trust level; upload cadence and format mix; competitive positioning — what this channel has that nobody else does and how it should show up in every title. Then 5–8 new video ideas from the outlier data with title, which pattern it's based on (channel + views + ratio as proof), promise rung, content contract. Then 3–5 repeatable title templates with [bracketed] variables, each designed so the promise stays novel across reuses, plus one concrete example. Close with a one-sentence root cause, the channel's unfair advantage, and the single most important thing to change first.
Only rewrite old titles if asked OR if a content-contract mismatch can't be explained without the rewrite. When rewriting: read the transcript first, describe what the video actually delivers in 2–3 sentences, explain the mismatch, offer 2–3 options and pick one. Every rewrite has a specific number, passes the authority test, sits at Rung 3+, under 60 chars when possible, no namedropping tools the viewer hasn't heard of.
Tone: direct not mean, data at every claim (never "your titles are generic" without the exact title + views vs. a competitor's title + views), bold sparingly for the sentences carrying the most weight, specific over abstract ("182K to 2.2K across five uploads" beats "declining performance"), always compare side by side when calling out a wrong rung or missing authority signal.
```
```text
Analyse ${target} for me.
Start with `search_channels` using publishedAtFrom "${threeMonthsAgo}" (expand to 6mo → 1yr if few results) to assess saturation — look at avgViewsToSubscribersRatio (above 1 = healthy), median views distribution (high = strong demand), and how many very similar channels exist (many = saturated).
Then `search_outliers` with the same adaptive timeframe to find what's actually working — top-performing topics, formats, title and thumbnail patterns.
Do a deep dive with `get_channel` on 2–3 top channels to confirm the patterns.
Give me: saturation assessment (demand vs. supply), audience quality (prioritise first-world older demographics over raw RPM — it's unreliable for non-first-world), what's working with real stats, content gaps with Niche Bending ideas (combine two proven formats into something fresh, optionally inject a trending topic), other language markets where the niche may be open (French, German, Spanish), and a final verdict on viability with entry strategy.
```
```text
Find me unsaturated YouTube niches with real monetization potential.
First ask me if I want to focus on faceless niches, then run `search_channels` twice — once with sortBy: "recency" and once with sortBy: "foundAt" — using these shared filters: classificationQuality "neutral", excludeNiche "${EXCLUDE_NICHES}", language ["en","de","fr"], monetizationAdsense true, publishedAtFrom "${threeMonthsAgo}" (expand to 6mo → 1yr if too few results), revenueMonthlyEstimationFrom 1000, subscribersFrom 1000, size 20. If I want faceless, add classificationIsFaceless true.
Analyse results using the Niche Bending Method — find proven title formats pulling consistent views (e.g. "The 7 Levels of...", "I Tried... for 30 Days"), then bend them by combining two formats into something fresh (e.g. "The 7 Levels of..." + "Your Life as a..." = "Your Life as Every Level Of..."), and optionally inject a trending topic if it fits naturally.
For each promising niche, suggest other language markets if decent (French, German, Spanish) where it may be wide open.
Avoid pitfalls: low-CPM audiences (India, Pakistan), slop (compilations, AI filler), restoration videos (saturated), animal-heavy niches (hard to differentiate).
Rank opportunities by niche-bending potential with specific bent formula examples and market expansion suggestions.
```
```text
Give me a trend report for ${target}.
Search outliers with publishedAtFrom "${oneMonthAgo}" — expand to 3mo → 6mo → 1yr if not enough relevant results.${channelExtra}
If any outliers really stand out, grab transcripts with `get_video_transcript` on up to 3 of them for deeper analysis.
Give me: the most relevant outliers and why they worked, winning patterns and recurring themes, title formulas that perform, emotional triggers and power words that drive clicks, and new ideas generated via SCAMPER (substitute, combine, adapt, modify, repurpose, eliminate, reverse) and Niche Bending (find proven formats → combine into fresh packaging → optionally inject trending topic). All ideas must be grounded in the data. Wrap up with a practical summary of takeaways.
```
```text
Generate video ideas for ${channelUrl}.
First `get_channel_videos` (fallback to `get_channel_shorts`) to understand the channel's style, audience, and what performs well vs. poorly.
Then `search_outliers` for the channel's niche${extra} with publishedAtFrom "${oneMonthAgo}" (expand to 3mo → 6mo → 1yr if insufficient).
Apply SCAMPER to the top outliers relative to this channel — substitute (swap topic/format/angle), combine (merge two proven concepts), adapt (borrow a format from another niche), modify (amplify or twist), put to other uses (repurpose for different segments), eliminate (strip to core), reverse (flip the perspective). Also derive title formulas from the outlier patterns.
Rank ideas by likely demand × alignment with the channel's style. Give me the top ideas with suggested titles for each.
```
# Channel Shorts
URL: /api/reference/get-channel-shorts
***
title: Channel Shorts
full: true
\_openapi:
method: GET
route: /channel/shorts/{id}
toc: \[]
structuredData:
headings: \[]
contents:
* content: Get shorts from a YouTube channel with sampled metrics.
***
{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}
Get shorts from a YouTube channel with sampled metrics.
# Channel Videos
URL: /api/reference/get-channel-videos
***
title: Channel Videos
full: true
\_openapi:
method: GET
route: /channel/videos/{id}
toc: \[]
structuredData:
headings: \[]
contents:
* content: Get videos from a YouTube channel with sampled metrics.
***
{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}
Get videos from a YouTube channel with sampled metrics.
# Credits Balance
URL: /api/reference/get-credits-balance
***
title: Credits Balance
full: true
\_openapi:
method: GET
route: /credits/balance
toc: \[]
structuredData:
headings: \[]
contents:
* content: Get your current credit balance.
***
{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}
Get your current credit balance.
# Scan
URL: /api/reference/get-scan
***
title: Scan
full: true
\_openapi:
method: GET
route: /scan/{id}
toc: \[]
structuredData:
headings: \[]
contents:
* content: >-
Get a scan by id.
Read the [**scanning** documentation](/api/scanning) to understand how
to use this endpoint.
***
{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}
Get a scan by id.
Read the [**scanning** documentation](/api/scanning) to understand how to use this endpoint.
# Video Comments
URL: /api/reference/get-video-comments
***
title: Video Comments
full: true
\_openapi:
method: GET
route: /video/comments/{id}
toc: \[]
structuredData:
headings: \[]
contents:
* content: Get the last 100 comments of a YouTube video.
***
{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}
Get the last 100 comments of a YouTube video.
# Video Details
URL: /api/reference/get-video-details
***
title: Video Details
full: true
\_openapi:
method: GET
route: /video/{id}
toc: \[]
structuredData:
headings: \[]
contents:
* content: Get details of a YouTube video.
***
{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}
Get details of a YouTube video.
# Video Transcript
URL: /api/reference/get-video-transcript
***
title: Video Transcript
full: true
\_openapi:
method: GET
route: /video/transcript/{id}
toc: \[]
structuredData:
headings: \[]
contents:
* content: Get the transcript of a YouTube video.
***
{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}
Get the transcript of a YouTube video.
# Scan
URL: /api/reference/post-scan
***
title: Scan
full: true
\_openapi:
method: POST
route: /scan
toc: \[]
structuredData:
headings: \[]
contents:
* content: >-
Start a YouTube scan to search for outliers and channels on any given
topic.
Read the [**scanning** documentation](/api/scanning) to understand how
to use this endpoint.
***
{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}
Start a YouTube scan to search for outliers and channels on any given topic.
Read the [**scanning** documentation](/api/scanning) to understand how to use this endpoint.
# Similar Channels
URL: /api/reference/search-channels-related
***
title: Similar Channels
full: true
\_openapi:
method: GET
route: /search/channels/related
toc: \[]
structuredData:
headings: \[]
contents:
* content: >-
Search for YouTube channels with **related content to another
channel**.
***
{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}
Search for YouTube channels with **related content to another channel**.
# Channels
URL: /api/reference/search-channels
***
title: Channels
full: true
\_openapi:
method: GET
route: /search/channels
toc: \[]
structuredData:
headings: \[]
contents:
* content: >-
Search for channels directly from the [YouTube Niche
Finder](https://tubelab.net/youtube-niche-finder) with AI enhanced
data and 30+ filters. Updated in real-time, 24/7.
***
{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}
Search for channels directly from the [YouTube Niche Finder](https://tubelab.net/youtube-niche-finder) with AI enhanced data and 30+ filters. Updated in real-time, 24/7.
# Similar Outliers
URL: /api/reference/search-outliers-related
***
title: Similar Outliers
full: true
\_openapi:
method: GET
route: /search/outliers/related
toc: \[]
structuredData:
headings: \[]
contents:
* content: >-
Search for YouTube outliers with **related content to another
outlier(s)**.
***
{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}
Search for YouTube outliers with **related content to another outlier(s)**.
# Outliers
URL: /api/reference/search-outliers
***
title: Outliers
full: true
\_openapi:
method: GET
route: /search/outliers
toc: \[]
structuredData:
headings: \[]
contents:
* content: >-
Search for videos directly from the [YouTube Outliers
Finder](https://tubelab.net/youtube-outliers-finder) library with AI
enhanced data and 30+ filters. Updated in real-time, 24/7.
***
{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}
Search for videos directly from the [YouTube Outliers Finder](https://tubelab.net/youtube-outliers-finder) library with AI enhanced data and 30+ filters. Updated in real-time, 24/7.