Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -2181,6 +2181,7 @@
"tools/toolkits/search/perplexity",
"tools/toolkits/search/pubmed",
"tools/toolkits/search/scavio",
"tools/toolkits/search/searchapi",
"tools/toolkits/search/searxng",
"tools/toolkits/search/seltz",
"tools/toolkits/search/serpapi",
Expand Down Expand Up @@ -7170,6 +7171,7 @@
"examples/tools/newspaper4k-tools",
"examples/tools/reddit-tools",
"examples/tools/scrapegraph-tools",
"examples/tools/searchapi-tools",
"examples/tools/searxng-tools",
"examples/tools/serpapi-tools",
"examples/tools/serper-tools",
Expand Down Expand Up @@ -7302,7 +7304,6 @@
"examples/tools/perplexity-tools",
"examples/tools/scavio-tools",
"examples/tools/scheduler-tools",
"examples/tools/searchapi-tools",
"examples/tools/sofya-tools",
"examples/tools/tool-calls-accesing-agent",
"examples/tools/twelvelabs-tools",
Expand Down
1 change: 1 addition & 0 deletions examples/tools/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ description: "Examples for using and creating tools in Agno."
| [Replicate Tools](/examples/tools/replicate-tools) | Demonstrates replicate tools. |
| [Resend Tools](/examples/tools/resend-tools) | Demonstrates resend tools. |
| [ScrapeGraphTools](/examples/tools/scrapegraph-tools) | This script demonstrates the various capabilities of ScrapeGraphTools toolkit:. |
| [SearchAPI Tools](/examples/tools/searchapi-tools) | Demonstrates SearchAPI tools for real-time SERP data across Google web, Google News, Google Images, and YouTube. |
| [Searxng Tools](/examples/tools/searxng-tools) | Demonstrates searxng tools. |
| [Seltz Tools Example](/examples/tools/seltz-tools) | Generate and manage documents with Seltz. |
| [Serpapi Tools](/examples/tools/serpapi-tools) | Demonstrates serpapi tools. |
Expand Down
8 changes: 8 additions & 0 deletions tools/toolkits/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ The following **Toolkits** are available to use
>
Tools to search Pubmed.
</Card>
<Card
title="SearchAPI"
icon="magnifying-glass"
iconType="duotone"
href="/tools/toolkits/search/searchapi"
>
Tools to search Google, Google News, Google Images, and YouTube using SearchAPI.
</Card>
<Card
title="SearxNG"
icon="magnifying-glass"
Expand Down
55 changes: 55 additions & 0 deletions tools/toolkits/search/searchapi.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
title: 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
uv pip install -U requests openai
```

```shell
export SEARCHAPI_API_KEY=***
```

## Example

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

```python cookbook/91_tools/searchapi_tools.py
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)
Loading