# YouTube research Human Guide

## What This Is For
Research YouTube topics, analyze competitor videos, deconstruct viral content, and query the YouTube Data API. It gives the agent a clearer input/output frame for competitive research: what context to ask for, what decisions to make, and what usable artifact to return.

Use this as a human-readable version of the YouTube research agent skill. It is meant for marketers, operators, founders, and other non-coders who want the workflow without reading agent-specific implementation instructions.

## When To Use This
- Use this when you need a repeatable process for YouTube research.
- Use this when the task needs judgment, examples, constraints, or a clear output format rather than a one-off prompt.
- Use this when you want to hand an AI assistant enough context to produce a usable marketing artifact.

## When Not To Use This
- Do not use this when you only need a quick factual answer.
- Do not use this when the work depends on private data you cannot share with the assistant.
- Do not use this as a replacement for legal, compliance, financial, or medical review.

## What You Need Before Starting
- The goal or business outcome you want.
- The audience, customer segment, or market context.
- Any source material the assistant should respect, such as notes, briefs, examples, URLs, or brand guidance.
- Constraints such as tone, length, channel, deadline, region, or approval requirements.
- A clear definition of what a good final answer should look like.

## Step-By-Step Workflow
1. State the job clearly: "Use the YouTube research guide to help me with..."
2. Add context: audience, goal, offer, channel, source material, and constraints.
3. Ask the assistant to identify missing inputs before producing the final output.
4. Have the assistant follow the skill-specific guidance below.
5. Review the result against the final checklist and ask for revisions where needed.

