---
name: youtube-search
description: Search YouTube and get video metadata using YouTube Data API v3. Use when asked to find videos, search YouTube, get info about a video, or list videos by topic or channel. Requires YOUTUBE_API_KEY in ~/.openclaw/.env.
---

# YouTube Search

## Setup

API key stored in `~/.openclaw/.env` as `YOUTUBE_API_KEY`.

## Scripts

### Search videos
```bash
YOUTUBE_API_KEY=$(grep YOUTUBE_API_KEY ~/.openclaw/.env | cut -d= -f2) \
  python3 skills/youtube-search/scripts/youtube_search.py search "<query>" [<max_results>] [<lang>]
```
Returns JSON: title, channel, published, description (200 chars), url, video_id.

Default: max_results=5, lang=ru (relevanceLanguage, not filter — results may include other languages).

### Get video info
```bash
YOUTUBE_API_KEY=$(grep YOUTUBE_API_KEY ~/.openclaw/.env | cut -d= -f2) \
  python3 skills/youtube-search/scripts/youtube_search.py info "<video_id>"
```
Returns: title, channel, published, full description, views, likes, duration (ISO 8601), url.

## Quota

- Default: 10,000 units/day (resets midnight PT)
- `search.list` = 100 units per call → 100 searches/day max
- `videos.list` = 1 unit per call

## Usage patterns

- **Find videos**: use `search` with descriptive query
- **Video details**: use `info` with video_id from search results
- **Russian content**: use `lang=ru` (default)
- **English content**: use `lang=en`

## Presenting results

Format results as a numbered list with title, channel, date and URL. For video info, include views, duration and description summary.
