The official Python API client for urlscan.io
Project description
urlscan-python
The official Python API client for urlscan.io.
Requirements
- Python 3.10+
Installation
pip install urlscan-python
Quickstart
Start by importing urlscan
module
>>> import urlscan
Create a client with your API key:
>>> client = urlscan.Client("<your_api_key>")
Scan a URL:
>>> res = client.scan("<url>", visibility="public")
>>> uuid: str = res["uuid"]
Wait for a scan result:
>>> client.wait_for_result(uuid)
Get a scan result:
>>> result = client.get_result(uuid)
Bulk scan:
>>> client.bulk_scan(["<url>", "<url>"], visibility="public")
Alternatively, you can use _and_get_result(s)
suffixed methods to do scan, wait and get at once.
>>> client.scan_and_get_result("<url>", visibility="public")
>>> client.bulk_scan_and_get_results(["<url>", "<url>"], visibility="public")
urlscan.Client.search()
returns an iterator to iterate search results:
>>> for result in client.search("page.domain:example.com"):
>>> print(result["_id"])
Examples
See Examples.
References
Help Wanted?
Please feel free to to open an issue if you find a bug or some feature that you want to see implemented.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file urlscan_python-0.0.1.tar.gz
.
File metadata
- Download URL: urlscan_python-0.0.1.tar.gz
- Upload date:
- Size: 65.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
dfdfdfdb2179f5c9552fff5d8d78da2f0acf02095d416327a3b04deba10aeac8
|
|
MD5 |
df378830fb8105f14f24e6eb0483fa4b
|
|
BLAKE2b-256 |
bc91af9f2900563fa2f0a402216357017fbed37ab6b7fd5d3bdc415835b57274
|
Provenance
The following attestation bundles were made for urlscan_python-0.0.1.tar.gz
:
Publisher:
publish.yml
on urlscan/urlscan-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
urlscan_python-0.0.1.tar.gz
-
Subject digest:
dfdfdfdb2179f5c9552fff5d8d78da2f0acf02095d416327a3b04deba10aeac8
- Sigstore transparency entry: 211314582
- Sigstore integration time:
-
Permalink:
urlscan/urlscan-python@26a0b45f13efa7ab27c926e6a306dc5180613c20
-
Branch / Tag:
refs/tags/v0.0.1
- Owner: https://github.com/urlscan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
publish.yml@26a0b45f13efa7ab27c926e6a306dc5180613c20
-
Trigger Event:
release
-
Statement type:
File details
Details for the file urlscan_python-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: urlscan_python-0.0.1-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
5773d4d2a7bf67747b07790451949be5a06747c3f3853e608e1a63dfcf65fa8b
|
|
MD5 |
f4ee820407dcb633f8b5d7fcddc23def
|
|
BLAKE2b-256 |
7e637ed936bbc794c3aa5156d8b545f8cbb3e85269b6b746c82f92ad1717c982
|
Provenance
The following attestation bundles were made for urlscan_python-0.0.1-py3-none-any.whl
:
Publisher:
publish.yml
on urlscan/urlscan-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
urlscan_python-0.0.1-py3-none-any.whl
-
Subject digest:
5773d4d2a7bf67747b07790451949be5a06747c3f3853e608e1a63dfcf65fa8b
- Sigstore transparency entry: 211314588
- Sigstore integration time:
-
Permalink:
urlscan/urlscan-python@26a0b45f13efa7ab27c926e6a306dc5180613c20
-
Branch / Tag:
refs/tags/v0.0.1
- Owner: https://github.com/urlscan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
publish.yml@26a0b45f13efa7ab27c926e6a306dc5180613c20
-
Trigger Event:
release
-
Statement type: