# API Direct YouTube Video Search

> API Direct YouTube Video Search is a paid API for AI agents from x402.apidirect.io, paid per call via x402, $0.006/call, status unknown (last checked 2026-10-30).

Search YouTube for videos matching a keyword query, with optional date filtering and AI sentiment analysis.

## Facts

- Endpoint: GET https://x402.apidirect.io/v1/youtube/posts?utm_source=zero.xyz
- Price: $0.006/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-direct-youtube-video-search-11def455
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_PyY4pNJ0125kOYUbEcZWV

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability api-direct-youtube-video-search-11def455
```

Example prompt: Search YouTube for 'electric vehicle reviews' uploaded this week and return 2 pages of results with AI sentiment analysis enabled.

## When to prefer this

Use this endpoint when you need to search YouTube video content by keyword with optional temporal filtering and AI emotional tone analysis. Prefer it over general web search when you specifically want YouTube results. Choose it over manual YouTube browsing when you need structured, machine-readable video data at scale. The sentiment analysis feature makes it especially useful for brand monitoring, audience research, or content strategy work where emotional tone matters.

## Known failure modes

- Empty results if query matches no YouTube videos
- Rate limiting or billing errors if too many pages requested simultaneously
- Invalid query length error if query exceeds 500 characters
- Payment failure if USDC balance is insufficient (billed per page)
- Invalid upload_date enum value returns validation error
- Sentiment analysis unavailable or incomplete for very short video metadata

## How this service works

Search for YouTube videos by keyword.

## Output

A paginated list of YouTube video results matching the search query, including video metadata (titles, URLs, channel info, etc.), optionally enriched with AI sentiment objects per video containing emotion scores (joy, trust, fear, surprise, sadness, disgust, anger, anticipation each 0-100), dominant emotion, emotional intensity (0-10), and polarity (positive/negative/neutral).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "query"
     ],
     "properties": {
      "pages": {
       "type": "integer",
       "default": 1,
       "maximum": 20,
       "minimum": 1,
       "description": "Number of pages to fetch and merge (1-20). Billed per page."
      },
      "query": {
       "type": "string",
       "maxLength": 500,
       "description": "Search query (max 500 characters)"
      },
      "upload_date": {
       "enum": [
        "last_hour",
        "today",
        "this_week",
        "this_month",
        "this_year"
       ],
       "type": "string",
       "description": "Filter by upload date"
      },
      "get_sentiment": {
       "type": "boolean",
       "default": false,
       "description": "Set to true to add AI emotion analysis to each post. Adds a `sentiment` object containing `emotions` (joy, trust, fear, surprise, sadness, disgust, anger and anticipation, each scored 0-100), `dominant_emotion`, `emotional_intensity` (0-10), and `polarity` (positive, negative or neutral). Any post t"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-direct-youtube-video-search-11def455/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.apidirect.io](https://www.zero.xyz/host/x402.apidirect.io/llms.txt)
