File size: 3,095 Bytes
d66fda2 fdd5719 d66fda2 fdd5719 bf24a77 d66fda2 fdd5719 bf24a77 fdd5719 bf24a77 9b9847e bf24a77 fdd5719 bf24a77 fdd5719 bf24a77 fdd5719 bf24a77 fdd5719 bf24a77 fdd5719 bf24a77 fdd5719 bf24a77 fdd5719 bf24a77 fdd5719 bf24a77 fdd5719 bf24a77 fdd5719 bf24a77 fdd5719 bf24a77 fdd5719 bf24a77 fdd5719 bf24a77 9b9847e bf24a77 fdd5719 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | ---
title: "YouTube Search"
short_description: "Search videos by keyword, date and duration."
emoji: "🔎"
colorFrom: "blue"
colorTo: "indigo"
sdk: "static"
app_file: "index.html"
pinned: false
license: "mit"
tags:
- smolagents
- tool
- flashdata
- youtube-search
---
# YouTube Search
Search YouTube by keyword, upload date, duration and other filters. Return video IDs, titles, channels and available video statistics.
[API documentation](https://flashdata.dev/docs/sources/youtube_search?utm_source=hugging-face&utm_medium=integration&utm_campaign=intent_gtm_2026q4&utm_content=youtube-video-search-flashdata) · [Get an API key](https://flashdata.dev/signup?utm_source=hugging-face&utm_medium=integration&utm_campaign=intent_gtm_2026q4&utm_content=youtube_search-task) · [Pricing](https://flashdata.dev/pricing?utm_source=hugging-face&utm_medium=integration&utm_campaign=intent_gtm_2026q4&utm_content=youtube_search-task)
Requires your own FlashData API key and paid Credits. The Python tool is free to install.
## Try the inputs
Edit the JSON in this Space, generate a Python call, and inspect the included sample response or paste your own JSON. This page runs locally in your browser; it does not run a data query or collect your API key.
## Run with Python
Use Python 3.10 or newer:
```sh
python -m pip install "smolagents==1.26.0" "langchain-flashdata==0.2.1"
```
Review [tool.py](tool.py) before enabling `trust_remote_code`. Run locally with your key:
```python
import getpass
import os
from smolagents import load_tool
os.environ["FLASHDATA_API_KEY"] = getpass.getpass("FlashData API key: ")
tool = load_tool("flashdata-dev/youtube-video-search-flashdata", trust_remote_code=True)
result = tool(**{'max_results': 10, 'query': 'AI agents introduction'})
print(result)
```
The same loaded tool can be used with smolagents. A direct Python call does not require a model.
## Inputs
| Parameter | Required / default | Details |
| --- | --- | --- |
| `query` | Required | YouTube search query, between 1 and 2,000 characters. |
| `max_results` | 10 | Requested number of videos. minimum=1, maximum=20 |
| `filters` | None | filters |
See [input-schema.json](input-schema.json) for full validation rules. Optional `None` values are omitted; adapter defaults apply.
## Output
Read `results.0.results`. Fields: `videoId`, `title`, `channel`, `duration`, `viewCount`. Optional fields may be absent.
[example.json](example.json) contains a recorded response and its original request, not a new result for the input shown in the Space.
## Limits and cost
Request 1–20 results; this adapter defaults to 10. Actual results may be fewer. Transcript retrieval is separate.
Each data request uses FlashData Credits. Check [current pricing](https://flashdata.dev/pricing?utm_source=hugging-face&utm_medium=integration&utm_campaign=intent_gtm_2026q4&utm_content=youtube_search-task) before running. Any model or hosting charges are separate.
For an uncertain timeout, check your FlashData Jobs before retrying; this tool does not automatically retry paid submissions.
|