Python · serpkite[crewai]
CrewAI + SerpKite
Give your crew live Google search with one import. The official SerpKiteSearchTool ships in the serpkite Python SDK: install the crewai extra and hand the tool to any agent.
Overview
What CrewAI is, and where SerpKite fits
CrewAI runs teams of role-playing agents that collaborate on tasks. Tools are BaseTool instances with a name, a description and an argument schema.
SerpKiteSearchTool is SerpKite's first-party CrewAI tool. It reads SERPKITE_API_KEY, returns compact Markdown the agent can read directly, and can target another vertical (endpoint="news"), country or result count.
Setup
Set it up in 4 steps
-
1
Get an API key
Sign up (no card), create a key in the dashboard and export it as
SERPKITE_API_KEY. New accounts get 2,500 free credits, then 1,000 every month.export SERPKITE_API_KEY=skt_live_… -
2
Install the SDK with the CrewAI extra
The
crewaiextra pulls in CrewAI alongside theserpkiteSDK.pip install -U "serpkite[crewai]" -
3
Create the tool
SerpKiteSearchTool()searches Google web results. Passendpoint,countryornumto change the defaults. -
4
Assign it to an agent and kick off the crew
Give the tool to the agents that need the web.
Code
Complete example
from crewai import Agent, Crew, Task
from serpkite.crewai import SerpKiteSearchTool
search = SerpKiteSearchTool() # reads SERPKITE_API_KEY
news = SerpKiteSearchTool(endpoint="news", country="us", num=10)
researcher = Agent(
role="Market researcher",
goal="Find current, sourced facts about a market",
backstory="You verify every claim with a web search and cite URLs.",
tools=[search, news],
)
task = Task(
description="List the five most-funded AI agent startups this year with sources.",
expected_output="A Markdown table: company, amount, round, source URL.",
agent=researcher,
)
print(Crew(agents=[researcher], tasks=[task]).kickoff())Need more control?
Build your own tool on the SDK
For custom parameters (for example include_content to read top pages, or a fixed location), subclass BaseTool and call the serpkite SDK directly.
from serpkite import SerpKite, SerpKiteError
sk = SerpKite() # reads SERPKITE_API_KEY
def serpkite_search(query: str, country: str = "us", num: int = 10) -> str:
"""Google search via SerpKite. Returns the results page as compact Markdown."""
try:
# format="markdown" returns a str: results, People Also Ask, related searches
return sk.search(query, country=country, num=num, format="markdown")
except SerpKiteError as e:
return f"Search failed: {e.message}"
from crewai.tools import BaseTool
from pydantic import BaseModel, Field
class SearchInput(BaseModel):
query: str = Field(..., description="What to search Google for")
country: str = Field("us", description="Two-letter country code, e.g. us, gb, de")
class GoogleSearchTool(BaseTool):
name: str = "google_search"
description: str = "Search Google for current information. Returns the top results with links, People Also Ask and related searches as Markdown. Use for recent events, facts and anything after your training cutoff."
args_schema: type[BaseModel] = SearchInput
def _run(self, query: str, country: str = "us") -> str:
return serpkite_search(query, country)FAQ
CrewAI and SerpKite: common questions
Keep exploring
Related APIs and integrations
Start building
Give your CrewAI project Google search
2,500 free credits, then 1,000 every month. No credit card.