> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agno.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SearchAPI

**SearchApiTools** enable an Agent to search Google, Google News, Google Images, and YouTube.

## Prerequisites

The following example requires the `requests` and `openai` libraries and an API key from [SearchAPI.io](https://www.searchapi.io/).

```shell theme={null}
uv pip install -U requests openai
```

```shell theme={null}
export SEARCHAPI_API_KEY=***
```

## Example

The following agent will search Google for the latest AI developments.

```python cookbook/91_tools/searchapi_tools.py theme={null}
from agno.agent import Agent
from agno.tools.searchapi import SearchApiTools

agent = Agent(tools=[SearchApiTools()])
agent.print_response("What are the latest developments in AI agents?", markdown=True)
```

## Toolkit Params

| Parameter               | Type            | Default | Description                                                                    |
| ----------------------- | --------------- | ------- | ------------------------------------------------------------------------------ |
| `api_key`               | `Optional[str]` | `None`  | SearchAPI key. If not provided, uses `SEARCHAPI_API_KEY` environment variable. |
| `num_results`           | `int`           | `5`     | Default number of results to return per search.                                |
| `timeout`               | `int`           | `30`    | Request timeout in seconds.                                                    |
| `enable_search_google`  | `bool`          | `True`  | Enable Google web search.                                                      |
| `enable_search_news`    | `bool`          | `False` | Enable Google News search.                                                     |
| `enable_search_images`  | `bool`          | `False` | Enable Google Images search.                                                   |
| `enable_search_youtube` | `bool`          | `False` | Enable YouTube search.                                                         |
| `all`                   | `bool`          | `False` | Enable all available search functions.                                         |

## Toolkit Functions

| Function         | Description                                                                                                                                                                             |
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `search_google`  | Search Google. Parameters: `query` (str), `num_results` (int), `location` (str, optional), `language` (str, optional). Returns organic results, knowledge graph, and related questions. |
| `search_news`    | Search Google News. Parameters: `query` (str), `num_results` (int), `country` (str, optional), `language` (str, optional). Returns news articles with title, source, date, and snippet. |
| `search_images`  | Search Google Images. Parameters: `query` (str), `num_results` (int), `safe_search` (str, optional). Returns image results with title, link, and thumbnail.                             |
| `search_youtube` | Search YouTube. Parameters: `query` (str), `num_results` (int). Returns video results with title, link, channel, length, and views.                                                     |

## Developer Resources

* [Tools](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/tools/searchapi.py)
