Skip to main content

Cloudflare URL Scanner PY-SDK

Python SDK for the Cloudflare URL Scanner API. It provides a simple way to interact with the API and scan URLs for malware, phishing, and more. To better understand Internet usage around the world, use Cloudflare’s URL Scanner. With Cloudflare’s URL Scanner, you have the ability to investigate the details of a domain, IP, URL, or ASN. Cloudflare’s URL Scanner is available in the Security Center of the Cloudflare dashboard, Cloudflare Radar and the Cloudflare API.

Read more about the Cloudflare URL Scanner API here.

[!NOTE] This SDK is not an official Cloudflare product.

[!NOTE] By default, the report will have a Public visibility level, which means it will appear in the recent scans list and in search results. It will also include a single screenshot with desktop resolution.

Features

  • Scan a URL
  • Get the scan result
  • Search for a scan by hostname
  • Search for a scan by UUID
  • Many more
  • Async support

Installation

From pip:

pip install cloudflarescan

From github:

python -m pip install -U git+https://github.com/alexraskin/cloudflare-url-scan

From source:

git clone
cd cloudflare-url-scan
python -m pip install .

Usage

To make your first URL scan using the API, you must obtain a URL Scanner specific API token. Create a Custom Token with Account > URL Scanner in the Permissions group, and select Edit as the access level.

from cloudflare_scan import UrlScannerClient


cf_client = Client(
    cloudflare_api_key="", #or set the environment variable CLOUDFLARE_API_KEY
    cloudflare_account_id="", #or set the environment variable CLOUDFLARE_ACCOUNT_ID
)

# Scan a URL
scan = cf_client.scan("example.com")

# Get the scan result
result = scan.result

# Get the UUID of the scan
uuid = scan.uuid

# Get the screenshot of the scan
screenshot = cf_client.get_screen_shots(uuid, resolution="desktop")

# Get the HAR file of the scan
har = cf_client.get_har(uuid)

# Get the scan by UUID
scan = cf_client.get_scan(uuid)

Async Usage

from cloudflare_scan import AsyncClient
import asyncio

cf_client = AsyncClient(
    cloudflare_api_key="",
    cloudflare_account_id=""
    )

async def main():
    scan = await cf_client.scan("https://www.google.com")
    print(scan.result)
    print(scan.json)

asyncio.run(main())

License

MIT License [LICENSE]

Metadata

Release files for cloudflarescan 0.5.0

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

Source distribution (sdist)

Source distribution for cloudflarescan 0.5.0
File Size Uploaded Provenance
cloudflarescan-0.5.0.tar.gz 8.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cloudflarescan 0.5.0
File Interpreter ABI Platform
cloudflarescan-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.7 kB

Release files / cloudflarescan-0.5.0.tar.gz

Download URL cloudflarescan-0.5.0.tar.gz
Size 8.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ff535b445421424cbf30e2eea123bc82ce9ac0602006da89e2b7c213ed7e9d59
BLAKE2b-256 checksum
How to use checksums
91c5fa38ab31f893c1b766a428d372937141eee78d5e514d2854b34c407937be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.8

Release files / cloudflarescan-0.5.0-py3-none-any.whl

Download URL cloudflarescan-0.5.0-py3-none-any.whl
Size 8.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
634c6750501d757e02a867ee1fbdcf226788c41f4fb70d9bda0f61f0a0ac35ba
BLAKE2b-256 checksum
How to use checksums
3a394b546571e3722186320c7d219e7bdba6c68d9042ca2c758a3a2964b5d2c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.8

Security for cloudflarescan 0.5.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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