Metadata-Version: 2.4
Name: llama-index-tools-serpbit
Version: 0.1.0
Summary: Google Search for LlamaIndex through Serpbit: GoogleSearchToolSpec's tool, on after Google's Custom Search API closes.
Author-email: Serpbit <support@serpbit.com>
License-Expression: MIT
Project-URL: Homepage, https://serpbit.com/custom-search-api-alternative/
Project-URL: Documentation, https://serpbit.com/docs/#sdks
Keywords: llama-index,llamaindex,google search,custom search api,serp api,web search,ai agents
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: Topic :: Internet :: WWW/HTTP :: Indexing/Search
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: llama-index-core<0.15,>=0.12
Requires-Dist: serpbit<1,>=0.3.0
Dynamic: license-file

# llama-index-tools-serpbit

Google Search for LlamaIndex after Google's Custom Search JSON API stops searching the whole web on January 1, 2027.
This is the `GoogleSearchToolSpec` of `llama-index-tools-google`, with the same tool, name and answers, served by
[Serpbit](https://serpbit.com/custom-search-api-alternative/) from Google's own results pages.

```sh
pip install llama-index-tools-serpbit
```

Moving is two lines: the import and the key. Make a key at https://app.serpbit.com/keys and pass it, or set
`SERPBIT_API_KEY`. The search engine id is gone, because the results come from the whole web.

```python
# Before
from llama_index.tools.google import GoogleSearchToolSpec
spec = GoogleSearchToolSpec(key="AIza...", engine="0123...", num=5)

# After
from llama_index.tools.serpbit import SerpbitSearchToolSpec
spec = SerpbitSearchToolSpec(num=5)  # SERPBIT_API_KEY, or key="sb_live_..."

tools = spec.to_tool_list()  # google_search, sync and async
```

The tool keeps Google's name, `google_search`, and gives the same list of `title`, `link` and `snippet`.

What differs from Google's:
- A `num` outside 1-10 is refused when the spec is made, not at the first search.
- A failed call raises the [`serpbit`](https://pypi.org/project/serpbit/) client's errors. Google's spec gives "No
  search results available" instead.
- A search takes about 2 seconds, against under 1 on Google's API.

Each search costs 1 credit. The free plan gives 1,000 credits a month, with no card.
