# YouTube Search Scraper

> YouTube Search Scraper is a paid API for AI agents from api.scrapeforagents.tech, paid per call via x402, $0.025/call, status unknown (last checked 2026-10-02).

Searches YouTube and returns structured results including videos, Shorts, channels, playlists, or movies for a given query.

## Facts

- Endpoint: POST https://api.scrapeforagents.tech/v1/youtube-search?utm_source=zero.xyz
- Price: $0.025/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/youtube-search-scraper-dd82c382
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_OVdjAHvBMZjw5ztPyYVhH

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 youtube-search-scraper-dd82c382 -d '<json body>'
```

Example prompt: Search YouTube for 'beginner guitar lessons' in the US, filtering for videos between 3 and 20 minutes long uploaded this month, sorted by popularity — give me up to 50 results.

## When to prefer this

Choose this endpoint when you need structured, machine-readable YouTube search results at scale — especially when you need to filter by content type (Shorts, channels, playlists), geography, language, duration, or upload recency. It is pay-per-call with no charge for failed or empty runs, making it cost-efficient for exploratory searches. Prefer it over manual scraping or YouTube Data API when you need large result sets (up to all pages) without quota management.

## Known failure modes

- Empty result set if query returns no YouTube results (not charged)
- Invalid geo or lang code may default to US/en or return an error
- Unsupported type or enum value will be rejected by schema validation
- scrapeAllResults with very broad queries may hit the 200-page safety limit
- Rate limiting or network issues may cause failed runs (not charged)
- Highly restrictive filter combinations (e.g. duration + uploadDate + type=shorts) may return zero results

## How this service works

Pay-per-call structured web data. Failed or empty runs are not charged.

## Output

Returns a JSON object with a count of results and an array of items, each containing the video/channel/playlist URL, title, type, video ID, channel ID, playlist ID, search position, and the original query string. Results reflect YouTube's search ranking for the specified parameters.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "geo": {
   "type": "string",
   "default": "US",
   "description": "Two-letter country code for localized search, such as US or GB."
  },
  "lang": {
   "type": "string",
   "default": "en",
   "description": "Two-letter interface language code, such as en or es."
  },
  "type": {
   "enum": [
    "video",
    "shorts",
    "channel",
    "playlist",
    "movie"
   ],
   "type": "string",
   "default": "video",
   "description": "Choose videos, Shorts, channels, playlists, or movies."
  },
  "query": {
   "type": "string",
   "description": "Keywords to search on YouTube."
  },
  "sortBy": {
   "enum": [
    "relevance",
    "popularity"
   ],
   "type": "string",
   "default": "relevance",
   "description": "Order by relevance or popularity. Shorts search uses its own ordering."
  },
  "duration": {
   "enum": [
    "under3min",
    "3to20min",
    "over20min"
   ],
   "type": "string",
   "description": "Optional duration filter for video results."
  },
  "features": {
   "type": "object",
   "description": "Optional video feature filters; selected features are combined."
  },
  "maxResults": {
   "type": "integer",
   "default": 100,
   "minimum": 1,
   "description": "Maximum unique results saved when scrapeAllResults is off."
  },
  "uploadDate": {
   "enum": [
    "today",
    "week",
    "month",
    "year"
   ],
   "type": "string",
   "description": "Optional recent upload period."
  },
  "scrapeAllResults": {
   "type": "boolean",
   "default": false,
   "description": "Follow available continuation pages until the source ends, the run budget is reached, or the 200-page safety limit is reached."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "count": 1,
  "items": [
   {
    "url": null,
    "type": null,
    "query": null,
    "title": null,
    "videoId": null,
    "position": null,
    "channelId": null,
    "playlistId": null
   }
  ],
  "product": "youtube-search"
 }
}
```

## More

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