> ## Documentation Index
> Fetch the complete documentation index at: https://langchain-5e9cc07a-preview-rbacpe-1762465003-c2183e4.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# YouTube

> [YouTube Search](https://github.com/joetats/youtube_search) package searches `YouTube` videos avoiding using their heavily rate-limited API.
>
> It uses the form on the `YouTube` homepage and scrapes the resulting page.

This notebook shows how to use a tool to search YouTube.

Adapted from [https://github.com/venuv/langchain\_yt\_tools](https://github.com/venuv/langchain_yt_tools)

```python theme={null}
pip install -qU  youtube_search
```

```python theme={null}
from langchain_community.tools import YouTubeSearchTool
```

```python theme={null}
tool = YouTubeSearchTool()
```

```python theme={null}
tool.run("lex fridman")
```

```output theme={null}
"['/watch?v=VcVfceTsD0A&pp=ygUMbGV4IGZyaWVkbWFu', '/watch?v=gPfriiHBBek&pp=ygUMbGV4IGZyaWVkbWFu']"
```

You can also specify the number of results that are returned

```python theme={null}
tool.run("lex friedman,5")
```

```output theme={null}
"['/watch?v=VcVfceTsD0A&pp=ygUMbGV4IGZyaWVkbWFu', '/watch?v=YVJ8gTnDC4Y&pp=ygUMbGV4IGZyaWVkbWFu', '/watch?v=Udh22kuLebg&pp=ygUMbGV4IGZyaWVkbWFu', '/watch?v=gPfriiHBBek&pp=ygUMbGV4IGZyaWVkbWFu', '/watch?v=L_Guz73e6fw&pp=ygUMbGV4IGZyaWVkbWFu']"
```

```python theme={null}
```

***

<Callout icon="pen-to-square" iconType="regular">
  [Edit the source of this page on GitHub.](https://github.com/langchain-ai/docs/edit/main/src/oss/python/integrations/tools/youtube.mdx)
</Callout>

<Tip icon="terminal" iconType="regular">
  [Connect these docs programmatically](/use-these-docs) to Claude, VSCode, and more via MCP for    real-time answers.
</Tip>
