Skip to main content

Official Python SDK for SERPdive, the AI Search API: answer-ready web content for LLMs and agents

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

serpdive-0.2.0.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

serpdive-0.2.0-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file serpdive-0.2.0.tar.gz.

File metadata

  • Download URL: serpdive-0.2.0.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for serpdive-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4f91a2218da0825dbed9681c8d09690a3be8711eba71fa1c2ad9e5cda356bf38
MD5 10f175d448425cce0d0296e718a377e1
BLAKE2b-256 30be4e8a6083bb80c817cd7ac855e3ce1264a07f47e145023c4e7ff75cf6392a

See more details on using hashes here.

Provenance

The following attestation bundles were made for serpdive-0.2.0.tar.gz:

Publisher: publish.yml on serpdive/serpdive-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file serpdive-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: serpdive-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for serpdive-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5e36160b8c71618c24dd7c86a4bfd1980e13a97e3d8bd77e42d860d1b5592d61
MD5 6271052b9328d3b6249f08eabfa336b0
BLAKE2b-256 607b10743119e39a0f6fcfc3d17bd64781d3e1e70a973fdbfbad6aefa4208bc1

See more details on using hashes here.

Provenance

The following attestation bundles were made for serpdive-0.2.0-py3-none-any.whl:

Publisher: publish.yml on serpdive/serpdive-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page