Skip to main content

Search1API Python SDK

Official synchronous and asynchronous Python clients for Search1API.

API documentation: search1api.com/docs

Install

pip install search1api
from search1api import Search1API

client = Search1API()  # reads SEARCH1API_API_KEY
response = client.search(
    "latest AI agent frameworks",
    max_results=10,
    crawl_results=3,
)

for result in response["results"]:
    print(result["title"], result["link"])

search_service selects one engine (google by default), for example bing, bingcn, yandex, reddit, github, arxiv, wikipedia, or grokipedia. page requests a later results page on engines with native pagination (bing, bingcn, baidu, grokipedia). Results carry published_date when the source exposes one. Engine-specific fields are in each result's optional metadata: GitHub uses metadata.kind, metadata.stars, metadata.language, and metadata.num_comments; Hacker News news results use metadata.story_url, metadata.points, and metadata.num_comments. The former top-level paths are removed in 0.4.0; published_date stays at the top level.

Use the client as a context manager when it owns the HTTP connection pool:

with Search1API("your-api-key") as client:
    print(client.usage())

Async

from search1api import AsyncSearch1API

async with AsyncSearch1API() as client:
    response = await client.search("latest AI agent frameworks")

Ask

ask sends a natural-language request and lets Search1API choose the engines and time window. It returns at most 10 results ranked by relevance, and intent reports what was searched:

answer = client.ask("What are developers saying about Bun 1.3 this month?")

print(answer["intent"]["sources"], answer["intent"]["time_range"])
for result in answer["results"]:
    print(result["relevance"], result["source"], result["title"], result["link"])

A completed request costs 5 credits. Ask is not available with pay-per-request payments, and its default timeout is 45 seconds. Use search when you already know which engine and keywords you want.

Deepcrawl

deepcrawl starts a task and waits for it to finish:

result = client.deepcrawl("https://example.com", type="all")
print(result["zipUrl"])

Use start_deepcrawl, get_deepcrawl_status, and wait_for_deepcrawl when the application needs to control persistence or polling itself.

Screenshot

Screenshot responses are binary image bytes rather than JSON:

from pathlib import Path

screenshot = client.screenshot(
    "https://example.com",
    format="png",
    full_page=True,
)

Path("screenshot.png").write_bytes(screenshot["data"])
print(screenshot["content_type"], screenshot.get("request_id"))

The clients also support news, crawl, sitemap, trending, extract, usage, and batch operations exposed by the Search1API HTTP API. Requests time out after 30 seconds and retry 429 and transient 5xx responses twice by default. Authentication, payment, and validation errors are never retried. Deepcrawl task creation and feedback are not retried automatically because they are not idempotent.

Feedback

feedback reports a Search1API problem, missing capability, or confusing documentation. It is free. Do not include credentials or personal data:

client.feedback(
    "Results for this query have no publication dates",
    category="feature_request",
    request_id="the x-search1api-request-id of the original request",
)

Development

python -m venv .venv
. .venv/bin/activate
python -m pip install -e ".[dev]"
ruff format --check .
ruff check .
mypy src/search1api
pytest
python -m build

The checked-in OpenAPI snapshot is used to verify that the client covers every public operation.

License

MIT

Metadata

Release files for search1api 0.4.0

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

Source distribution (sdist)

Source distribution for search1api 0.4.0
File Size Uploaded Provenance Actions
search1api-0.4.0.tar.gz 24.1 kB With provenance Details for search1api-0.4.0.tar.gz

Built distribution (wheel)

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

Total release size: 36.4 kB

Release files / search1api-0.4.0.tar.gz

Download URL search1api-0.4.0.tar.gz
Size 24.1 kB
Tags Source
SHA-256 checksum
How to use checksums
407f71c52a1a2101b42a763784ac9b80951ac4a6f50e31775d301207aed95729
BLAKE2b-256 checksum
How to use checksums
d78db7e0c21e262ef60950302756a74d65baa424737c4ffb04add7f35221e341
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.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 Oct 12, 2026.

Transparency log

Release files / search1api-0.4.0-py3-none-any.whl

Download URL search1api-0.4.0-py3-none-any.whl
Size 12.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
609857bc974a58ddb534e2aac1db0930a3bf556f15c736643fd4c5e0d1cadfa1
BLAKE2b-256 checksum
How to use checksums
8e7484702646f578d797d0b1a5c198e6950dc2be221f38f9b778095324f92adb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.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 Oct 12, 2026.

Transparency log

Security for search1api 0.4.0

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 search1api-0.4.0.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 Oct 12, 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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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