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.1.tar.gz (18.3 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.1-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for search1api-0.2.1.tar.gz
Algorithm Hash digest
SHA256 488e997d3ec9c9a6dbe53a1b9f107158ecb52d8320a15b10baebc8730f7961c9
MD5 463279b5f034ed8681c156580ebcdf32
BLAKE2b-256 fb723b03c2be663d32e4127d54e28931e5eb3a88af7bb947337635b9426580f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for search1api-0.2.1.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.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for search1api-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8c8a4c612aa411d5f660e7c592ef01e72dc9ee9cac77afca707abc777ce155da
MD5 c50a896c0111013079c6800e7e279037
BLAKE2b-256 98b136fe3620e47829233c9f57dacc0ef9ba952c74777e770654b2a3c6b01f5d

See more details on using hashes here.

Provenance

The following attestation bundles were made for search1api-0.2.1-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

This release

0.2.1 This release

2 files

0.2.0

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