Skip to main content

SERPdive Python SDK

The official Python client for SERPdive, the AI Search API: ask a question, get answer-ready web content that is extracted, cleaned, and sized for an LLM. On a public, replayable 1,000-question benchmark, SERPdive runs at the same speed as Tavily, feeds your LLM 20.2% fewer tokens, and wins 60.7% of decided quality duels. If you are evaluating Tavily alternatives, that benchmark is public and replayable end to end: same questions, same judge, your machine.

There is a free tier, and it has no ceiling. The krill model is free and unlimited under fair use — no card, no credits, nothing to decrement. It returns the shortest set of sentences that still answers (about 700 tokens a search, roughly half what the usual alternatives send), one request at a time, at low priority. Use it to build; switch one word to mako when you need depth and steady latency.

Install

pip install serpdive

Quickstart

from serpdive import SerpDive

client = SerpDive(api_key="sd_live_...")  # or set SERPDIVE_API_KEY
response = client.search("who won the 2026 champions league final", answer=True)

print(response.answer)
for result in response.results:
    print(result.url, result.content[:100])

Get your API key at serpdive.com/dashboard/keys.

Usage

Choosing a model

# mako (default): answers in a few seconds
client.search("best rust web frameworks")

# moby: reads whole pages, for deep research
client.search("timeline of the OpenAI board dispute", model="moby", answer=True)

Options

client.search(
    "your question",
    model="moby",        # "mako" (fast, default) or "moby" (whole pages)
    answer=True,         # also return a written answer built from the sources
    max_results=5,       # hard cap on delivered results, 1 to 10
)

Localization is automatic: the language of the query picks where we search. There is no country parameter to configure.

Async

from serpdive import AsyncSerpDive

async with AsyncSerpDive() as client:
    response = await client.search("latest developments in solid state batteries")

Errors

Every API error is a typed exception with a stable code, the human message, and the HTTP status_code:

from serpdive import SerpDive, RateLimitError, QuotaExceededError, SerpDiveError

try:
    response = client.search("your question")
except RateLimitError:
    ...  # slow down, then retry
except QuotaExceededError:
    ...  # monthly credits exhausted
except SerpDiveError as e:
    print(e.code, e.message)

Transient failures (HTTP 502/503) are retried automatically; failed searches are never billed. Tune with SerpDive(max_retries=..., timeout=...).

Response shape

search() returns a SearchResponse:

Field Type Notes
query str your query, echoed
results list[SearchResult] each has url, content, optional title and ISO date
answer str | None only when answer=True was requested
extra_info dict | None direct-answer block (weather, rates, scores...) when the query has one
model str which model answered
response_time_ms int end-to-end latency
raw dict the verbatim API payload

Docs

Full documentation: serpdive.com/docs. The API is also self-describing for agents: llms.txt, openapi.json.

License

MIT

Metadata

Release files for serpdive 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for serpdive 0.2.1
File Size Uploaded Provenance
serpdive-0.2.1.tar.gz 9.3 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for serpdive 0.2.1
File Interpreter ABI Platform
serpdive-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 18.6 kB

Release files / serpdive-0.2.1.tar.gz

Download URL serpdive-0.2.1.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b54a3fa4579b7aed7b3799720c25c362cbcf60aaa1fc10f41c13bb0a9e5c7820
BLAKE2b-256 checksum
How to use checksums
b25d4160bb3a3d1cd1f97470890210757e5b37b3e8b82fad2172699c8b42a9d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 25, 2026.

Transparency log

Release files / serpdive-0.2.1-py3-none-any.whl

Download URL serpdive-0.2.1-py3-none-any.whl
Size 9.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6055fdf6a23efbe6a9fc213368a0c6dcce39c86b62d051f115c00f95ebcda29b
BLAKE2b-256 checksum
How to use checksums
f1022105074be924e588ec833c0ce8a074d3f20754a9ad474c355c238a82fc28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 25, 2026.

Transparency log

Security for serpdive 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for serpdive-0.2.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page