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.

Maps

maps searches Google Maps and returns one page of up to 20 places. Each place has a name, place ID and Maps link, plus address, phone, website, rating, review count, coordinates and opening hours when available:

places = client.maps(
    "coffee shops",
    location={"latitude": 40.7455, "longitude": -74.0083, "zoom": 15},
    max_results=10,
)

for place in places["results"]:
    print(place["name"], place.get("rating"), place.get("address"))

A completed page costs 3 credits, including a confirmed empty page. max_results only trims the page and does not lower the price. Request page 2-6 with the same query and location for more places; each page is billed separately. Maps is not available with pay-per-request payments.

Deepcrawl

deepcrawl starts a task and waits for it to finish:

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

max_pages (1-1000, default 1000) caps the number of pages. include_paths and exclude_paths (up to 20 rules each) are matched against the URL path: a rule without * is a path prefix on segment boundaries (/docs matches /docs/api but not /docsearch); a rule with * must match the whole path, and * also matches /. Exclusion wins, and max_pages applies after the path rules, in discovery order. format="json" returns the pages in the result instead of a ZIP:

result = client.deepcrawl(
    "https://example.com",
    max_pages=50,
    include_paths=["/docs"],
    format="json",
)

for page in result.get("pages", []):
    print(page["url"], page["title"], len(page["content"]))

Each page has url, title (may be None) and content as Markdown. pages is omitted when the result is larger than 5 MB; download resultUrl instead, a JSON file with the same pages and failed lists. Finished tasks also report stats (discovered, matched, skipped, crawled, failed) and failed (url, error). A task costs 20 credits regardless of page count.

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.6.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.6.0
File Size Uploaded Provenance Actions
search1api-0.6.0.tar.gz 32.0 kB With provenance Details for search1api-0.6.0.tar.gz

Built distribution (wheel)

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

Total release size: 46.1 kB

Release files / search1api-0.6.0.tar.gz

Download URL search1api-0.6.0.tar.gz
Size 32.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b1f15350ec1b89a4fa29c8ee5eb1770d93d418bc600b1e23ad14ea7abd2a5ace
BLAKE2b-256 checksum
How to use checksums
d83419605c6fb1e07f6a7d59af4cb8d0a9617bbe03baf5f42a39ec3d3e88c599
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 5, 2026.

Transparency log

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

Download URL search1api-0.6.0-py3-none-any.whl
Size 14.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3c013060c8bd0783441263e5748dc8e7279202754c5edb86321bed139962a2f7
BLAKE2b-256 checksum
How to use checksums
959215196cf7eef1b60cb5b9fa77c907d509b449beacb2906d4f705b740f8f1e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 5, 2026.

Transparency log

Security for search1api 0.6.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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for search1api-0.6.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 Nov 5, 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