# How does an AI agent search YouTube?

> An agent calls search_youtube (or POST /v1/search) with a query and filters and gets videos, channels, playlists, Shorts or live streams. 3 credits per 20 results.

[Answer](https://wagamiai.com/answers)

The agent calls the search_youtube tool, or POST /v1/search, with a query and filters, and gets videos, channels, playlists, Shorts or live streams back as JSON. It costs 3 credits per 20 results ($1.50 for 1,000 searches of 20), and a search that finds nothing is free.

Updated 18 November 2026

## At a glance

| To get | Send | What comes back | Price |
| --- | --- | --- | --- |
| Search | query, limit (up to 100), kind (video, channel, playlist, shorts, live) | Items with id, title, channel, views, length and date | 3 credits per 20 results |
| Filter | upload (hour to year), duration, sort (relevance, views, date), features (4K, subtitles, Creative Commons and more) | Only what fits | 3 credits per 20 results |
| What people type | POST /v1/suggest with the first letters | Search suggestions | 3 credits |

## The exact call

```
curl -X POST "https://wagamiai.com/v1/search" \
  -H "Authorization: Bearer $WAGAMI_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "deep sea documentary", "duration": "long", "sort": "views", "limit": 5}'
```

What comes back:

```
{"ok": true, "items": [{"id", "title", "channel", "channel_id", "views", "duration", "published_ts", "thumbnail", …}]}
```

From an AI agent: the MCP tool is `search_youtube`. [How to connect](https://wagamiai.com/mcp).

## After the search

Every result carries the video's id. Pass it to `/v1/video` for full details, `/v1/transcript` for its words or `/v1/comments` for what people say.

## Questions

### What does a search cost?

3 credits per 20 results: $1.50 for 1,000 searches of 20 at the base rate. A search with no results is free.

### Is there a limit on searches?

No limit per minute, day or week on a WagamiAI account's key. The balance is the only limit.

### Which agents can use it?

Claude Code, Claude Desktop, Cursor, VS Code, Windsurf and other AI apps that connect to MCP servers, through the MCP server; any agent that can make HTTPS requests, through the API.

## Read next

- [The YouTube search API](https://wagamiai.com/youtube-search-api)
- [YouTube data for AI agents](https://wagamiai.com/youtube-api-for-ai-agents)
- [Search in the docs](https://wagamiai.com/docs#search)
- [All answers](https://wagamiai.com/answers)

## Try it with your own key

Plans from $20 a month, or credits without a plan from $25. Errors are never charged.

[Get started](https://wagamiai.com/signup) [See pricing](https://wagamiai.com/pricing)

---
This is the Markdown copy of https://wagamiai.com/answers/youtube-search-for-ai-agents (WagamiAI). Every page has one: add `.md` to its address. All pages: https://wagamiai.com/llms.txt
