# Certificate and CSR decoder API

Paste a certificate, a bundle or a CSR and read every field in plain words.

`POST /v1/decode`

- Price: Free; any API key works and nothing is charged. What you paste is processed in memory and never stored.
- Cache: Never cached; every call runs again.
- MCP tool: `decode_certificate`

The decoded fields of pasted certificates and CSRs, and how a bundle chains; nothing is stored. Free; any API key works and nothing is charged. What you paste is processed in memory and never stored. Never cached; every call runs again.

## Request body

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `pem` | string or null | no | One or more PEM blocks, or base64 DER. Processed in memory and never stored. |
| `file_base64` | string or null | no | A .pem, .crt, .cer, .der, .csr or .p7b file, base64-encoded. Send either this or the pasted text. |

## Response

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `tool` | string | yes |  |
| `target` | string | yes |  |
| `status` | "ok" | "partial" | "error" | yes |  |
| `fetched_at` | string | no |  |
| `cached` | boolean | no |  |
| `credits_used` | integer | no | Credits this call took from your balance. 0 for free tools, for a replay of an earlier call, and for a free check run on the website without signing in |
| `summary` | string | yes |  |
| `score` | integer or null | no |  |
| `findings` | array of object | no |  |
| `credits_remaining` | integer | yes | Your balance after this call. It can be below zero after a refund; free tools still work then |
| `data` | object | yes | This tool's result |
| `data.items` | array of any | yes |  |
| `data.chain` | object or null | yes |  |

## Errors

- `400` Invalid domain, URL or parameter, a TLD this tool can't check, or an X-Request-Id already used for another call (`invalid_domain`, `invalid_url`, `invalid_request`, `unsupported_tld`)
- `401` Missing, unknown or revoked API key, or one whose creator is no longer a member of the account (`unauthorized`)
- `403` Account suspended, the key's creator is over the plan's seats, or an anonymous check without a valid proof-of-work or for a tool that needs an account, or bulk checks before a first purchase (`account_suspended`, `plan_limit`, `challenge_required`, `sign_in_required`, `bulk_locked`)
- `429` Too many requests, today's free checks are used up, or too many website scans at once; wait for the number of seconds in the Retry-After header (`rate_limited`, `free_limit_reached`, `too_many_jobs`). Not charged
- `500` Unexpected error (`internal_error`)

## Example

```sh
curl -X POST "https://api.dnssuper.com/v1/decode" \
  -H "Authorization: Bearer $DNSSUPER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

```python
import os

import httpx

