# agdata YouTube Data API

> agdata YouTube Data API is a paid API for AI agents from agdata.shveik.dev, paid per call via x402, $0.032/call, status unknown (last checked 2026-10-14).

Fetches YouTube video or channel data — including metadata, stats, and search results — as structured JSON, paid per call in stablecoins with no account required.

## Facts

- Endpoint: POST https://agdata.shveik.dev/v1/x402/youtube?utm_source=zero.xyz
- Price: $0.032/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agdata-youtube-data-api-99d3b08f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_T8kDb72JYrmhuuKkRUufd

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 agdata-youtube-data-api-99d3b08f -d '<json body>'
```

Example prompt: Search YouTube for the top 5 videos about 'Python machine learning tutorial' and give me the titles, view counts, and channel names for each result.

## When to prefer this

Choose this endpoint when you need structured YouTube video or channel data — including stats like views, likes, subscribers, duration, and comments — without a YouTube API key or developer account. It is especially useful for AI agents that need to search YouTube programmatically, compare video performance, vet influencers, or gather social media intelligence, and it requires only a per-call stablecoin payment via x402 with no signup.

## Known failure modes

- Invalid or missing mode enum (must be 'profile' or 'search') returns a 400 error
- Query string exceeding 500 characters is rejected
- Limit outside the 1–20 range returns a validation error
- Payment not received or insufficient USDC causes a 402 Payment Required response
- YouTube content may be geo-restricted or unavailable, resulting in empty results
- Channel or video not found returns an empty array or null record

## How this service works

Unblock any URL as Markdown, or get search, social, maps, jobs and news as data. Paid per call in stablecoins over x402 or MPP, with no account.

## Output

Returns a JSON array of YouTube video or channel objects. Each record includes the video ID, URL, title, description, thumbnail URL, view count, like count, comment count, duration in seconds, published date, channel name, channel ID, channel URL, and subscriber count. The number of results is bounded by the requested limit (1–20).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "mode": {
   "enum": [
    "profile",
    "search"
   ],
   "type": "string"
  },
  "limit": {
   "type": "integer",
   "maximum": 20,
   "minimum": 1
  },
  "query": {
   "type": "string",
   "maxLength": 500
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "id": "QhD015WU…",
  "url": "https://…",
  "likes": 13000,
  "title": "Beginner…",
  "views": 483801,
  "thumbnail": "https://…",
  "channel_id": "UCZDA1kA…",
  "channel_url": "https://…",
  "description": "The web…",
  "subscribers": 627000,
  "channel_name": "Tinkernu…",
  "published_at": "2021-11-…",
  "comments_count": 232,
  "duration_seconds": 456
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agdata-youtube-data-api-99d3b08f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agdata.shveik.dev](https://www.zero.xyz/host/agdata.shveik.dev/llms.txt)
