urlquery-api 0.8.0__py3-none-any.whl

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.
urlquery_api/py.typed ADDED
File without changes
@@ -0,0 +1,109 @@
1
+ Metadata-Version: 2.5
2
+ Name: urlquery-api
3
+ Version: 0.8.0
4
+ Summary: Python client for the urlquery v2 API: URL analysis reports, search, reputation, Host Profile, YARA and monitoring
5
+ Project-URL: Homepage, https://urlquery.net
6
+ Project-URL: Documentation, https://docs.urlquery.net/docs/libraries/python
7
+ Project-URL: Source, https://github.com/urlquery/urlquery-api-python
8
+ Project-URL: Issues, https://github.com/urlquery/urlquery-api-python/issues
9
+ Author-email: "urlquery.net" <contact@urlquery.net>
10
+ License-Expression: MIT
11
+ License-File: LICENSE
12
+ Keywords: phishing,sandbox,threat intelligence,url analysis,urlquery,yara
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Intended Audience :: Information Technology
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Topic :: Security
18
+ Classifier: Typing :: Typed
19
+ Requires-Python: >=3.10
20
+ Requires-Dist: httpx>=0.27
21
+ Requires-Dist: pydantic>=2.7
22
+ Provides-Extra: test
23
+ Requires-Dist: pytest>=8; extra == 'test'
24
+ Description-Content-Type: text/markdown
25
+
26
+ # urlquery-api-python
27
+
28
+ [![PyPI](https://img.shields.io/pypi/v/urlquery-api)](https://pypi.org/project/urlquery-api/)
29
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue)](LICENSE)
30
+
31
+ The Python client for the [urlquery](https://urlquery.net) v2 API. urlquery
32
+ analyzes URLs in an isolated browser and records what they do: redirects,
33
+ HTTP traffic, scripts, downloads, detections and a screenshot.
34
+
35
+ With this package you can submit URLs and wait for the reports, read and
36
+ compare reports, search a year of reports, look up reputation, explore Host
37
+ Profile, and manage YARA rules, watchlists and page monitors. Results are
38
+ typed [pydantic](https://docs.pydantic.dev) models.
39
+
40
+ **Documentation: <https://docs.urlquery.net/docs/libraries/python>**
41
+
42
+ ## Install
43
+
44
+ ```sh
45
+ pip install urlquery-api
46
+ ```
47
+
48
+ It needs Python 3.10 or later, and an API key from your
49
+ [urlquery.net](https://urlquery.net) account.
50
+
51
+ ## Example
52
+
53
+ ```python
54
+ from urlquery_api import Client
55
+
56
+ with Client() as client: # the API key from URLQUERY_APIKEY
57
+ # Analyze a URL as a restricted report and wait for it.
58
+ s = client.submit("https://example.com/login", access="restricted", wait=True)
59
+
60
+ # The full report: every HTTP transaction, script and artifact.
61
+ report = client.report(s.report_id)
62
+ for t in report.http:
63
+ print(t.response.status_code, t.url.addr)
64
+
65
+ # Every other report that loaded the same scripts.
66
+ for script in report.javascript.script:
67
+ for hit in client.iter_search_results(f"javascript.script.sha256:{script.sha256}"):
68
+ print(script.sha256[:12], hit.report_id, hit.url.addr)
69
+ ```
70
+
71
+ ## How it behaves
72
+
73
+ - **Typed results.** The models in `urlquery_api.models` are generated from
74
+ the API's [OpenAPI description](https://docs.urlquery.net/openapi/public-v2.yaml),
75
+ so every field of every response, down to the report's transactions,
76
+ scripts and artifacts, is typed.
77
+ - **Paging.** Each list method returns one page; its `iter_…` method yields
78
+ every item, following cursors for you.
79
+ - **Rate limits and retries.** A call waits out a rate limit for its
80
+ `Retry-After`, and a GET is retried after a server error or a network
81
+ failure; `max_retry_wait` bounds the waiting. Submissions are never retried
82
+ once they may have been queued.
83
+ - **Waiting for an analysis.** `submit(..., wait=True)` and
84
+ `wait_for_submission` poll until the analysis is done or has failed; on a
85
+ timeout, `WaitTimeoutError.submission` is the last state, with the queue and
86
+ report IDs.
87
+ - **Errors.** API errors raise `APIError` with the API's error `code`, such as
88
+ `NOT_FOUND` or `RATE_LIMIT_EXCEEDED`.
89
+ - **Hostile content.** Report content comes from the analyzed sites: treat
90
+ titles, scripts and downloads as untrusted data.
91
+
92
+ ## Contributing
93
+
94
+ Report bugs and ask for features in the
95
+ [issues](https://github.com/urlquery/urlquery-api-python/issues). Pull requests
96
+ are welcome: this repository is published from urlquery's main repository, so
97
+ an accepted change is applied there and arrives here with the next release.
98
+ `src/urlquery_api/models.py` is generated from the API description; don't
99
+ edit it by hand. For other questions, write to
100
+ [contact@urlquery.net](mailto:contact@urlquery.net).
101
+
102
+ ```sh
103
+ pip install -e '.[test]'
104
+ pytest
105
+ ```
106
+
107
+ ## License
108
+
109
+ MIT © [urlquery.net](https://urlquery.net), see [LICENSE](LICENSE).
@@ -0,0 +1,9 @@
1
+ urlquery_api/__init__.py,sha256=mjD0ESLhuswcbdNsLpqQb7KsoOOB3wRCyuHN7SQ1Iks,971
2
+ urlquery_api/_client.py,sha256=he-tgJxATMQC3Q4qPAxJ7WNVxK76vfDhwdaqnyNam8k,29265
3
+ urlquery_api/_errors.py,sha256=9MYRvc0W-rmiruQwSFgqgusSVZ6i8lECL5Qx7rC4psA,1625
4
+ urlquery_api/models.py,sha256=iincx6UZ4MDb2k-zDGke1MW3blDc9fmFSvKtKlxJlRg,44585
5
+ urlquery_api/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ urlquery_api-0.8.0.dist-info/METADATA,sha256=e9o9rgr8wBRiIScCoJFM8NqATy5TldI79AhDZJ26UO8,4384
7
+ urlquery_api-0.8.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
8
+ urlquery_api-0.8.0.dist-info/licenses/LICENSE,sha256=-9fSQlIu-7LePGnXyExU0GommRT_KxmtXlVnlf6CvJA,1069
9
+ urlquery_api-0.8.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.33.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 urlquery.net
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.