Skip to content

New AI assistant answers: ChatGPT, Gemini, Copilot and AI Mode by API

SerpKite
Get API key

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. 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. 2

    Install the SDK

    Dependencies are httpx and pydantic v2.

    pip install serpkite
  3. 3

    Search

    sk.search("query", country="us") returns a typed response; res.meta.credits_used is 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.

Python
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)

AI assistants

Ask ChatGPT, Gemini and other AI assistants

sk.chatgpt, sk.gemini, sk.copilot, sk.ai_mode and sk.brave_ai ask an AI assistant as a logged-out visitor and return the answer with the sources it cited. track adds mentions: whether the answer names each brand or domain and whether a cited source is on it. See AI assistants.

ChatGPT 4, Gemini 3, Copilot Search 3, Google AI Mode 2 and Brave AI 2 credits per answer; failed, refused and empty answers are free. Brave answers in 1–10 s, ChatGPT in 10–30 s and Gemini in 5–30 s, so allow at least 120 seconds per call.

Python
from serpkite import SerpKite

sk = SerpKite()
res = sk.chatgpt(
    prompt="What are the best CRMs for a 10-person startup?",
    track=["hubspot.com", "Pipedrive"],
)
print(res.markdown)  # citations as [n](link), matching res.sources[].position
for m in res.mentions or []:
    print(m.term, "named" if m.mentioned else "-", "cited" if m.cited else "-")

FAQ

Python and SerpKite: common questions

Start building

Give your Python project Google search

2,500 free credits, then 1,000 every month. No credit card.