# Add live search to your Python agent

`serpapi-search-tools` gives Python agents current web and specialized search through [SerpApi](https://serpapi.com). Add only the capabilities your agent needs--such as web, news, maps, shopping, hotels, or flights--and use them with your existing agent SDK or as normal Python functions.


# Supported agent SDKs

The package works with OpenAI Agents SDK, Pydantic AI, LangChain, LangGraph, CrewAI, LlamaIndex, Claude Agent SDK, Microsoft Agent Framework, AutoGen, Haystack, Semantic Kernel, Agno, smolagents, and Google ADK. When one supported SDK family is installed, the package detects it automatically. See [Agent SDKs](user-guide/frameworks.html) for version details and a complete example for each SDK.

You can also use every search tool without an agent SDK by choosing `provider="function"`.


# Install

If your agent SDK is already installed, add the base package:

``` bash
pip install serpapi-search-tools
```

If you want the package to install an agent SDK too, use its extra. For OpenAI Agents SDK:

``` bash
pip install "serpapi-search-tools[openai-agents]"
```

Set your SerpApi key before running a search:

``` bash
export SERPAPI_API_KEY="your-serpapi-key"
```


# Try it with OpenAI Agents SDK

This example gives one agent both general web search and current-news search:

``` python
from agents import Agent, Runner
from serpapi_search_tools import news_search, web_search

agent = Agent(
    name="research-assistant",
    instructions="Use search when the answer needs current information.",
    tools=[web_search(), news_search()],
)

result = Runner.run_sync(
    agent,
    "Find three recent Python packaging changes and explain why they matter.",
)
print(result.final_output)
```

With only OpenAI Agents SDK installed, [web_search()](reference/web_search.html#serpapi_search_tools.web_search) and [news_search()](reference/news_search.html#serpapi_search_tools.news_search) are detected and created in the right format automatically. If your environment contains several supported SDKs, select one explicitly--for example, `web_search(provider="openai-agents")`.


# Choose the right search capability

| Your agent needs | Start with |
|----|----|
| General websites and background research | [`web_search`](user-guide/web_search.html) |
| Current reporting | [`news_search`](user-guide/news_search.html) |
| Places and local businesses | [`maps_search`](user-guide/maps_search.html) |
| Images and source pages | [`images_search`](user-guide/images_search.html) |
| Products and marketplace listings | [`shopping_search`](user-guide/shopping_search.html) |
| YouTube videos, channels, and playlists | [`videos_search`](user-guide/videos_search.html) |
| Hotel availability for known dates | [`hotels_search`](user-guide/hotels_search.html) |
| Flights for a known route and date | [`flights_search`](user-guide/flights_search.html) |
| Destination ideas from a departure point | [`travel_explore_search`](user-guide/travel_explore_search.html) |


# Continue from here

- Follow the [Quickstart](user-guide/quickstart.html) for setup, keys, a first agent, customization, and troubleshooting.
- Read the [Introduction](user-guide/introduction.html) to understand what the package handles and how it fits into an agent application.
- Open [Agent SDK examples](docs/sdk-examples/index.html) for copy-ready code for your framework.
- Browse [Recipes](user-guide/recipes.html) for research, local discovery, shopping, and travel combinations.


### Links

[View on PyPI![](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxZW0iIGhlaWdodD0iMWVtIiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0eWxlPSJ2ZXJ0aWNhbC1hbGlnbjogLTAuMDVlbTsgbWFyZ2luLWxlZnQ6IDBlbTsgbWFyZ2luLXRvcDogMC4xZW07IiB2aWV3Ym94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik03IDdoMTB2MTAiIC8+PHBhdGggZD0iTTcgMTcgMTcgNyIgLz48L3N2Zz4=)](https://pypi.org/project/serpapi-search-tools/)\
[Browse source code![](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxZW0iIGhlaWdodD0iMWVtIiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0eWxlPSJ2ZXJ0aWNhbC1hbGlnbjogLTAuMDVlbTsgbWFyZ2luLWxlZnQ6IDBlbTsgbWFyZ2luLXRvcDogMC4xZW07IiB2aWV3Ym94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik03IDdoMTB2MTAiIC8+PHBhdGggZD0iTTcgMTcgMTcgNyIgLz48L3N2Zz4=)](https://github.com/serpapi/serpapi-search-tools-python)\
[Issues![](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxZW0iIGhlaWdodD0iMWVtIiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0eWxlPSJ2ZXJ0aWNhbC1hbGlnbjogLTAuMDVlbTsgbWFyZ2luLWxlZnQ6IDBlbTsgbWFyZ2luLXRvcDogMC4xZW07IiB2aWV3Ym94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik03IDdoMTB2MTAiIC8+PHBhdGggZD0iTTcgMTcgMTcgNyIgLz48L3N2Zz4=)](https://github.com/serpapi/serpapi-search-tools-python/issues)\


### AI / Agents

[Skills<img src="data:image/svg+xml;base64,PHN2ZyBjbGFzcz0iZ2Qtc3BhcmtsZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMC44NWVtIiBoZWlnaHQ9IjAuODVlbSIgdmlld2JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0eWxlPSJ2ZXJ0aWNhbC1hbGlnbjogLTAuMWVtOyBtYXJnaW4tbGVmdDogMC4yNWVtOyI+PHBhdGggZD0iTTkuOTM3IDE1LjVBMiAyIDAgMCAwIDguNSAxNC4wNjNsLTYuMTM1LTEuNTgyYS41LjUgMCAwIDEgMC0uOTYyTDguNSA5LjkzNkEyIDIgMCAwIDAgOS45MzcgOC41bDEuNTgyLTYuMTM1YS41LjUgMCAwIDEgLjk2MyAwTDE0LjA2MyA4LjVBMiAyIDAgMCAwIDE1LjUgOS45MzdsNi4xMzUgMS41ODJhLjUuNSAwIDAgMSAwIC45NjNMMTUuNSAxNC4wNjNhMiAyIDAgMCAwLTEuNDM3IDEuNDM3bC0xLjU4MiA2LjEzNWEuNS41IDAgMCAxLS45NjMgMHoiIC8+PHBhdGggZD0iTTIwIDN2NCIgLz48cGF0aCBkPSJNMjIgNWgtNCIgLz48L3N2Zz4=" class="gd-sparkle" />](skills.md)\
[llms.txt](llms.txt)\
[llms-full.txt](llms-full.txt)\


### Developers


**SerpApi**

<span style="margin-top: -0.15em; display: block;"> </span>

Developer

<span style="margin-top: -0.15em; display: block;">[](mailto:contact@serpapi.com "Email") [](https://github.com/serpapi "GitHub") [](https://serpapi.com "Website")</span>


### Community

[Full license](./license.html) <span class="gd-spdx-badge" title="MIT License">MIT</span>\


### Meta

**Requires:** Python `>=3.10`\
**Provides-Extra:** `agno`, `autogen`, `claude-agent-sdk`, `crewai`, `frameworks`, `google-adk`, `haystack`, `langchain`, `langgraph`, `llamaindex`, `microsoft-agent-framework`, `openai-agents`, `pydantic-ai`, `semantic-kernel`, `smolagents`\
[Package Info](package-info.md)
