JSON API
Base URL: https://qsafe.sh. No key and no signup. The machine-readable spec is at qsafe.sh/openapi.yaml, and every endpoint is in the API reference.
| Endpoint | Scans? | Use it to |
|---|---|---|
GET /api/v1/scan?domain= |
Yes, unless a result under 1 h exists | Get a report |
GET /api/v1/result/{domain} |
Never | Read the latest saved report |
GET /api/v1/history/{domain} |
Never | Chart the last 30 scores |
POST /api/v1/bulk |
Never | Look up up to 50 domains (guide) |
GET /api/v1/fixes[/{stack}] |
Never | Get config fixes (fix guides) |
GET /api/v1/methodology |
Never | Read the scoring rules |
GET /api/v1/leaderboard |
Never | Read the public leaderboard |
Scan a domain
Section titled “Scan a domain”curl -s "https://qsafe.sh/api/v1/scan?domain=example.com"const res = await fetch("https://qsafe.sh/api/v1/scan?domain=example.com");if (res.status === 429) { const wait = Number(res.headers.get("retry-after") ?? 60); throw new Error(`Rate limited, retry in ${wait}s`);}if (!res.ok) throw new Error((await res.json()).detail);const report = await res.json();console.log(report.score, report.label, report.key_exchange.negotiated);import requests
r = requests.get("https://qsafe.sh/api/v1/scan", params={"domain": "example.com"}, timeout=30)if r.status_code == 429: raise SystemExit(f"Rate limited, retry in {r.headers.get('Retry-After')}s")r.raise_for_status()report = r.json()print(report["score"], report["label"], report["key_exchange"]["negotiated"])resp, err := http.Get("https://qsafe.sh/api/v1/scan?domain=example.com")if err != nil { log.Fatal(err) }defer resp.Body.Close()var report struct { Score int `json:"score"` Label string `json:"label"`}json.NewDecoder(resp.Body).Decode(&report)fmt.Println(report.Score, report.Label)A trimmed response:
{ "scan_id": "m4k2x9c1a7", "permalink": "https://qsafe.sh/r/example.com?scan=m4k2x9c1a7", "cached": false, "private": false, "domain": "example.com", "score": 58, "band": "orange", "label": "Not yet", "key_exchange": { "negotiated": "X25519", "post_quantum": false, "pq_groups_supported": [], "prefers_pq": false }, "tls_versions": { "TLS 1.0": false, "TLS 1.1": false, "TLS 1.2": true, "TLS 1.3": true }, "stack": [{ "id": "nginx", "name": "Nginx", "kind": "server", "evidence": ["server: nginx"] }], "findings": [ { "id": "KEX_CLASSICAL_ONLY", "severity": "high", "title": "No post-quantum key exchange", "fix": "Run Nginx on OpenSSL 3.5 or newer. Then make sure the group list includes the hybrid:", "snippet": "ssl_ecdh_curve X25519MLKEM768:X25519:prime256v1;", "snippet_where": "nginx.conf, http or server block", "fix_guide": "nginx" } ]}Every field is described in the Report schema.
Caching and freshness
Section titled “Caching and freshness”- A public result under one hour old is returned instead of scanning (
cached: true). Addfresh=1to force a new scan. private=1results are never reused or listed anywhere, so they always scan.result,history,bulk,fixes,methodologyand badges never scan, so they’re free to call.
Errors
Section titled “Errors”Errors are RFC 9457 problem details:
{ "type": "about:blank", "title": "rate_limited", "status": 429, "detail": "Too many scans from your network. Try again in a minute." }| Status | title |
Meaning |
|---|---|---|
| 400 | bad_request |
The request body isn’t valid JSON or is missing a field. |
| 404 | not_found |
Nothing saved for that domain or scan id, or unknown stack. |
| 422 | invalid_domain, no_dns, private_address |
Not a public hostname we can scan: an IP literal, no A/AAAA records, or it points to a private address. |
| 429 | rate_limited |
A limit was hit. Wait Retry-After seconds. |
| 502 | scanner_error |
The scan didn’t finish, usually a timeout on the target. Try again later. |
Be a good citizen
Section titled “Be a good citizen”- Read saved results with
resultorbulkbefore scanning. - Only scan domains you own or operate, or public sites for research. See the scanner bot page for how site owners can opt out.