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.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file serpdive-0.1.1.tar.gz.
File metadata
- Download URL: serpdive-0.1.1.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f1dee60be07f3c5e9f2c255c1264bc29d39b86bba8232bba1225ca42a450bb8
|
|
| MD5 |
74a688fb2768c2d769a1e8806ed30b28
|
|
| BLAKE2b-256 |
a099aff07f32041fee19f5f266305685acf0ba1198fd67d9f5be20381b434f22
|
Provenance
The following attestation bundles were made for serpdive-0.1.1.tar.gz:
Publisher:
publish.yml on serpdive/serpdive-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
serpdive-0.1.1.tar.gz -
Subject digest:
8f1dee60be07f3c5e9f2c255c1264bc29d39b86bba8232bba1225ca42a450bb8 - Sigstore transparency entry: 2194970835
- Sigstore integration time:
-
Permalink:
serpdive/serpdive-python@676f1b5cf09a3cb8bef81c458255d9767e4ab103 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/serpdive
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@676f1b5cf09a3cb8bef81c458255d9767e4ab103 -
Trigger Event:
push
-
Statement type:
File details
Details for the file serpdive-0.1.1-py3-none-any.whl.
File metadata
- Download URL: serpdive-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
323326fd7ace8e7d800ad6a2ee517f88c09ffc50d2ecf441edd2176c188de518
|
|
| MD5 |
a2877135b1bbcb710bc9afdf6c8dc03e
|
|
| BLAKE2b-256 |
400598770b7c4a33ecb03fdf45715208bb0402099a896fd597cef3f092b5c67f
|
Provenance
The following attestation bundles were made for serpdive-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on serpdive/serpdive-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
serpdive-0.1.1-py3-none-any.whl -
Subject digest:
323326fd7ace8e7d800ad6a2ee517f88c09ffc50d2ecf441edd2176c188de518 - Sigstore transparency entry: 2194970844
- Sigstore integration time:
-
Permalink:
serpdive/serpdive-python@676f1b5cf09a3cb8bef81c458255d9767e4ab103 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/serpdive
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@676f1b5cf09a3cb8bef81c458255d9767e4ab103 -
Trigger Event:
push
-
Statement type: