Prerequisites
- Python 3.10 or higher
- PraisonAI Agents package installed
youdotcompackage installedYDC_API_KEYenvironment variable set
Quick Start
Installation
Setup
Built-in You.com Tool
PraisonAI provides a built-inydc tool that you can import directly:
Available Functions
| Function | Description |
|---|---|
ydc | Web search (alias for ydc_search) |
ydc_search | Unified web + news search |
ydc_contents | Extract content from URLs |
ydc_news | Live news search |
ydc_images | Image search |
Basic Usage
Simple Search
Search with Options
Extract Content from URLs
Live News Search
Image Search
With PraisonAI Agent
Using YouTools Class
For more control, use theYouTools class directly:
Search Parameters
| Parameter | Type | Description |
|---|---|---|
query | str | Search query (supports operators) |
count | int | Max results per section (default 10, max 100) |
freshness | str | ”day”, “week”, “month”, “year” or date range |
country | str | ISO country code (e.g., “US”, “GB”) |
language | str | BCP 47 language code (e.g., “EN”, “JP”) |
offset | int | Pagination offset (0-9) |
safesearch | str | ”off”, “moderate”, “strict” |
livecrawl | str | ”web”, “news”, or “all” |
livecrawl_formats | str | ”html” or “markdown” |
Search Operators
You.com supports advanced search operators:Key Points
- Simple function signature: Tool accepts
query: strand returns dict - Environment variable: Set
YDC_API_KEYbefore running - Unified results: Web and news results in single response
- LLM-ready snippets: Pre-extracted relevant text excerpts
Best Practices
Use AI snippets for summarized answers
Use AI snippets for summarized answers
You.com AI snippets provide pre-summarized answers - use them for quick, concise responses.
Set YDC_API_KEY for production
Set YDC_API_KEY for production
The free tier has low rate limits - set
YDC_API_KEY for production workloads.Combine with web search fallback
Combine with web search fallback
Use
search_web with providers=['you.com', 'duckduckgo'] for automatic fallback.Use news mode for current events
Use news mode for current events
Set
search_type='news' for current events queries to get fresher results.Related
Custom Tools
Build your own agent tools
Tools Overview
Browse PraisonAI tool documentation

