YouSearchAPI Tool

Guide for using the YouSearchAPI tool with PraisonAI agents.

The YouSearchAPI tool lets an agent search the web through You.com’s search API.

Diagram

You.com Search

User

Agent

YouSearchAPIWrapper

You.com API

Results

Overview

The YouSearchAPI tool is a tool that allows you to search the web using the YouSearchAPI.

bash
pip install langchain-community
export YDC_API_KEY="${YDC_API_KEY:?Set YDC_API_KEY in your shell}"
python
from praisonaiagents import Agent, AgentTeam
from langchain_community.utilities.you import YouSearchAPIWrapper

data_agent = Agent(instructions="Gather the weather data for Barcelona", tools=[YouSearchAPIWrapper])
editor_agent = Agent(instructions="Breifly describe the weather in Barcelona")

agents = AgentTeam(agents=[data_agent, editor_agent])
agents.start()

How It Works

Diagram
You.com APIYouSearchAPIWrapperAgentUserYou.com APIYouSearchAPIWrapperAgentUser“Search for X”results(query)HTTPS requestresultsparsed resultfinal answer

Getting Started

  1. Simple Usage
    1. Install dependencies (see Overview above)
    2. Set required API keys in your environment
    3. Run the agent example in Overview
  2. With Configuration

    Use the same tool with an agent — see the Overview example, or pass env vars from the sections above.

Best Practices

Keep YDC_API_KEY in the environment

Set YDC_API_KEY in your shell or .env. YouSearchAPIWrapper reads it automatically — never hard-code the key.

Scope the query

You.com returns web snippets. Give the agent specific queries so it processes fewer, more relevant results.

Handle rate limits

The API returns HTTP 429 when the plan quota is exceeded. Wrap the call in try/except so the agent can fall back to another search tool.

Related Tools