Metadata-Version: 2.4
Name: search1api
Version: 0.1.0
Summary: Official Python client for Search1API
Project-URL: Documentation, https://www.search1api.com/docs/integrations/sdks
Project-URL: Repository, https://github.com/superagents-lab/search1api-python
Project-URL: Issues, https://github.com/superagents-lab/search1api-python/issues
Author: Search1API
License: MIT License
        
        Copyright (c) 2026 Search1API
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
License-File: LICENSE
Keywords: ai,api,crawl,sdk,search
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Typing :: Typed
Requires-Python: >=3.9
Requires-Dist: httpx<1,>=0.27
Provides-Extra: dev
Requires-Dist: build<2,>=1.2; extra == 'dev'
Requires-Dist: mypy<2,>=1.14; extra == 'dev'
Requires-Dist: pytest<9,>=8; extra == 'dev'
Requires-Dist: ruff<1,>=0.9; extra == 'dev'
Description-Content-Type: text/markdown

# Search1API Python SDK

Official synchronous and asynchronous Python clients for Search1API.

API documentation: [search1api.com/docs](https://www.search1api.com/docs)

## Install

```bash
pip install search1api
```

## Search

```python
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:

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

## Async

```python
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:

```python
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.

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

```bash
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
