Get the FREE Ultimate OpenClaw Setup Guide →

youtube-search

Scanned
npx machina-cli add skill ZeroPointRepo/youtube-skills/youtube-search --openclaw
Files (1)
SKILL.md
4.5 KB

YouTube Search

Search YouTube and fetch transcripts via TranscriptAPI.com.

Setup

If $TRANSCRIPT_API_KEY is not set, help the user create an account (100 free credits, no card):

Step 1 — Register: Ask user for their email.

node ./scripts/tapi-auth.js register --email USER_EMAIL

→ OTP sent to email. Ask user: "Check your email for a 6-digit verification code."

Step 2 — Verify: Once user provides the OTP:

node ./scripts/tapi-auth.js verify --token TOKEN_FROM_STEP_1 --otp CODE

API key saved to your shell profile and agent config. Ready to use.

Manual option: transcriptapi.com/signup → Dashboard → API Keys.

API Reference

Full OpenAPI spec: transcriptapi.com/openapi.json — consult this for the latest parameters and schemas.

GET /api/v2/youtube/search — 1 credit

Search YouTube globally for videos or channels.

curl -s "https://transcriptapi.com/api/v2/youtube/search?q=QUERY&type=video&limit=20" \
  -H "Authorization: Bearer $TRANSCRIPT_API_KEY"
ParamRequiredDefaultValidation
qyes1-200 chars (trimmed)
typenovideovideo or channel
limitno201-50

Video search response:

{
  "results": [
    {
      "type": "video",
      "videoId": "dQw4w9WgXcQ",
      "title": "Rick Astley - Never Gonna Give You Up",
      "channelId": "UCuAXFkgsw1L7xaCfnd5JJOw",
      "channelTitle": "Rick Astley",
      "channelHandle": "@RickAstley",
      "channelVerified": true,
      "lengthText": "3:33",
      "viewCountText": "1.5B views",
      "publishedTimeText": "14 years ago",
      "hasCaptions": true,
      "thumbnails": [{ "url": "...", "width": 120, "height": 90 }]
    }
  ],
  "result_count": 20
}

Channel search response (type=channel):

{
  "results": [{
    "type": "channel",
    "channelId": "UCuAXFkgsw1L7xaCfnd5JJOw",
    "title": "Rick Astley",
    "handle": "@RickAstley",
    "url": "https://www.youtube.com/@RickAstley",
    "description": "Official channel...",
    "subscriberCount": "4.2M subscribers",
    "verified": true,
    "rssUrl": "https://www.youtube.com/feeds/videos.xml?channel_id=UC...",
    "thumbnails": [...]
  }],
  "result_count": 5
}

GET /api/v2/youtube/channel/search — 1 credit

Search videos within a specific channel. Accepts channel — an @handle, channel URL, or UC... ID.

curl -s "https://transcriptapi.com/api/v2/youtube/channel/search\
?channel=@TED&q=climate+change&limit=30" \
  -H "Authorization: Bearer $TRANSCRIPT_API_KEY"
ParamRequiredValidation
channelyes@handle, channel URL, or UC... ID
qyes1-200 chars
limitno1-50 (default 30)

Returns up to ~30 results (YouTube limit). Same video response shape as global search.

GET /api/v2/youtube/channel/resolve — FREE

Convert @handle to channel ID:

curl -s "https://transcriptapi.com/api/v2/youtube/channel/resolve?input=@TED" \
  -H "Authorization: Bearer $TRANSCRIPT_API_KEY"

Workflow: Search → Transcript

# 1. Search for videos
curl -s "https://transcriptapi.com/api/v2/youtube/search\
?q=python+web+scraping&type=video&limit=5" \
  -H "Authorization: Bearer $TRANSCRIPT_API_KEY"

# 2. Get transcript from result
curl -s "https://transcriptapi.com/api/v2/youtube/transcript\
?video_url=VIDEO_ID&format=text&include_timestamp=true&send_metadata=true" \
  -H "Authorization: Bearer $TRANSCRIPT_API_KEY"

Errors

CodeAction
402No credits — transcriptapi.com/billing
404Not found
408Timeout — retry once
422Invalid channel identifier

Free tier: 100 credits, 300 req/min.

Source

git clone https://github.com/ZeroPointRepo/youtube-skills/blob/main/skills/youtube-search/SKILL.mdView on GitHub

Overview

This skill lets you search YouTube for videos or channels, optionally narrowing to a specific channel, and then fetch transcripts via TranscriptAPI. It helps you discover content on a topic and quickly access transcripts for review or analysis.

How This Skill Works

The skill uses YouTube search endpoints to return video or channel results. You can also search within a specific channel using the channel/search endpoint and convert handles to IDs with channel/resolve. After identifying a video, transcripts can be retrieved through TranscriptAPI using your API key.

When to Use It

  • When you want to find videos about a topic (e.g., 'neural networks') across YouTube.
  • When you want to search for channels or creators related to a topic.
  • When you want to look up a specific channel by @handle, URL, or ID and search within it.
  • When you want to discover who makes videos about a niche topic by exploring a channel's content.
  • When you need transcripts for found videos for quick review or citation.

Quick Start

  1. Step 1: Obtain a TranscriptAPI key (register or sign in) to authorize requests.
  2. Step 2: Run a YouTube search, e.g., q=machine+learning&type=video&limit=5 to get video results.
  3. Step 3: Pick a video and request its transcript through TranscriptAPI using your API key.

Best Practices

  • Use precise keywords and optional quotes to narrow results.
  • Decide early whether you want video results (type=video) or channel results (type=channel).
  • If targeting a creator, first resolve their handle to a channel ID with channel/resolve.
  • Use channel/search to limit results to a specific channel before broadening the query.
  • Monitor credits: global search and channel search cost 1 credit each; fetch transcripts as needed.

Example Use Cases

  • Search YouTube for videos about 'quantum computing' with limit 5.
  • Search within the TED channel for 'climate change'.
  • Resolve @TED to a channel ID and then search within that channel for 'ai safety'.
  • Find channels about 'data visualization' and review subscriber counts.
  • Select a video from results and fetch its transcript via TranscriptAPI.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers