Skip to main content

Search1API Python SDK

Official synchronous and asynchronous Python clients for Search1API.

API documentation: search1api.com/docs

Install

pip install search1api

Search

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"])

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

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 is not retried automatically because it is not idempotent.

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

Download files

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

Source Distribution

search1api-0.2.0.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

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

search1api-0.2.0-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for search1api-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b14d4f26951761075eda29f9bbf02275f3eaa2a6cd2f19a8ef479d0de27b2596
MD5 728984302e10e0971ecd93621cb7658e
BLAKE2b-256 256321bebc0162f58d9d4c7c19cb9dd60a6fdc7202b51b2e255c2c7f04465c68

See more details on using hashes here.

Provenance

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

Publisher: release.yml on superagents-lab/search1api-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 search1api-0.2.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for search1api-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 87305b8e6347234a9e8034447979132dab40cb42a0b4f6b354954182741797ae
MD5 5a0de6a383370e0d997e5d14a3474665
BLAKE2b-256 0e6f523b84317264fe2170a43da19b31bbb1dc7173b16af9b9630d075ce4430f

See more details on using hashes here.

Provenance

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

Publisher: release.yml on superagents-lab/search1api-python

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

Release history Release notifications | RSS feed

0.2.1

2 files

This release

0.2.0 This release

2 files

0.1.0

2 files

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