Python · pip install serpkite
Python + SerpKite
The official SerpKite Python SDK: typed responses, a sync and an asyncio client, automatic retries on 429 and 5xx with Retry-After, and every vertical from web search to Maps, Scholar and webpages.
Overview
What Python is, and where SerpKite fits
pip install serpkite gives you SerpKite and AsyncSerpKite, built on httpx and pydantic v2. Responses are typed models, so res.results[0].title autocompletes in your editor.
The client retries 429 and 5xx (honoring Retry-After) for you; those are never billed. Other errors raise serpkite.SerpKiteError with status, code, message and request_id.
Setup
Set it up in 3 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
Dependencies are httpx and pydantic v2.
pip install serpkite -
3
Search
sk.search("query", country="us")returns a typed response;res.meta.credits_usedis what the call cost.
Code
Examples
from serpkite import SerpKite, SerpKiteError
sk = SerpKite() # reads SERPKITE_API_KEY; SerpKite(api_key=..., timeout=..., max_retries=...)
try:
res = sk.search("best espresso machine 2026", country="us", language="en")
except SerpKiteError as e:
print(e.status, e.code, e.message, e.request_id)
raise
for r in res.results[:5]:
print(r.position, r.domain, r.title)
print(f"used {res.meta.credits_used} credits")
# Markdown for an LLM prompt (returns str)
md = sk.search("best espresso machine 2026", format="markdown")
# Other verticals
news = sk.news("espresso machine recall", time="week")
places = sk.maps("coffee roasters", location="Berlin, Germany")
page = sk.webpage("https://example.com")
print(page.markdown[:200])Many queries
Run up to 100 queries as a half-price batch
sk.batches.create queues up to 100 requests for any vertical at half price and returns one batch per request, in order. sk.batches.wait polls until it's done, or pass webhook_url to get a signed batch.completed callback instead.
from serpkite import SerpKite
sk = SerpKite()
keywords = ["crm for startups", "crm pricing", "open source crm"]
job = sk.batches.create(endpoint="search", requests=[{"q": kw, "country": "us"} for kw in keywords])
for kw, batch in zip(keywords, job.batches):
done = sk.batches.wait(batch.id)
print(kw, "→", done.status, done.credits_used)FAQ
Python and SerpKite: common questions
Keep exploring
Related APIs and integrations
Other integrations
Start building
Give your Python project Google search
2,500 free credits, then 1,000 every month. No credit card.