client = httpx.Client(
    base_url="https://api.dnssuper.com",
    headers={"Authorization": f"Bearer {os.environ['DNSSUPER_API_KEY']}"},
    timeout=60,
)
response = client.post("/v1/decode", json={})
response.raise_for_status()
result = response.json()
print(result["summary"], result["credits_used"])
```

```ts
const response = await fetch("https://api.dnssuper.com/v1/decode", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.DNSSUPER_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({}),
});
if (!response.ok) throw new Error((await response.json()).error.message);
const result = await response.json();
console.log(result.summary, result.credits_used);
```

Example response:

```json
{
  "tool": "certificate-decoder",
  "target": "",
  "status": "ok",
  "fetched_at": "2026-11-14T10:00:00Z",
  "cached": false,
  "credits_used": 0,
  "summary": "Decoded 2 certificates, a chain from www.example.com to DNS Super Test Intermediate CA (test only). The leaf is valid until 2027-01-13 (60 days left).",
  "findings": [
    {
      "id": "cert.chain_ends_at_intermediate",
      "severity": "info",
      "title": "The bundle stops at an intermediate certificate",
      "detail": "The last one is Certificate 2 (DNS Super Test Intermediate CA (test only)).",
      "fix": "Nothing to do; servers send intermediates and browsers hold the roots."
    }
  ],
  "data": {
    "items": [
      {
        "kind": "certificate",
        "index": 0,
        "subject": "CN=www.example.com,C=US",
        "issuer": "CN=DNS Super Test Intermediate CA (test only),O=DNS Super Test CA,C=US",
        "common_name": "www.example.com",
        "serial_hex": "94eda",
        "not_before": "2026-10-15T10:00:00Z",
        "not_after": "2027-01-13T10:00:00Z",
        "days_left": 60,
        "validity_days": 90,
        "names": {
          "dns": [
            "www.example.com",
            "example.com"
          ],
          "ip": [],
          "email": [],
          "uri": []
        },
        "key": {
          "type": "EC",
          "bits": 256,
          "curve": "secp256r1"
        },
        "signature_algorithm": "ecdsa-with-SHA256",
        "signature_hash": "sha256",
        "key_usage": [
          "digital_signature"
        ],
        "extended_key_usage": [
          "serverAuth"
        ],
        "ca": false,
        "self_signed": false,
        "ski": "cfe98736bcaebd1495f33f41d182c0151045e9ef",
        "aki": "6d357e494219368ded233f6b98714d8928adda72",
        "ocsp": [
          "http://ocsp.example.net"
        ],
        "ca_issuers": [
          "http://ca.example.net/int.der"
        ],
        "crl": [
          "http://crl.example.net/int.crl"
        ],
        "policies": {
          "oids": [
            "2.23.140.1.2.1"
          ],
          "validation": "dv"
        },
        "scts": [],
        "sha256": "63bb912fc10e362b1805d4b4efee0926584df227e1849ea77a904170599887fc",
        "sha1": "a8050d9d36fc92bc4d63f212813dd9bd492d9d84",
        "version": 3
      },
      {
        "kind": "certificate",
        "index": 1,
        "subject": "CN=DNS Super Test Intermediate CA (test only),O=DNS Super Test CA,C=US",
        "issuer": "CN=DNS Super Test Root CA (test only),O=DNS Super Test CA,C=US",
        "common_name": "DNS Super Test Intermediate CA (test only)",
        "serial_hex": "61000002",
        "not_before": "2025-01-01T00:00:00Z",
        "not_after": "2035-01-01T00:00:00Z",
        "days_left": 2969,
        "validity_days": 3652,
        "names": {
          "dns": [],
          "ip": [],
          "email": [],
          "uri": []
        },
        "key": {
          "type": "EC",
          "bits": 256,
          "curve": "secp256r1"
        },
        "signature_algorithm": "ecdsa-with-SHA256",
        "signature_hash": "sha256",
        "key_usage": [
          "digital_signature",
          "key_cert_sign",
          "crl_sign"
        ],
        "extended_key_usage": [],
        "ca": true,
        "path_length": 0,
        "self_signed": false,
        "ski": "6d357e494219368ded233f6b98714d8928adda72",
        "aki": "c32274e65effd21a4d19b814c57dd1efa069bb98",
        "ocsp": [],
        "ca_issuers": [],
        "crl": [],
        "policies": {
          "oids": []
        },
        "scts": [],
        "sha256": "fe671c6e0ee515625f0a900b95c424604620df9d934d6b24ce2b7082d6df7252",
        "sha1": "3ad381dd72466b080d75302211d2d48bacc09cbe",
        "version": 3
      }
    ],
    "chain": {
      "order": [
        0,
        1
      ],
      "links": [
        {
          "child": 0,
          "parent": 1,
          "signed": true
        }
      ],
      "ends_at": "intermediate",
      "reordered": false
    }
  },
  "credits_remaining": 498
}
```

## MCP

```json
{
  "tool": "decode_certificate",
  "arguments": {}
}
```

```text
Decoded 2 certificates, a chain from www.example.com to DNS Super Test Intermediate CA (test only). The leaf is valid until 2027-01-13 (60 days left).
Certificate 1: www.example.com, issued by DNS Super Test Intermediate CA (test only), valid until 2027-01-13 (60 days left); EC 256; 2 names
Certificate 2: DNS Super Test Intermediate CA (test only) (CA), issued by DNS Super Test Root CA (test only), valid until 2035-01-01 (2969 days left); EC 256
Chain: 1 > 2, ends at an intermediate
- info: The bundle stops at an intermediate certificate
Free | checked 2026-11-14 10:00 UTC
```