## Skill-Specific Guidance
- **Topic Research** — competitive landscape, content gaps, strategic insights before planning a video
- **Video Analysis** — forensic deconstruction of transcripts to extract viral formulas and retention mechanics
- **API Queries** — direct YouTube Data API v3 access for search, stats, comments, and channel info
- Researching a video topic before planning production
- Analyzing a competitor video to extract what makes it work
- Fetching channel stats, video metrics, or comments via the API
- Identifying content gaps and opportunities in a niche
- Go to [Google Cloud Console](https://console.cloud.google.com/) → APIs & Services → Library
- Enable **YouTube Data API v3**
- Create Credentials → API Key
- What problem does this video solve?
- Why would someone click on it?

## Decision Points And Nuance
The original skill emphasizes: Workspace Context, Operating Contract, When to Use, YouTube Data API Setup, Get an API Key, Key API Commands, Mode 1: Topic Research, Workflow, Research File Template, Episode Overview.

Use these questions to steer the work:
- What is the intended audience or buyer?
- What source material must be preserved?
- What should the assistant optimize for: clarity, persuasion, accuracy, speed, creativity, or conversion?
- What examples represent the desired quality bar?
- What should the assistant avoid?

## Common Mistakes
- > **Important:** When piping curl output, wrap the command in `bash -c '...'` to preserve env vars:
- "I spent [TIME] figuring out [TOPIC] so you don't have to..."
- "This brings us to the most important point..."
- Common Mistakes to Avoid

## Copy-And-Paste Prompt
```text
Use the YouTube research human guide.

My goal:
[Describe the business outcome]

Audience:
[Describe who this is for]

Context and source material:
[Paste notes, examples, links, or existing copy]

Constraints:
[Tone, length, channel, timeline, must-include items, must-avoid items]

Before producing the final output, ask me for any missing information that would materially improve the result.
```

## Final Checklist
- [ ] The output matches the original goal.
- [ ] The audience and context are reflected in the answer.
- [ ] Important constraints and source material were preserved.
- [ ] The assistant made the relevant decisions explicit.
- [ ] The final artifact is ready to use, review, or hand to the next person.

## Source
This guide was generated from the manojbajaj95/claude-gtm-plugin skill entry for `youtube-research`.

## Source Skill Notes
These notes preserve the nuance from the original skill. Use them as supporting reference when the workflow above feels too generic.

# YouTube Research

## Workspace Context

Read bootstrap context before asking questions: `strategy/brand.md` for brand, audience, offer, channels, tools, constraints, and metrics; `about/me.md` for personal voice; `content/ideas.md` and `content/calendar.md` for content planning. Use legacy product-marketing context files only as fallback. Save generated drafts to `content/<platform>/drafts/YYYY-MM-DD_short-topic-slug.md`, and route durable learnings back to `strategy/brand.md`, `about/me.md`, or `content/ideas.md`.

## Operating Contract

This skill is self-contained for its frontmatter scope: use its local instructions, references, scripts, and assets as the playbook; ask only for missing task-specific inputs; hand off to adjacent skills instead of expanding scope; and return an actionable artifact, decision, plan, draft, or diagnostic.


Three modes in one skill:

1. **Topic Research** — competitive landscape, content gaps, strategic insights before planning a video
2. **Video Analysis** — forensic deconstruction of transcripts to extract viral formulas and retention mechanics
3. **API Queries** — direct YouTube Data API v3 access for search, stats, comments, and channel info

---

## When to Use

- Researching a video topic before planning production
- Analyzing a competitor video to extract what makes it work
- Fetching channel stats, video metrics, or comments via the API
- Identifying content gaps and opportunities in a niche

---

## YouTube Data API Setup

### 1. Get an API Key

1. Go to [Google Cloud Console](https://console.cloud.google.com/) → APIs & Services → Library
2. Enable **YouTube Data API v3**
3. Create Credentials → API Key

```bash
export YOUTUBE_API_KEY="your-api-key-here"
```

> **Important:** When piping curl output, wrap the command in `bash -c '...'` to preserve env vars:
> ```bash
> bash -c 'curl -s "https://..." -H "..." | jq .'
> ```

### 2. Key API Commands

**Search Videos:**
```bash
bash -c 'curl -s "https://www.googleapis.com/youtube/v3/search?part=snippet&q=YOUR_QUERY&type=video&maxResults=10&order=viewCount&key=${YOUTUBE_API_KEY}"' | jq '.items[] | {videoId: .id.videoId, title: .snippet.title, channel: .snippet.channelTitle}'
```

**Get Video Details (stats, duration):**
```bash
bash -c 'curl -s "https://www.googleapis.com/youtube/v3/videos?part=snippet,statistics,contentDetails&id=VIDEO_ID&key=${YOUTUBE_API_KEY}"' | jq '.items[0] | {title: .snippet.title, views: .statistics.viewCount, likes: .statistics.likeCount, duration: .contentDetails.duration}'
```

**Get Channel by Handle:**
```bash
bash -c 'curl -s "https://www.googleapis.com/youtube/v3/channels?part=snippet,statistics&forHandle=@HANDLE&key=${YOUTUBE_API_KEY}"' | jq '.items[0] | {id: .id, title: .snippet.title, subscribers: .statistics.subscriberCount, videos: .statistics.videoCount}'
```

**Get Video Comments:**
```bash
bash -c 'curl -s "https://www.googleapis.com/youtube/v3/commentThreads?part=snippet&videoId=VIDEO_ID&maxResults=20&order=relevance&key=${YOUTUBE_API_KEY}"' | jq '.items[] | {author: .snippet.topLevelComment.snippet.authorDisplayName, text: .snippet.topLevelComment.snippet.textDisplay, likes: .snippet.topLevelComment.snippet.likeCount}'
```

**Get Trending Videos:**
```bash
bash -c 'curl -s "https://www.googleapis.com/youtube/v3/videos?part=snippet,statistics&chart=mostPopular&regionCode=US&maxResults=10&key=${YOUTUBE_API_KEY}"' | jq '.items[] | {title: .snippet.title, channel: .snippet.channelTitle, views: .statistics.viewCount}'
```

**Quota:** 10,000 units/day. Search = 100 units. Most others = 1 unit.

See [YouTube Data API docs](https://developers.google.com/youtube/v3) for full reference.

---

## Mode 1: Topic Research
