Introducing SerpApi Search Tools: Real-Time Web Search for Python AI Agents SerpApi released serpapi-search-tools, an open-source Python package that gives AI agents real-time access to web, news, maps, images, shopping, videos, hotels, flights, and travel search, compatible with 14 agent SDKs including LangChain, Agno, CrewAI, OpenAI Agents, Pydantic AI, and Google ADK. The package, available on PyPI and GitHub, includes ready-to-use search tools and requires Python 3.10 or newer, a SerpApi account, and an API key for the model provider. serpapi-search-tools gives Python AI agents real-time access to the web, news, maps, images, shopping, videos, hotels, flights, and travel search, powered by SerpApi. It works with 14 popular agent SDKs, including LangChain, Agno, CrewAI, OpenAI Agents, Pydantic AI, and Google ADK. AI agents are useful, but they cannot answer questions about current news, prices, places, or travel options unless they have a way to search. SerpApi https://serpapi.com/ lets applications search services such as Google, Bing, Google Maps, Google News, Google Shopping, YouTube, Google Hotels, and Google Flights, then returns organized data that the agent can use. We released serpapi-search-tools https://pypi.org/project/serpapi-search-tools/ to make that search data easy to use in Python agents. The package gives your agent ready-to-use search tools, so you can focus on what the agent should do instead of building a search integration from scratch. The package is open source on GitHub https://github.com/serpapi/serpapi-search-tools-python , and the complete guides and examples are available in the documentation https://serpapi.github.io/serpapi-search-tools-python/ . Add real-time web search to your first Python agent This example uses the OpenAI Agents SDK and gives a simple agent access to web search. Install You need Python 3.10 or newer, a SerpApi account, and an API key for the model provider your agent uses. This example uses OpenAI. For this tutorial, install serpapi-search-tools and the OpenAI Agents SDK together using pip: pip install "serpapi-search-tools openai-agents " If OpenAI Agents is already installed, you can install only the search tools: pip install serpapi-search-tools If you use uv, run: uv add "serpapi-search-tools openai-agents " For another agent SDK, choose its install option from the SDK examples https://serpapi.github.io/serpapi-search-tools-python/docs/sdk-examples/ . Add your API keys Your agent needs a SerpApi key for search and an OpenAI key for the model: export SERPAPI API KEY="your-serpapi-key" export OPENAI API KEY="your-openai-key" You can create a SerpApi account https://serpapi.com/users/sign up and copy your private API key from the SerpApi dashboard https://serpapi.com/dashboard . Build your first agent Save this as search agent.py : python import asyncio from agents import Agent, Runner from serpapi search tools import web search async def main : agent = Agent name="research-agent", model="gpt-5.6-luna", instructions= "Use web search for current facts." , tools= web search , result = await Runner.run agent, "Find three new Python features and briefly explain them.", for item in result.new items: if item.type == "tool call item": print f"Tool called: {item.tool name}" print f"Arguments: {item.raw item.arguments}" print "Agent Response: ", result.final output asyncio.run main Run it: python search agent.py The example prints each tool call and its arguments before the final answer. This makes the agent's search process visible, including the queries it created and the search engine it selected. Here is the output from an actual run: Tool called: web search Arguments: {"query":"Python latest release new features Python 3.14 official what's new","engine":"google light"} Tool called: web search Arguments: {"query":"site:python.org/downloads/release Python 3.14 new features","engine":"google light"} Agent Response: According to the official Python 3.14 documentation, three notable new features are: 1. Template string literals t-strings — A flexible way to create customized string-processing templates, useful for safer formatting and domain-specific text handling. 2. Deferred evaluation of annotations — Type annotations are evaluated later rather than immediately, reducing import problems and improving compatibility with forward references. 3. Standard-library subinterpreters — Python now provides tools for running isolated interpreters within one process, enabling better parallelism and isolation. Source: Python 3.14 “What’s New” https://docs.python.org/3/whatsnew/3.14.html The two printed calls show that the agent searched more than once to verify the answer. web search gave it the search capability, while the instruction told it to use that capability for current facts. Nine search tools for common agent tasks Different searches need different information. A hotel search needs stay dates, while a flight search needs airports and a travel date. serpapi-search-tools gives your agent a focused tool for each task so it knows what information to provide. | What you want your agent to do | Search tool | Search source | |---|---|---| | Research a current topic | web search | Google Light https://serpapi.com/google-light-api by default, with Google, Bing, Yahoo, or DuckDuckGo available news search Google News https://serpapi.com/google-news-api maps search Google Maps https://serpapi.com/google-maps-api images search Google Images https://serpapi.com/google-images-api shopping search Google Shopping https://serpapi.com/google-shopping-api , Amazon, Walmart, or eBay videos search YouTube https://serpapi.com/youtube-search-api hotels search Google Hotels https://serpapi.com/google-hotels-api flights search Google Flights https://serpapi.com/google-flights-api travel explore search Google Travel Explore https://serpapi.com/google-travel-explore-api Choose only the tools your agent needs. A shopping assistant might use web, shopping, and image search. A trip planner might use flights, hotels, maps, and travel exploration. One package for 14 Python agent SDKs An agent SDK is the Python library you use to build and run an agent. You can use serpapi-search-tools with the SDK you already know, and each link below opens a complete example. | Supported SDK | Start here | |---|---| | OpenAI Agents SDK | | Pydantic AI example https://serpapi.github.io/serpapi-search-tools-python/docs/sdk-examples/pydantic ai.html LangChain example https://serpapi.github.io/serpapi-search-tools-python/docs/sdk-examples/langchain.html LangGraph example https://serpapi.github.io/serpapi-search-tools-python/docs/sdk-examples/langgraph.html CrewAI example https://serpapi.github.io/serpapi-search-tools-python/docs/sdk-examples/crewai.html LlamaIndex example https://serpapi.github.io/serpapi-search-tools-python/docs/sdk-examples/llamaindex.html Claude Agent SDK example https://serpapi.github.io/serpapi-search-tools-python/docs/sdk-examples/claude agent sdk.html Microsoft Agent Framework example https://serpapi.github.io/serpapi-search-tools-python/docs/sdk-examples/microsoft agent framework.html AutoGen example https://serpapi.github.io/serpapi-search-tools-python/docs/sdk-examples/autogen.html Haystack example https://serpapi.github.io/serpapi-search-tools-python/docs/sdk-examples/haystack.html Semantic Kernel example https://serpapi.github.io/serpapi-search-tools-python/docs/sdk-examples/semantic kernel.html Agno example https://serpapi.github.io/serpapi-search-tools-python/docs/sdk-examples/agno.html smolagents example https://serpapi.github.io/serpapi-search-tools-python/docs/sdk-examples/smolagents.html Google ADK example https://serpapi.github.io/serpapi-search-tools-python/docs/sdk-examples/google adk.html The same search tools in every SDK The search tool names stay the same across supported SDKs: python from serpapi search tools import maps search, news search, web search search tools = web search , news search , maps search , Add these to your SDK the way you normally add tools. If you later switch SDKs, the surrounding agent code changes but your search setup stays familiar: web search is still web search . The SDK examples https://serpapi.github.io/serpapi-search-tools-python/docs/sdk-examples/ show the complete setup for every supported integration. The package recognizes your SDK automatically In a typical project, you install one supported agent SDK and call a search tool such as web search . The package recognizes the installed SDK and prepares the tool for it automatically. You usually do not need any extra setup. If your project has more than one supported SDK installed, the agent SDK guide https://serpapi.github.io/serpapi-search-tools-python/user-guide/frameworks.html shows how to select the one you want. Customize search for your agent The defaults are a good place to start, so you can use a simple call such as web search in your first agent. When you need more control, these six recipes cover common search and response settings. 1. Use one fast web search engine Google Light is the default web engine. You can make it the agent's only choice and set the language, country, result count, and timeout in your application: python from serpapi search tools import web search search = web search allowed engines= "google light" , default params={"num": 3, "hl": "en", "gl": "us"}, timeout=20.0, The agent still chooses the search query. Your application keeps control of the search engine and settings. 2. Give the agent regional search choices Create separately named tools when the agent needs to search different countries or languages: python from serpapi search tools import web search search us = web search allowed engines= "google light" , default params={"gl": "us", "hl": "en", "num": 3}, name="web search us", search de = web search allowed engines= "google light" , default params={"gl": "de", "hl": "de", "num": 3}, name="web search de", tools = search us, search de The names help the agent choose the right regional search for the question. 3. Compare products across marketplaces Create separate shopping tools when you want the agent to compare results from different marketplaces: python from serpapi search tools import shopping search google products = shopping search allowed engines= "google shopping" , default params={"gl": "us", "hl": "en", "num": 5}, name="google products", amazon products = shopping search allowed engines= "amazon" , default params={"num": 5}, name="amazon products", tools = google products, amazon products Google Shopping can compare products across merchants, while Amazon searches its own marketplace. You can create similar tools for Walmart and eBay. 4. Add safe, localized image search Keep safe search, language, and country settings under your application's control: python from serpapi search tools import images search safe images = images search default params={"safe": "active", "hl": "en", "gl": "us"}, name="safe image search", The agent only needs to describe what images it wants to find; your application applies the search policy every time. 5. Keep travel prices in one currency Use the same currency and locale across flight and hotel tools so their prices are easier to compare: python from serpapi search tools import flights search, hotels search travel defaults = {"currency": "USD", "hl": "en", "gl": "us"} flight search = flights search default params=travel defaults, name="us flights", hotel search = hotels search default params=travel defaults, name="us hotel prices", tools = flight search, hotel search The agent still provides the route, destination, and dates. Your application keeps the display currency and locale consistent. 6. Choose compact or full results Every search tool uses compact results by default. Compact mode keeps the response focused, which is usually the best choice for an agent: python from serpapi search tools import web search search = web search If your application needs the complete SerpApi response, including additional sections and metadata, choose full mode: python from serpapi search tools import SearchResultMode, web search search = web search mode=SearchResultMode.FULL Use full results only when your application needs the extra data; compact results help avoid filling the model's context with information it may not use. You can also configure locations, result limits, and other tool-specific settings. The configuration guide https://serpapi.github.io/serpapi-search-tools-python/user-guide/configuration.html contains the complete set of options and examples. Visit the full documentation https://serpapi.github.io/serpapi-search-tools-python/ for installation, SDK guides, recipes, and API details. Complete agent projects you can copy The agent cookbook https://serpapi.github.io/serpapi-search-tools-python/docs/cookbook/ contains complete projects for every supported SDK. Each guide includes setup instructions, a prompt you can edit, runnable code, and an output you can inspect. | SDK | Cookbook agent | SerpApi capabilities used | |---|---|---| | LangGraph https://serpapi.github.io/serpapi-search-tools-python/docs/cookbook/langgraph.html CrewAI https://serpapi.github.io/serpapi-search-tools-python/docs/cookbook/crewai.html LlamaIndex https://serpapi.github.io/serpapi-search-tools-python/docs/cookbook/llamaindex.html OpenAI Agents https://serpapi.github.io/serpapi-search-tools-python/docs/cookbook/openai-agents.html Claude Agent SDK https://serpapi.github.io/serpapi-search-tools-python/docs/cookbook/claude-agent-sdk.html Pydantic AI https://serpapi.github.io/serpapi-search-tools-python/docs/cookbook/pydantic-ai.html Microsoft Agent Framework https://serpapi.github.io/serpapi-search-tools-python/docs/cookbook/microsoft-agent-framework.html AutoGen https://serpapi.github.io/serpapi-search-tools-python/docs/cookbook/autogen.html Haystack https://serpapi.github.io/serpapi-search-tools-python/docs/cookbook/haystack.html Semantic Kernel https://serpapi.github.io/serpapi-search-tools-python/docs/cookbook/semantic-kernel.html Agno https://serpapi.github.io/serpapi-search-tools-python/docs/cookbook/agno.html smolagents https://serpapi.github.io/serpapi-search-tools-python/docs/cookbook/smolagents.html Google ADK https://serpapi.github.io/serpapi-search-tools-python/docs/cookbook/google-adk.html Start with the cookbook project closest to your idea, then change the prompt and search tools to fit your use case. Learn more about building agents If you are new to AI agents or want a longer tutorial, continue with these guides: Building an AI Agent in Python https://serpapi.com/blog/building-an-ai-agent-in-python/ explains agents, prompts, context, memory, tools, MCP, and skills from the beginning. Build Smarter Pydantic AI Agents with Real-Time Search https://serpapi.com/blog/smarter-pydantic-ai-agents-with-real-time-search/ shows how to add SerpApi search to a Pydantic AI agent step by step. Build an AI Agent with the Claude Agent SDK https://serpapi.com/blog/build-an-ai-agent-with-claude-agent-sdk/ shows how to build a Claude agent and connect it to custom tools. Start building Install the option for your SDK, add one or two search tools, and start from the cookbook project https://serpapi.github.io/serpapi-search-tools-python/docs/cookbook/ closest to your idea. The package is on PyPI https://pypi.org/project/serpapi-search-tools/ , the source is on GitHub https://github.com/serpapi/serpapi-search-tools-python , and issues and pull requests are welcome. If you are new to SerpApi, create a free account https://serpapi.com/users/sign up and give your Python agent real-time search data in a few minutes.