automdev 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,14 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ .venv/
4
+ venv/
5
+ build/
6
+ dist/
7
+ *.egg-info/
8
+ .pytest_cache/
9
+ .mypy_cache/
10
+ .ruff_cache/
11
+ .coverage
12
+ htmlcov/
13
+ .env
14
+ .DS_Store
automdev-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Autom
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.
@@ -0,0 +1,218 @@
1
+ Metadata-Version: 2.5
2
+ Name: automdev
3
+ Version: 0.1.0
4
+ Summary: Official Python SDK for the Autom SERP API.
5
+ Project-URL: Homepage, https://www.autom.dev
6
+ Project-URL: Documentation, https://docs.autom.dev
7
+ Project-URL: Repository, https://github.com/automdev/autom-python
8
+ Project-URL: Issues, https://github.com/automdev/autom-python/issues
9
+ Author-email: Autom <contact@autom.dev>
10
+ License-Expression: MIT
11
+ License-File: LICENSE
12
+ Keywords: api,autom,google-search-api,sdk,search-api,seo,serp-api
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3 :: Only
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
+ Classifier: Topic :: Internet :: WWW/HTTP
21
+ Classifier: Typing :: Typed
22
+ Requires-Python: >=3.11
23
+ Requires-Dist: httpx<1,>=0.27
24
+ Provides-Extra: dev
25
+ Requires-Dist: build<2,>=1.2; extra == 'dev'
26
+ Requires-Dist: mypy>=1.13; extra == 'dev'
27
+ Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
28
+ Requires-Dist: pytest>=8.3; extra == 'dev'
29
+ Requires-Dist: ruff<1,>=0.8; extra == 'dev'
30
+ Description-Content-Type: text/markdown
31
+
32
+ # Autom Python SDK
33
+
34
+ The official Python SDK for the [Autom](https://www.autom.dev) SERP API.
35
+
36
+ Google, Bing and Brave search results as structured JSON — web, maps, news, shopping, images, jobs and AI Mode.
37
+
38
+ The SDK exposes **23 typed methods**, one per documented endpoint, with blocking and `asyncio` clients built on [HTTPX](https://www.python-httpx.org/), plus a generic `request()`.
39
+
40
+ ## Requirements
41
+
42
+ - Python 3.11 or newer
43
+
44
+ ## Installation
45
+
46
+ ```sh
47
+ pip install automdev
48
+ ```
49
+
50
+ ## Get your API key
51
+
52
+ [Sign up for Autom](https://app.autom.dev/register) or sign in, then copy your API key from the [dashboard](https://app.autom.dev). The client reads the `AUTOM_API_KEY` environment variable when no key is passed.
53
+
54
+ ## Quick start
55
+
56
+ ```python
57
+ import os
58
+
59
+ from autom import AutomClient
60
+
61
+ with AutomClient(os.environ["AUTOM_API_KEY"]) as client:
62
+ response = client.google_search(query="web scraping api")
63
+ print(response.data)
64
+ ```
65
+
66
+ Keyword arguments mirror the [API reference](https://docs.autom.dev). Python keywords get a trailing underscore (`from_=`), and the wire name is used on the request.
67
+
68
+ ## Async jobs
69
+
70
+ Any call accepts `is_async: true` (useful past the 60-second server limit): the response is then a `job_id`. `wait_for_job()` polls `GET /v1/jobs/{id}` until the job reaches a terminal status (`CompletedJob`, `Error`, `NotFound`, `BadRequest`):
71
+
72
+ ```python
73
+ submitted = client.google_search(query="web scraping api", is_async=True)
74
+ job = client.wait_for_job(
75
+ submitted.data["job_id"],
76
+ on_progress=lambda j: print(j["status"], j.get("progress")),
77
+ )
78
+ print(job.data)
79
+ ```
80
+
81
+ ## Async I/O
82
+
83
+ ```python
84
+ import asyncio
85
+
86
+ from autom import AsyncAutomClient
87
+
88
+
89
+ async def main() -> None:
90
+ async with AsyncAutomClient() as client:
91
+ response = await client.google_search(query="web scraping api")
92
+ print(response.data)
93
+
94
+
95
+ asyncio.run(main())
96
+ ```
97
+
98
+ ## GET or POST
99
+
100
+ Methods use GET when the endpoint supports it (parameters in the query string). POST sends the same parameters as a JSON body:
101
+
102
+ ```python
103
+ from autom import RequestOptions
104
+
105
+ client.bing_search(query="test", request_options=RequestOptions(method="POST"))
106
+ ```
107
+
108
+ `None` values are omitted, `False` and `0` are sent, and sequences repeat the parameter name.
109
+
110
+ ## Any endpoint
111
+
112
+ ```python
113
+ response = client.request("GET", "/v1/usage")
114
+ ```
115
+
116
+ ## Errors
117
+
118
+ ```python
119
+ from autom import AutomAPIError
120
+
121
+ try:
122
+ client.google_search(query="web scraping api")
123
+ except AutomAPIError as error:
124
+ print(error.status, error, error.response_body)
125
+ ```
126
+
127
+ | Error | When |
128
+ | --- | --- |
129
+ | `AutomConfigurationError` | Missing API key, invalid options, unsupported method, closed client. |
130
+ | `AutomSerializationError` | A required parameter is missing or a value can't be sent. |
131
+ | `AutomTransportError` | Network failure or timeout. |
132
+ | `AutomAPIError` | Non-2xx status (`status`, `error_message`, `response_body`, `raw_response`). |
133
+ | `AutomResponseDecodingError` | A success response could not be decoded. |
134
+
135
+ All of them extend `AutomError`.
136
+
137
+ ## Retries
138
+
139
+ Requests are retried up to 3 times after a network error, a `408`, `500`, `502`, `503` or `504`, or a rate limit — which the API returns as `401` (or `429`) with a `Rate limit exceeded` message. Per-key quota errors (`…: quota daily`) are not retried, nor are `400`, `402`, `404` or client-side timeouts. The delay starts at 1 second and grows 1.5× per retry (capped at 30 seconds); a `Retry-After` header wins.
140
+
141
+ ```python
142
+ client = AutomClient(max_retries=5, retry_delay=0.5)
143
+
144
+ # or for one request
145
+ client.google_search(query="web scraping api", request_options=RequestOptions(max_retries=0))
146
+ ```
147
+
148
+ ## Batch requests
149
+
150
+ `batch()` runs a function per item on 10 threads (`concurrency`) and returns one `BatchResult` per item, in input order. A failing item never stops the others. `AsyncAutomClient.batch()` does the same with `asyncio`.
151
+
152
+ ```python
153
+ inputs = ["web scraping api", "serp api", "rank tracker"]
154
+ results = client.batch(inputs, lambda query: client.google_search(query=query), concurrency=5)
155
+
156
+ for result in results:
157
+ if result.ok:
158
+ print(result.value.data)
159
+ else:
160
+ print(inputs[result.index], result.error)
161
+ ```
162
+
163
+ | Constant | Default | Description |
164
+ | --- | --- | --- |
165
+ | `DEFAULT_CONCURRENCY` | `10` | Tasks run at the same time by batch |
166
+ | `DEFAULT_TIMEOUT` | `120.0` | Request timeout (seconds) |
167
+ | `MAX_RETRIES` | `3` | Retry attempts after a network error, a 408/5xx or a rate limit |
168
+ | `RETRY_BACKOFF_FACTOR` | `1.5` | Exponential backoff multiplier |
169
+ | `DEFAULT_RETRY_DELAY` | `1.0` | Delay before the first retry (seconds) |
170
+
171
+ ## Timeouts and custom HTTPX clients
172
+
173
+ ```python
174
+ import httpx
175
+
176
+ from autom import AutomClient, RequestOptions
177
+
178
+ client = AutomClient(timeout=60) # seconds, default 120, None disables
179
+ client.google_search(query="web scraping api", request_options=RequestOptions(timeout=30))
180
+
181
+ # Bring your own HTTPX client (proxies, limits, event hooks…). You keep ownership of it.
182
+ http_client = httpx.Client(proxy="http://localhost:8080")
183
+ client = AutomClient(http_client=http_client)
184
+ ```
185
+
186
+ ## Endpoints
187
+
188
+ 23 methods, generated from the [OpenAPI document](https://app.autom.dev/openapi).
189
+
190
+ | Method | HTTP | Description |
191
+ | --- | --- | --- |
192
+ | `bing_search()` | GET / POST `/v1/bing/search` | Query Bing Search via API and retrieve structured organic results (title, link, snippet, position). |
193
+ | `brave_images()` | GET / POST `/v1/brave/images` | Search Brave Images via API and retrieve structured image results with pagination and SafeSearch. |
194
+ | `brave_search()` | GET / POST `/v1/brave/search` | Search Brave Search via API and retrieve structured organic results with pagination. |
195
+ | `brave_videos()` | GET / POST `/v1/brave/videos` | Search Brave Videos via API and retrieve structured video results with pagination and SafeSearch. |
196
+ | `duckduckgo_search()` | GET / POST `/v1/duckduckgo/search` | Query DuckDuckGo via API and retrieve structured organic results with region and language. |
197
+ | `finder_google_countries()` | GET `/v1/finder/google-countries` | Search Google countries and retrieve country codes (free Finder endpoint). |
198
+ | `finder_google_languages()` | GET `/v1/finder/google-languages` | Search Google languages and retrieve language codes (free Finder endpoint). |
199
+ | `finder_google_locations()` | GET `/v1/finder/google-locations` | Find supported Google locations and retrieve location IDs and country codes (free endpoint). |
200
+ | `google_images()` | GET / POST `/v1/google/images` | Search Google Images via API and retrieve image results (URLs, titles, sources, dimensions). |
201
+ | `google_jobs()` | GET / POST `/v1/google/jobs` | Scrape Google Jobs results via API and retrieve structured job listings with title, company, location, and pagination. |
202
+ | `google_maps()` | GET / POST `/v1/google/maps` | Search Google Maps via API and retrieve structured place results (address, website, phone). |
203
+ | `google_news()` | GET / POST `/v1/google/news` | Search Google News via API and retrieve structured news results with pagination. |
204
+ | `google_search()` | GET / POST `/v1/google/search` | Scrape Google Search results via API and retrieve structured SERP data with pagination. |
205
+ | `google_search_ai()` | GET / POST `/v1/google/search/ai` | Query Google AI Mode via API. JSON with text_blocks, references, and shopping_results. |
206
+ | `google_search_autocomplete()` | GET / POST `/v1/google/search/autocomplete` | Get Google Search autocomplete suggestions via API for a given query. |
207
+ | `google_search_light()` | GET / POST `/v1/google/search/light` | Scrape lightweight Google Search results via API: fast, cost-efficient, organic results only. |
208
+ | `google_shopping()` | GET / POST `/v1/google/shopping` | Scrape Google Shopping results via API and retrieve structured product listings with prices, ratings, and merchant data. |
209
+ | `google_videos()` | GET / POST `/v1/google/videos` | Search Google Videos via API and retrieve structured video results with metadata. |
210
+ | `jobs()` | GET `/v1/jobs/{id}` | Poll the status, progress (0–100) and result of a job started with is_async=true. Polling is free. Poll until status is terminal: Completed… |
211
+ | `search()` | GET / POST `/v1/search` | One call walks engines in order and returns the first organic results. engines=auto tries Google, then Brave, Bing, DuckDuckGo, Yahoo, and… |
212
+ | `stats()` | GET `/v1/stats` | Infrastructure health for an engine or endpoint over the last hour. Not scoped to your account or tenant. Enabled per account: HTTP 403 mea… |
213
+ | `usage()` | GET `/v1/usage` | Retrieve real-time usage statistics and credit balance for your Autom account. |
214
+ | `yahoo_search()` | GET / POST `/v1/yahoo/search` | Query Yahoo via API and retrieve structured organic results with country and language. |
215
+
216
+ ## License
217
+
218
+ MIT — see [LICENSE](LICENSE).
@@ -0,0 +1,187 @@
1
+ # Autom Python SDK
2
+
3
+ The official Python SDK for the [Autom](https://www.autom.dev) SERP API.
4
+
5
+ Google, Bing and Brave search results as structured JSON — web, maps, news, shopping, images, jobs and AI Mode.
6
+
7
+ The SDK exposes **23 typed methods**, one per documented endpoint, with blocking and `asyncio` clients built on [HTTPX](https://www.python-httpx.org/), plus a generic `request()`.
8
+
9
+ ## Requirements
10
+
11
+ - Python 3.11 or newer
12
+
13
+ ## Installation
14
+
15
+ ```sh
16
+ pip install automdev
17
+ ```
18
+
19
+ ## Get your API key
20
+
21
+ [Sign up for Autom](https://app.autom.dev/register) or sign in, then copy your API key from the [dashboard](https://app.autom.dev). The client reads the `AUTOM_API_KEY` environment variable when no key is passed.
22
+
23
+ ## Quick start
24
+
25
+ ```python
26
+ import os
27
+
28
+ from autom import AutomClient
29
+
30
+ with AutomClient(os.environ["AUTOM_API_KEY"]) as client:
31
+ response = client.google_search(query="web scraping api")
32
+ print(response.data)
33
+ ```
34
+
35
+ Keyword arguments mirror the [API reference](https://docs.autom.dev). Python keywords get a trailing underscore (`from_=`), and the wire name is used on the request.
36
+
37
+ ## Async jobs
38
+
39
+ Any call accepts `is_async: true` (useful past the 60-second server limit): the response is then a `job_id`. `wait_for_job()` polls `GET /v1/jobs/{id}` until the job reaches a terminal status (`CompletedJob`, `Error`, `NotFound`, `BadRequest`):
40
+
41
+ ```python
42
+ submitted = client.google_search(query="web scraping api", is_async=True)
43
+ job = client.wait_for_job(
44
+ submitted.data["job_id"],
45
+ on_progress=lambda j: print(j["status"], j.get("progress")),
46
+ )
47
+ print(job.data)
48
+ ```
49
+
50
+ ## Async I/O
51
+
52
+ ```python
53
+ import asyncio
54
+
55
+ from autom import AsyncAutomClient
56
+
57
+
58
+ async def main() -> None:
59
+ async with AsyncAutomClient() as client:
60
+ response = await client.google_search(query="web scraping api")
61
+ print(response.data)
62
+
63
+
64
+ asyncio.run(main())
65
+ ```
66
+
67
+ ## GET or POST
68
+
69
+ Methods use GET when the endpoint supports it (parameters in the query string). POST sends the same parameters as a JSON body:
70
+
71
+ ```python
72
+ from autom import RequestOptions
73
+
74
+ client.bing_search(query="test", request_options=RequestOptions(method="POST"))
75
+ ```
76
+
77
+ `None` values are omitted, `False` and `0` are sent, and sequences repeat the parameter name.
78
+
79
+ ## Any endpoint
80
+
81
+ ```python
82
+ response = client.request("GET", "/v1/usage")
83
+ ```
84
+
85
+ ## Errors
86
+
87
+ ```python
88
+ from autom import AutomAPIError
89
+
90
+ try:
91
+ client.google_search(query="web scraping api")
92
+ except AutomAPIError as error:
93
+ print(error.status, error, error.response_body)
94
+ ```
95
+
96
+ | Error | When |
97
+ | --- | --- |
98
+ | `AutomConfigurationError` | Missing API key, invalid options, unsupported method, closed client. |
99
+ | `AutomSerializationError` | A required parameter is missing or a value can't be sent. |
100
+ | `AutomTransportError` | Network failure or timeout. |
101
+ | `AutomAPIError` | Non-2xx status (`status`, `error_message`, `response_body`, `raw_response`). |
102
+ | `AutomResponseDecodingError` | A success response could not be decoded. |
103
+
104
+ All of them extend `AutomError`.
105
+
106
+ ## Retries
107
+
108
+ Requests are retried up to 3 times after a network error, a `408`, `500`, `502`, `503` or `504`, or a rate limit — which the API returns as `401` (or `429`) with a `Rate limit exceeded` message. Per-key quota errors (`…: quota daily`) are not retried, nor are `400`, `402`, `404` or client-side timeouts. The delay starts at 1 second and grows 1.5× per retry (capped at 30 seconds); a `Retry-After` header wins.
109
+
110
+ ```python
111
+ client = AutomClient(max_retries=5, retry_delay=0.5)
112
+
113
+ # or for one request
114
+ client.google_search(query="web scraping api", request_options=RequestOptions(max_retries=0))
115
+ ```
116
+
117
+ ## Batch requests
118
+
119
+ `batch()` runs a function per item on 10 threads (`concurrency`) and returns one `BatchResult` per item, in input order. A failing item never stops the others. `AsyncAutomClient.batch()` does the same with `asyncio`.
120
+
121
+ ```python
122
+ inputs = ["web scraping api", "serp api", "rank tracker"]
123
+ results = client.batch(inputs, lambda query: client.google_search(query=query), concurrency=5)
124
+
125
+ for result in results:
126
+ if result.ok:
127
+ print(result.value.data)
128
+ else:
129
+ print(inputs[result.index], result.error)
130
+ ```
131
+
132
+ | Constant | Default | Description |
133
+ | --- | --- | --- |
134
+ | `DEFAULT_CONCURRENCY` | `10` | Tasks run at the same time by batch |
135
+ | `DEFAULT_TIMEOUT` | `120.0` | Request timeout (seconds) |
136
+ | `MAX_RETRIES` | `3` | Retry attempts after a network error, a 408/5xx or a rate limit |
137
+ | `RETRY_BACKOFF_FACTOR` | `1.5` | Exponential backoff multiplier |
138
+ | `DEFAULT_RETRY_DELAY` | `1.0` | Delay before the first retry (seconds) |
139
+
140
+ ## Timeouts and custom HTTPX clients
141
+
142
+ ```python
143
+ import httpx
144
+
145
+ from autom import AutomClient, RequestOptions
146
+
147
+ client = AutomClient(timeout=60) # seconds, default 120, None disables
148
+ client.google_search(query="web scraping api", request_options=RequestOptions(timeout=30))
149
+
150
+ # Bring your own HTTPX client (proxies, limits, event hooks…). You keep ownership of it.
151
+ http_client = httpx.Client(proxy="http://localhost:8080")
152
+ client = AutomClient(http_client=http_client)
153
+ ```
154
+
155
+ ## Endpoints
156
+
157
+ 23 methods, generated from the [OpenAPI document](https://app.autom.dev/openapi).
158
+
159
+ | Method | HTTP | Description |
160
+ | --- | --- | --- |
161
+ | `bing_search()` | GET / POST `/v1/bing/search` | Query Bing Search via API and retrieve structured organic results (title, link, snippet, position). |
162
+ | `brave_images()` | GET / POST `/v1/brave/images` | Search Brave Images via API and retrieve structured image results with pagination and SafeSearch. |
163
+ | `brave_search()` | GET / POST `/v1/brave/search` | Search Brave Search via API and retrieve structured organic results with pagination. |
164
+ | `brave_videos()` | GET / POST `/v1/brave/videos` | Search Brave Videos via API and retrieve structured video results with pagination and SafeSearch. |
165
+ | `duckduckgo_search()` | GET / POST `/v1/duckduckgo/search` | Query DuckDuckGo via API and retrieve structured organic results with region and language. |
166
+ | `finder_google_countries()` | GET `/v1/finder/google-countries` | Search Google countries and retrieve country codes (free Finder endpoint). |
167
+ | `finder_google_languages()` | GET `/v1/finder/google-languages` | Search Google languages and retrieve language codes (free Finder endpoint). |
168
+ | `finder_google_locations()` | GET `/v1/finder/google-locations` | Find supported Google locations and retrieve location IDs and country codes (free endpoint). |
169
+ | `google_images()` | GET / POST `/v1/google/images` | Search Google Images via API and retrieve image results (URLs, titles, sources, dimensions). |
170
+ | `google_jobs()` | GET / POST `/v1/google/jobs` | Scrape Google Jobs results via API and retrieve structured job listings with title, company, location, and pagination. |
171
+ | `google_maps()` | GET / POST `/v1/google/maps` | Search Google Maps via API and retrieve structured place results (address, website, phone). |
172
+ | `google_news()` | GET / POST `/v1/google/news` | Search Google News via API and retrieve structured news results with pagination. |
173
+ | `google_search()` | GET / POST `/v1/google/search` | Scrape Google Search results via API and retrieve structured SERP data with pagination. |
174
+ | `google_search_ai()` | GET / POST `/v1/google/search/ai` | Query Google AI Mode via API. JSON with text_blocks, references, and shopping_results. |
175
+ | `google_search_autocomplete()` | GET / POST `/v1/google/search/autocomplete` | Get Google Search autocomplete suggestions via API for a given query. |
176
+ | `google_search_light()` | GET / POST `/v1/google/search/light` | Scrape lightweight Google Search results via API: fast, cost-efficient, organic results only. |
177
+ | `google_shopping()` | GET / POST `/v1/google/shopping` | Scrape Google Shopping results via API and retrieve structured product listings with prices, ratings, and merchant data. |
178
+ | `google_videos()` | GET / POST `/v1/google/videos` | Search Google Videos via API and retrieve structured video results with metadata. |
179
+ | `jobs()` | GET `/v1/jobs/{id}` | Poll the status, progress (0–100) and result of a job started with is_async=true. Polling is free. Poll until status is terminal: Completed… |
180
+ | `search()` | GET / POST `/v1/search` | One call walks engines in order and returns the first organic results. engines=auto tries Google, then Brave, Bing, DuckDuckGo, Yahoo, and… |
181
+ | `stats()` | GET `/v1/stats` | Infrastructure health for an engine or endpoint over the last hour. Not scoped to your account or tenant. Enabled per account: HTTP 403 mea… |
182
+ | `usage()` | GET `/v1/usage` | Retrieve real-time usage statistics and credit balance for your Autom account. |
183
+ | `yahoo_search()` | GET / POST `/v1/yahoo/search` | Query Yahoo via API and retrieve structured organic results with country and language. |
184
+
185
+ ## License
186
+
187
+ MIT — see [LICENSE](LICENSE).
@@ -0,0 +1,12 @@
1
+ # Examples
2
+
3
+ ```sh
4
+ pip install automdev
5
+ export AUTOM_API_KEY="YOUR_API_KEY"
6
+ python examples/json_response.py
7
+ ```
8
+
9
+ - `json_response.py` — call the featured endpoint and print the JSON result.
10
+ - `async_client.py` — use `AsyncAutomClient`.
11
+ - `any_endpoint.py` — call any path with `request()` and handle API errors.
12
+ - `wait_for_job.py` — start an async job and wait for its result.
@@ -0,0 +1,11 @@
1
+ """Call any path with request() and handle API errors."""
2
+
3
+ from autom import AutomAPIError, AutomClient, JsonResponse
4
+
5
+ with AutomClient() as client: # reads AUTOM_API_KEY
6
+ try:
7
+ response = client.request("GET", "/v1/usage")
8
+ if isinstance(response, JsonResponse):
9
+ print(response.data)
10
+ except AutomAPIError as error:
11
+ print(f"HTTP {error.status}: {error}")
@@ -0,0 +1,14 @@
1
+ """Use the asyncio client."""
2
+
3
+ import asyncio
4
+
5
+ from autom import AsyncAutomClient
6
+
7
+
8
+ async def main() -> None:
9
+ async with AsyncAutomClient() as client: # reads AUTOM_API_KEY
10
+ response = await client.google_search(query="web scraping api")
11
+ print(response.data)
12
+
13
+
14
+ asyncio.run(main())
@@ -0,0 +1,10 @@
1
+ """Call the featured endpoint and print the JSON result."""
2
+
3
+ import json
4
+ import os
5
+
6
+ from autom import AutomClient
7
+
8
+ with AutomClient(os.environ["AUTOM_API_KEY"]) as client:
9
+ response = client.google_search(query="web scraping api")
10
+ print(json.dumps(response.data, indent=2))
@@ -0,0 +1,11 @@
1
+ """Start an async job and wait for its result."""
2
+
3
+ from autom import AutomClient
4
+
5
+ with AutomClient() as client: # reads AUTOM_API_KEY
6
+ submitted = client.google_search(query="web scraping api", is_async=True)
7
+ job = client.wait_for_job(
8
+ submitted.data["job_id"],
9
+ on_progress=lambda j: print(j["status"], j.get("progress")),
10
+ )
11
+ print(job.data)
@@ -0,0 +1,79 @@
1
+ [build-system]
2
+ requires = ["hatchling>=1.26,<2"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "automdev"
7
+ version = "0.1.0"
8
+ description = "Official Python SDK for the Autom SERP API."
9
+ readme = "README.md"
10
+ requires-python = ">=3.11"
11
+ license = "MIT"
12
+ license-files = ["LICENSE"]
13
+ authors = [
14
+ { name = "Autom", email = "contact@autom.dev" },
15
+ ]
16
+ keywords = [
17
+ "serp-api",
18
+ "google-search-api",
19
+ "search-api",
20
+ "seo",
21
+ "api",
22
+ "sdk",
23
+ "autom",
24
+ ]
25
+ classifiers = [
26
+ "Intended Audience :: Developers",
27
+ "Operating System :: OS Independent",
28
+ "Programming Language :: Python :: 3 :: Only",
29
+ "Programming Language :: Python :: 3.11",
30
+ "Programming Language :: Python :: 3.12",
31
+ "Programming Language :: Python :: 3.13",
32
+ "Programming Language :: Python :: 3.14",
33
+ "Topic :: Internet :: WWW/HTTP",
34
+ "Typing :: Typed",
35
+ ]
36
+ dependencies = [
37
+ "httpx>=0.27,<1",
38
+ ]
39
+
40
+ [project.optional-dependencies]
41
+ dev = [
42
+ "build>=1.2,<2",
43
+ "mypy>=1.13",
44
+ "pytest>=8.3",
45
+ "pytest-asyncio>=0.24",
46
+ "ruff>=0.8,<1",
47
+ ]
48
+
49
+ [project.urls]
50
+ Homepage = "https://www.autom.dev"
51
+ Documentation = "https://docs.autom.dev"
52
+ Repository = "https://github.com/automdev/autom-python"
53
+ Issues = "https://github.com/automdev/autom-python/issues"
54
+
55
+ [tool.hatch.build.targets.sdist]
56
+ include = ["/examples", "/src", "/tests", "/LICENSE", "/README.md", "/pyproject.toml"]
57
+
58
+ [tool.hatch.build.targets.wheel]
59
+ packages = ["src/autom"]
60
+
61
+ [tool.mypy]
62
+ python_version = "3.11"
63
+ strict = true
64
+ files = ["src", "tests", "examples"]
65
+
66
+ [tool.pytest.ini_options]
67
+ addopts = "-ra"
68
+ asyncio_mode = "strict"
69
+ asyncio_default_fixture_loop_scope = "function"
70
+ testpaths = ["tests"]
71
+
72
+ [tool.ruff]
73
+ target-version = "py311"
74
+ line-length = 100
75
+ src = ["src", "tests", "examples"]
76
+ extend-exclude = ["*.md"]
77
+
78
+ [tool.ruff.lint]
79
+ select = ["E4", "E7", "E9", "F", "I", "UP", "B"]
@@ -0,0 +1,61 @@
1
+ """Official Python SDK for the Autom API."""
2
+
3
+ from ._endpoints import ENDPOINTS
4
+ from ._version import __version__
5
+ from .client import (
6
+ DEFAULT_BASE_URL,
7
+ DEFAULT_CONCURRENCY,
8
+ DEFAULT_RETRY_DELAY,
9
+ DEFAULT_TIMEOUT,
10
+ MAX_RETRIES,
11
+ RETRY_BACKOFF_FACTOR,
12
+ AsyncAutomClient,
13
+ AutomClient,
14
+ )
15
+ from .errors import (
16
+ AutomAPIError,
17
+ AutomConfigurationError,
18
+ AutomError,
19
+ AutomJobTimeoutError,
20
+ AutomResponseDecodingError,
21
+ AutomSerializationError,
22
+ AutomTransportError,
23
+ )
24
+ from .models import (
25
+ APIResponse,
26
+ BatchResult,
27
+ BinaryResponse,
28
+ EndpointDefinition,
29
+ HTTPMethod,
30
+ JsonResponse,
31
+ RawResponse,
32
+ RequestOptions,
33
+ )
34
+
35
+ __all__ = [
36
+ "APIResponse",
37
+ "AsyncAutomClient",
38
+ "BatchResult",
39
+ "BinaryResponse",
40
+ "DEFAULT_BASE_URL",
41
+ "DEFAULT_CONCURRENCY",
42
+ "DEFAULT_RETRY_DELAY",
43
+ "DEFAULT_TIMEOUT",
44
+ "MAX_RETRIES",
45
+ "RETRY_BACKOFF_FACTOR",
46
+ "ENDPOINTS",
47
+ "EndpointDefinition",
48
+ "HTTPMethod",
49
+ "JsonResponse",
50
+ "RawResponse",
51
+ "RequestOptions",
52
+ "AutomAPIError",
53
+ "AutomClient",
54
+ "AutomConfigurationError",
55
+ "AutomError",
56
+ "AutomJobTimeoutError",
57
+ "AutomResponseDecodingError",
58
+ "AutomSerializationError",
59
+ "AutomTransportError",
60
+ "__version__",
61
+ ]