LlamaIndex tool integration for SearchApi.io — multi-engine web search
Project description
LlamaIndex Tools Integration: SearchApi
Multi-engine web search tool for LlamaIndex agents powered by SearchApi.io.
SearchApi provides structured data from 100+ search engines through a single API. This integration supports Google, Google News, Google Shopping, Google Jobs, YouTube, Bing, and Baidu.
Installation
pip install llama-index-tools-searchapi
Setup
Get your API key at searchapi.io (free tier: 100 searches/month).
Usage
from llama_index.tools.searchapi import SearchApiToolSpec
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI
tool_spec = SearchApiToolSpec(api_key="your-key")
agent = FunctionAgent(
tools=tool_spec.to_tool_list(),
llm=OpenAI(model="gpt-4.1"),
)
response = await agent.run("what's the latest news about AI agents?")
Google News
tool_spec = SearchApiToolSpec(api_key="your-key", engine="google_news")
YouTube
tool_spec = SearchApiToolSpec(api_key="your-key", engine="youtube")
With Location and Language
tool_spec = SearchApiToolSpec(api_key="your-key", num_results=5)
results = tool_spec.search("coffee shops", location="San Francisco", country="us", language="en")
Per-query Engine Override
tool_spec = SearchApiToolSpec(api_key="your-key")
results = tool_spec.search("wireless headphones", engine="google_shopping")
Supported Engines
| Engine | Description |
|---|---|
google |
Google web search (default) |
google_news |
Google News |
google_shopping |
Google Shopping |
google_jobs |
Google Jobs |
youtube |
YouTube video search |
bing |
Bing web search |
baidu |
Baidu search |
Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
api_key |
str |
required | SearchApi API key |
engine |
str |
"google" |
Default search engine |
num_results |
int |
10 |
Default number of results |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llama_index_tools_searchapi-0.1.0.tar.gz.
File metadata
- Download URL: llama_index_tools_searchapi-0.1.0.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
884ee440d5901655b0064848feeecadc9bf111d80360f955de37855701ece738
|
|
| MD5 |
f51ca90b5e89390240678fd6c2547e6b
|
|
| BLAKE2b-256 |
92d07f8c13411ec964a1437df6f249abe1b5d2abc35214b75b4f9131d32fc3cd
|
File details
Details for the file llama_index_tools_searchapi-0.1.0-py3-none-any.whl.
File metadata
- Download URL: llama_index_tools_searchapi-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4160749918b79b50eec6bc2fc6e4681a850ab28353543a10a1718e1f8519c063
|
|
| MD5 |
d0a64373b5ad6102cbf339430c9f9195
|
|
| BLAKE2b-256 |
1a24ac75f37bf18a08004fcfcf0fd9503fca57343054797e5745357c166b93be
|