Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

urlscan_python-0.0.1.tar.gz (65.6 kB view details)

Uploaded Source

Built Distribution

urlscan_python-0.0.1-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

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

Hashes for urlscan_python-0.0.1.tar.gz
Algorithm Hash digest
SHA256 dfdfdfdb2179f5c9552fff5d8d78da2f0acf02095d416327a3b04deba10aeac8
MD5 df378830fb8105f14f24e6eb0483fa4b
BLAKE2b-256 bc91af9f2900563fa2f0a402216357017fbed37ab6b7fd5d3bdc415835b57274

See more details on using hashes here.

Provenance

The following attestation bundles were made for urlscan_python-0.0.1.tar.gz:

Publisher: publish.yml on urlscan/urlscan-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for urlscan_python-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5773d4d2a7bf67747b07790451949be5a06747c3f3853e608e1a63dfcf65fa8b
MD5 f4ee820407dcb633f8b5d7fcddc23def
BLAKE2b-256 7e637ed936bbc794c3aa5156d8b545f8cbb3e85269b6b746c82f92ad1717c982

See more details on using hashes here.

Provenance

The following attestation bundles were made for urlscan_python-0.0.1-py3-none-any.whl:

Publisher: publish.yml on urlscan/urlscan-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page