Python SDK for the ComplianceLayer security scanning API
Project description
ComplianceLayer Python SDK
Scan any domain for security compliance in seconds. Built for MSPs, DevOps engineers, and anyone who needs to assess domain security posture.
Install
pip install compliancelayer
Quick Start
from compliancelayer import ComplianceLayerClient
client = ComplianceLayerClient(api_key="cl_your_key_here")
# Full scan — runs all 16 security modules, waits for results
result = client.scan("example.com")
print(f"{result['domain']}: {result['grade']} ({result['score']}/100)")
for finding in result.get("findings", []):
print(f" [{finding['severity']}] {finding['finding']}")
Free Scan (No API Key Required)
client = ComplianceLayerClient() # no key needed
result = client.free_scan("example.com")
print(f"Grade: {result['grade']} | Score: {result['score']}/100")
Rate limited to 5 scans/hour. Returns grade + top 3 issues only.
Batch Scanning
Scan hundreds of domains at once:
domains = ["client1.com", "client2.com", "client3.com"]
results = client.batch_scan(domains)
for r in results:
print(f"{r['domain']}: {r['grade']}")
Domain Monitoring
# Add a domain for recurring scans
client.add_domain("important-client.com", monitor=True)
# List monitored domains
for domain in client.domains():
print(f"{domain['domain']}: last scan {domain.get('last_scanned_at', 'never')}")
Compliance Reports
Generate reports formatted for insurance broker submission:
report = client.compliance_report("example.com")
print(f"Compliance status: {report['status']}")
What Gets Scanned
ComplianceLayer runs 16 security modules in under 60 seconds:
| Module | What it checks |
|---|---|
| SSL/TLS | Certificate validity, expiration, chain, protocols |
| DNS | SPF, DMARC, DKIM, DNSSEC, CAA records |
| Headers | HSTS, CSP, X-Frame-Options, CORS, permissions |
| Ports | ~100 common ports for exposure |
| Email Auth | SPF alignment, DMARC enforcement, DKIM signing |
| Blacklists | 35+ blocklist databases |
| Breaches | Known data breach exposure |
| Cookies | Secure/HttpOnly/SameSite flags |
| Subdomains | Subdomain enumeration and exposure |
| Tech Stack | Framework and server fingerprinting |
| WAF | Web Application Firewall detection |
| Reputation | Domain reputation scoring |
| JavaScript | External script audit |
| Trackers | Third-party tracker detection |
| WHOIS | Registration and ownership data |
| Compliance | Insurance-relevant compliance mapping |
Pricing
| Plan | Price | Scans/month | Domains |
|---|---|---|---|
| Free | $0 | 10 | 1 |
| Pro | $99/mo | 1,000 | 50 |
| Enterprise | $499/mo | 5,000 | 200 |
Get your API key at compliancelayer.net
Error Handling
from compliancelayer import ComplianceLayerClient, RateLimitError, AuthenticationError
client = ComplianceLayerClient(api_key="cl_your_key")
try:
result = client.scan("example.com")
except AuthenticationError:
print("Invalid API key")
except RateLimitError as e:
print(f"Rate limited. Retry after {e.retry_after}s")
License
MIT
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file compliancelayer-0.1.0.tar.gz.
File metadata
- Download URL: compliancelayer-0.1.0.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65aee30fbada5d1c4d99622d63b6af8560bdf68c531fbaf06752cd58fa60344e
|
|
| MD5 |
e46ec2156517e4aa2c1d7e38759164c7
|
|
| BLAKE2b-256 |
e61ae8b92cbb03473ea1cb8db7a87883039bb8407ac97d6ddefe4e993337aa84
|
File details
Details for the file compliancelayer-0.1.0-py3-none-any.whl.
File metadata
- Download URL: compliancelayer-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee2c443479b239e910bbf08efe6375ef6704b2c1f83cd41c9e748c969f49b355
|
|
| MD5 |
15b2f9d8a394ff90b6474fe8fdc638aa
|
|
| BLAKE2b-256 |
c019db90c57d1df733b780dfa2fd9a5247247262ffc4ffae82abc22814b2b531
|