Skip to main content

urlscan-python

PyPI version

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:

with urlscan.Client("<your_api_key>") as client:
    ...

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"])

Pro

Use Pro class to interact with the pro API endpoints:

from urlscan import Pro

with Pro("<your_api_key>") as client:
    res = client.livescan.scan("<url>", scanner_id="us01")
    resource_id: str = res["uuid"]
    result = client.livescan.get_resource(scanner_id="us01", resource_id=resource_id, resource_type="result")

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.

Metadata

Release files for urlscan-python 2026.7.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for urlscan-python 2026.7.7
File Size Uploaded Provenance
urlscan_python-2026.7.7.tar.gz 112.2 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for urlscan-python 2026.7.7
File Interpreter ABI Platform
urlscan_python-2026.7.7-py3-none-any.whl Python 3 none any Details

Total release size: 139.2 kB

Release files / urlscan_python-2026.7.7.tar.gz

Download URL urlscan_python-2026.7.7.tar.gz
Size 112.2 kB
Tags Source
SHA-256 checksum
How to use checksums
16082649858afd31f15c6658d85814ea4e44c1a76d929925167b83a42d0476e9
BLAKE2b-256 checksum
How to use checksums
c943a6a4318a0c3cc9116f14f358e80abb982508244f9c6a6cf629e621a2ba33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 7, 2026.

Transparency log

Release files / urlscan_python-2026.7.7-py3-none-any.whl

Download URL urlscan_python-2026.7.7-py3-none-any.whl
Size 26.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
acd22e1167d802deb11a879fc89e57d620c9b8c767fa07797a393c6cf41c505b
BLAKE2b-256 checksum
How to use checksums
c936d60a78d7c71c1082e3c52a5949a1569b7c69e225343ffb9a0a2441cd34dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 7, 2026.

Transparency log

Security for urlscan-python 2026.7.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for urlscan_python-2026.7.7.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 7, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page