Skip to main content
POST

Overview

GitHub Leaks scans a public repository for exposed secrets - API keys, tokens, private keys, and other credentials committed to the code. It returns each finding with its location, a masked preview, a severity, and a stable fingerprint, so you can triage and track leaks over time. Billing is outcome-based: you pay 1 credit per leak found. A clean scan, a refused scan, and a repeat of a repository state you already paid for are all free.
Scanning is always asynchronous. A new scan returns 202 with status: "processing", then you poll GET /api/lookup/breaches/github/{scan_id} for the findings. Only a request that reuses an already-completed scan of the same repository state returns 200 with findings inline. See Run a scan.

Authentication

Requires an API key in the Authorization header.

Request

string
required
The repository to scan. Must be an https://github.com/... repository URL with no embedded credentials.
integer
default:"0"
Detection profile: 0 (default) runs the standard detector, 1 runs the alternate detector, 2 runs both in parallel and merges findings by location.
object
Optional scan tuning.

Example request

Response

Returns the {success, result, message} envelope. A scan with zero findings is a success, not an error.
boolean
Whether the request was accepted.
string
A sentence written for your end user.
object
The scan outcome.

Run a scan

1

Start the scan

POST /api/lookup/breaches/github returns 202 with a scan_id and status: "processing". If an identical scan of the same repository state already completed, you get 200 with the findings inline and reused: true.
2

Poll for the result

Call GET /api/lookup/breaches/github/{scan_id} until status is succeeded or failed. Re-reads never re-scan and never charge again.
3

Triage the findings

Store each fingerprint and pass known ones back as config.baseline_fingerprints on the next scan to suppress them.
string
Filter the stored findings by minimum severity (critical, high, medium, low). This filters what is returned - it never re-scans and never charges again.
Completion also pushes a realtime event. See Webhooks & events.

Errors

Errors use the same envelope: {"success": false, "result": {"code": "..."}, "message": "..."}.

Credits

You pay 1 credit per leak found. A clean scan (zero leaks), a refused or failed scan, and a repeat of a repository state and configuration you already paid for are all free. Settlement happens when the scan completes, so a 202 always reports credits: 0. See Credits.
Known issue: Public repositories, including https://github.com/octocat/Hello-World, can return 404 with the message That repository doesn't exist or isn't public. Check the URL and try again.