# SocialFetch YouTube Search

> SocialFetch YouTube Search is a paid API for AI agents from api.socialfetch.dev, paid per call via x402, $0.014/call, status unknown (last checked 2026-09-14).

Search YouTube videos, channels, and playlists by keyword with optional filters for type, region, sort order, duration, and upload date.

## Facts

- Endpoint: GET https://api.socialfetch.dev/v1/youtube/search
- Price: $0.014/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/socialfetch-youtube-search-3f7600ef
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_HtM7QlVlVjVyZL5AP4o19

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 socialfetch-youtube-search-3f7600ef
```

Example prompt: Search YouTube for 'sourdough bread tutorial' and filter to videos uploaded this month, sorted by popularity, longer than 20 minutes — show me the top results.

## When to prefer this

Use this endpoint when you need to programmatically search YouTube by keyword and want control over content type (videos, shorts, channels, playlists), region, recency, duration, and sort order. Prefer it over scraping YouTube directly or using the official YouTube Data API when you want a simple pay-per-call interface without OAuth or quota management.

## Known failure modes

- Missing required 'query' parameter returns a validation error
- Query exceeding 512 characters is rejected
- Invalid content type enum value returns an error
- Invalid region code may return no localized results or an error
- Invalid cursor value may return an error or reset to first page
- Payment not included or insufficient funds returns 402 Payment Required

## How this service works

Search YouTube videos, channels, and playlists by keyword.

## Output

A list of YouTube search results matching the query, which may include videos, channels, or playlists depending on the type filter. Each result includes metadata such as title, channel name, view counts, and URLs. When includeExtras is true, richer per-item metadata is returned. A pagination cursor is included when more results are available.

## 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"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "query"
     ],
     "properties": {
      "type": {
       "enum": [
        "videos",
        "shorts",
        "channels",
        "playlists"
       ],
       "type": "string",
       "description": "Optional content type filter for search results."
      },
      "query": {
       "type": "string",
       "maxLength": 512,
       "minLength": 1,
       "description": "Search query text for YouTube content."
      },
      "cursor": {
       "type": "string",
       "minLength": 1,
       "description": "Opaque pagination cursor returned by a previous response."
      },
      "region": {
       "type": "string",
       "description": "Optional ISO 3166-1 country code for localized search results."
      },
      "sortBy": {
       "enum": [
        "relevance",
        "popular"
       ],
       "type": "string",
       "description": "Optional sort order for search results."
      },
      "duration": {
       "enum": [
        "under_3_min",
        "between_3_and_20_min",
        "over_20_min"
       ],
       "type": "string",
       "description": "Optional duration filter for video results. Applies to videos, not shorts."
      },
      "uploadDate": {
       "enum": [
        "today",
        "this_week",
        "this_month",
        "this_year"
       ],
       "type": "string",
       "description": "Optional upload date filter for video results."
      },
      "includeExtras": {
       "type": "boolean",
       "description": "When true, returns richer per-video metadata when available. May increase response time."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/socialfetch-youtube-search-3f7600ef/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.socialfetch.dev](https://www.zero.xyz/host/api.socialfetch.dev/llms.txt)
