search1api 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,30 @@
1
+ name: CI
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches: [main]
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ test:
14
+ runs-on: ubuntu-latest
15
+ strategy:
16
+ matrix:
17
+ python-version: ["3.9", "3.12"]
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+ - uses: actions/setup-python@v5
21
+ with:
22
+ python-version: ${{ matrix.python-version }}
23
+ cache: pip
24
+ cache-dependency-path: pyproject.toml
25
+ - run: python -m pip install -e ".[dev]"
26
+ - run: ruff format --check .
27
+ - run: ruff check .
28
+ - run: mypy --python-version "${{ matrix.python-version }}" src/search1api
29
+ - run: pytest
30
+ - run: python -m build
@@ -0,0 +1,51 @@
1
+ name: Release
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ build:
9
+ runs-on: ubuntu-latest
10
+ permissions:
11
+ contents: read
12
+ steps:
13
+ - uses: actions/checkout@v6
14
+ with:
15
+ persist-credentials: false
16
+ - uses: actions/setup-python@v6
17
+ with:
18
+ python-version: "3.12"
19
+ - name: Verify release tag
20
+ env:
21
+ RELEASE_TAG: ${{ github.event.release.tag_name }}
22
+ run: >-
23
+ python -c "import os; from pathlib import Path;
24
+ version = next(line.split('=', 1)[1].strip().strip(chr(34))
25
+ for line in Path('pyproject.toml').read_text().splitlines()
26
+ if line.startswith('version = '));
27
+ assert os.environ['RELEASE_TAG'] == 'v' + version,
28
+ 'Release tag must be v' + version"
29
+ - run: python -m pip install build twine
30
+ - run: python -m build
31
+ - run: python -m twine check dist/*
32
+ - uses: actions/upload-artifact@v5
33
+ with:
34
+ name: python-package-distributions
35
+ path: dist/
36
+ if-no-files-found: error
37
+
38
+ publish:
39
+ needs: build
40
+ runs-on: ubuntu-latest
41
+ environment:
42
+ name: pypi
43
+ url: https://pypi.org/p/search1api
44
+ permissions:
45
+ id-token: write
46
+ steps:
47
+ - uses: actions/download-artifact@v6
48
+ with:
49
+ name: python-package-distributions
50
+ path: dist/
51
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,11 @@
1
+ .venv/
2
+ dist/
3
+ build/
4
+ *.egg-info/
5
+ __pycache__/
6
+ *.py[cod]
7
+ .mypy_cache/
8
+ .pytest_cache/
9
+ .ruff_cache/
10
+ .DS_Store
11
+
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Search1API
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
@@ -0,0 +1,131 @@
1
+ Metadata-Version: 2.4
2
+ Name: search1api
3
+ Version: 0.1.0
4
+ Summary: Official Python client for Search1API
5
+ Project-URL: Documentation, https://www.search1api.com/docs/integrations/sdks
6
+ Project-URL: Repository, https://github.com/superagents-lab/search1api-python
7
+ Project-URL: Issues, https://github.com/superagents-lab/search1api-python/issues
8
+ Author: Search1API
9
+ License: MIT License
10
+
11
+ Copyright (c) 2026 Search1API
12
+
13
+ Permission is hereby granted, free of charge, to any person obtaining a copy
14
+ of this software and associated documentation files (the "Software"), to deal
15
+ in the Software without restriction, including without limitation the rights
16
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
+ copies of the Software, and to permit persons to whom the Software is
18
+ furnished to do so, subject to the following conditions:
19
+
20
+ The above copyright notice and this permission notice shall be included in all
21
+ copies or substantial portions of the Software.
22
+
23
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29
+ SOFTWARE.
30
+
31
+ License-File: LICENSE
32
+ Keywords: ai,api,crawl,sdk,search
33
+ Classifier: Development Status :: 3 - Alpha
34
+ Classifier: Intended Audience :: Developers
35
+ Classifier: License :: OSI Approved :: MIT License
36
+ Classifier: Programming Language :: Python :: 3
37
+ Classifier: Programming Language :: Python :: 3.9
38
+ Classifier: Programming Language :: Python :: 3.10
39
+ Classifier: Programming Language :: Python :: 3.11
40
+ Classifier: Programming Language :: Python :: 3.12
41
+ Classifier: Typing :: Typed
42
+ Requires-Python: >=3.9
43
+ Requires-Dist: httpx<1,>=0.27
44
+ Provides-Extra: dev
45
+ Requires-Dist: build<2,>=1.2; extra == 'dev'
46
+ Requires-Dist: mypy<2,>=1.14; extra == 'dev'
47
+ Requires-Dist: pytest<9,>=8; extra == 'dev'
48
+ Requires-Dist: ruff<1,>=0.9; extra == 'dev'
49
+ Description-Content-Type: text/markdown
50
+
51
+ # Search1API Python SDK
52
+
53
+ Official synchronous and asynchronous Python clients for Search1API.
54
+
55
+ API documentation: [search1api.com/docs](https://www.search1api.com/docs)
56
+
57
+ ## Install
58
+
59
+ ```bash
60
+ pip install search1api
61
+ ```
62
+
63
+ ## Search
64
+
65
+ ```python
66
+ from search1api import Search1API
67
+
68
+ client = Search1API() # reads SEARCH1API_API_KEY
69
+ response = client.search(
70
+ "latest AI agent frameworks",
71
+ max_results=10,
72
+ crawl_results=3,
73
+ )
74
+
75
+ for result in response["results"]:
76
+ print(result["title"], result["link"])
77
+ ```
78
+
79
+ Use the client as a context manager when it owns the HTTP connection pool:
80
+
81
+ ```python
82
+ with Search1API("your-api-key") as client:
83
+ print(client.usage())
84
+ ```
85
+
86
+ ## Async
87
+
88
+ ```python
89
+ from search1api import AsyncSearch1API
90
+
91
+ async with AsyncSearch1API() as client:
92
+ response = await client.search("latest AI agent frameworks")
93
+ ```
94
+
95
+ ## Deepcrawl
96
+
97
+ `deepcrawl` starts a task and waits for it to finish:
98
+
99
+ ```python
100
+ result = client.deepcrawl("https://example.com", type="all")
101
+ print(result["zipUrl"])
102
+ ```
103
+
104
+ Use `start_deepcrawl`, `get_deepcrawl_status`, and `wait_for_deepcrawl` when
105
+ the application needs to control persistence or polling itself.
106
+
107
+ The clients also support news, crawl, sitemap, trending, extract, usage, and
108
+ batch operations exposed by the Search1API HTTP API. Requests time out after
109
+ 30 seconds and retry `429` and transient `5xx` responses twice by default.
110
+ Authentication, payment, and validation errors are never retried. Deepcrawl
111
+ task creation is not retried automatically because it is not idempotent.
112
+
113
+ ## Development
114
+
115
+ ```bash
116
+ python -m venv .venv
117
+ . .venv/bin/activate
118
+ python -m pip install -e ".[dev]"
119
+ ruff format --check .
120
+ ruff check .
121
+ mypy src/search1api
122
+ pytest
123
+ python -m build
124
+ ```
125
+
126
+ The checked-in OpenAPI snapshot is used to verify that the client covers every
127
+ public operation.
128
+
129
+ ## License
130
+
131
+ MIT
@@ -0,0 +1,81 @@
1
+ # Search1API Python SDK
2
+
3
+ Official synchronous and asynchronous Python clients for Search1API.
4
+
5
+ API documentation: [search1api.com/docs](https://www.search1api.com/docs)
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ pip install search1api
11
+ ```
12
+
13
+ ## Search
14
+
15
+ ```python
16
+ from search1api import Search1API
17
+
18
+ client = Search1API() # reads SEARCH1API_API_KEY
19
+ response = client.search(
20
+ "latest AI agent frameworks",
21
+ max_results=10,
22
+ crawl_results=3,
23
+ )
24
+
25
+ for result in response["results"]:
26
+ print(result["title"], result["link"])
27
+ ```
28
+
29
+ Use the client as a context manager when it owns the HTTP connection pool:
30
+
31
+ ```python
32
+ with Search1API("your-api-key") as client:
33
+ print(client.usage())
34
+ ```
35
+
36
+ ## Async
37
+
38
+ ```python
39
+ from search1api import AsyncSearch1API
40
+
41
+ async with AsyncSearch1API() as client:
42
+ response = await client.search("latest AI agent frameworks")
43
+ ```
44
+
45
+ ## Deepcrawl
46
+
47
+ `deepcrawl` starts a task and waits for it to finish:
48
+
49
+ ```python
50
+ result = client.deepcrawl("https://example.com", type="all")
51
+ print(result["zipUrl"])
52
+ ```
53
+
54
+ Use `start_deepcrawl`, `get_deepcrawl_status`, and `wait_for_deepcrawl` when
55
+ the application needs to control persistence or polling itself.
56
+
57
+ The clients also support news, crawl, sitemap, trending, extract, usage, and
58
+ batch operations exposed by the Search1API HTTP API. Requests time out after
59
+ 30 seconds and retry `429` and transient `5xx` responses twice by default.
60
+ Authentication, payment, and validation errors are never retried. Deepcrawl
61
+ task creation is not retried automatically because it is not idempotent.
62
+
63
+ ## Development
64
+
65
+ ```bash
66
+ python -m venv .venv
67
+ . .venv/bin/activate
68
+ python -m pip install -e ".[dev]"
69
+ ruff format --check .
70
+ ruff check .
71
+ mypy src/search1api
72
+ pytest
73
+ python -m build
74
+ ```
75
+
76
+ The checked-in OpenAPI snapshot is used to verify that the client covers every
77
+ public operation.
78
+
79
+ ## License
80
+
81
+ MIT
@@ -0,0 +1,14 @@
1
+ # OpenAPI snapshot
2
+
3
+ `search1api.openapi.json` is a public API contract snapshot generated by the
4
+ private Search1API service repository. It is checked in so SDK releases and
5
+ contract coverage tests remain reproducible.
6
+
7
+ The snapshot must be copied byte-for-byte from the canonical public contract;
8
+ internal and discontinued endpoints are intentionally excluded.
9
+
10
+ The deployed contract is available at:
11
+
12
+ ```text
13
+ https://api.search1api.com/openapi.json
14
+ ```