Metadata-Version: 2.5
Name: ctlogs
Version: 0.1.0
Summary: Zero-dependency Python client for the ctlogs.dev Certificate Transparency API
Project-URL: Homepage, https://ctlogs.dev
Project-URL: Documentation, https://api.ctlogs.dev/
Project-URL: Repository, https://github.com/apps34-oss/ctlogs-python
Author: Apps34
License: MIT
License-File: LICENSE
Keywords: certificate-transparency,certificates,ct-logs,security,ssl,tls,x509
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Security
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# ctlogs

Zero-dependency Python client for the [ctlogs.dev](https://ctlogs.dev)
Certificate Transparency API — search billions of TLS certificates from every
public CT log by domain, organization, serial, SHA-256 fingerprint or public
key (SPKI).

```bash
pip install ctlogs
```

## Quick start (anonymous)

Anonymous access is free and needs no signup (per-IP rate limits apply):

```python
from ctlogs import Ctlogs

ct = Ctlogs()
res = ct.domain("example.com")
for row in res["rows"]:
    print(row["id"], row.get("match"), row.get("not_after"))
```

## With an API key

An API key raises the monthly quota. Request one by email:
**contact@ctlogs.dev** (tell us roughly how many requests per month you need).

```python
ct = Ctlogs(api_key="ctl_...")
```

## Methods

| call | what it finds |
|---|---|
| `ct.domain(host)` | certificates matching the exact hostname |
| `ct.subdomains(host)` | certificates for the host and its subdomains |
| `ct.org(name)` | certificates by subject organization (10 quota units) |
| `ct.serial(hex)` | certificates by serial number |
| `ct.spki(sha256)` | certificates sharing one public key (SPKI SHA-256) |
| `ct.cert(id)` | the full record of one certificate |
| `ct.cert_blob_url(id, kind)` | URL of the raw body (`final.pem`, `final.der`, …) |

Search responses return up to 100 rows plus `has_next` / `next_cursor`.
To walk every page:

```python
for row in ct.search_all("subdomains", "example.com"):
    print(row["id"], row.get("match"))
```

Errors raise `CtlogsError` with `.status` and the decoded `.body`.

## Links

- Web UI: https://ctlogs.dev
- API documentation: https://api.ctlogs.dev/
- Machine-readable summary: https://api.ctlogs.dev/llms.txt

MIT © Apps34
