{
  "openapi": "3.1.1",
  "info": {
    "title": "Certificate Transparency Explorer API",
    "version": "1.0.0",
    "summary": "Every logged certificate for a domain: history, issuers, subdomains, wildcards and expiry.",
    "description": "Every endpoint performs the same calculation as the human page and returns inputs, result, units, assumptions, sources, warnings and computedAt. MCP endpoint: /mcp."
  },
  "servers": [
    {
      "url": "https://certificatetransparencyexplorer.usefulweb.site"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "Every logged certificate for a domain: history, issuers, subdomains, wildcards and expiry.",
        "description": "Searches Certificate Transparency logs (via crt.sh) for a domain and its subdomains, de-duplicates precertificates, and shows the issuance timeline, which CAs issued over time, subdomains discovered from SANs, wildcard usage, names whose certificates are expiring or expired, and a graph of certificates and the names they cover.\n\nMethodology:\n- Live: crt.sh JSON search for the exact domain and (optionally) %.domain, which matches every name below it; both queries run in parallel with a 20 s timeout.\n- Precertificates and final certificates share issuer + serial number and are merged into one certificate; names come from the common name and SAN list.\n- Per name: first/last issuance and the latest expiry over all certificates. A name is \"expiring\" when its newest certificate expires within the chosen window and no later certificate has been logged yet.\n- Issuers are grouped by the issuer organisation (O=) per year of notBefore. \"Other domains\" are names on the same certificates outside the searched domain (naive last-two-labels grouping).\n- The graph shows the latest 14 certificates and their names (capped at ~60 nodes).",
        "tags": [
          "infrastructure"
        ],
        "x-mcp-tool": "certificate_transparency_explorer",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CertificateTransparencyExplorerInput"
              },
              "examples": {
                "example1": {
                  "summary": "Pasted crt.sh results for example.net",
                  "value": {
                    "mode": "pasted",
                    "domain": "example.net",
                    "expiringWithinDays": 30,
                    "pasted": "[{\"issuer_ca_id\":432477,\"issuer_name\":\"C=US, O=Let's Encrypt, CN=YR2\",\"common_name\":\"www.example.net\",\"name_value\":\"example.net\\nwww.example.net\",\"id\":29441194038,\"not_before\":\"2026-08-31T23:14:22\",\"not_after\":\"2026-11-29T23:14:21\",\"serial_number\":\"05394f07b853bc55043a45be26fcc01e7d10\"},{\"issuer_ca_id\":432477,\"issuer_name\":\"C=US, O=Let's Encrypt, CN=YR2\",\"common_name\":\"www.example.net\",\"name_value\":\"example.net\\nwww.example.net\",\"id\":29750973274,\"not_before\":\"2026-08-31T23:14:22\",\"not_after\":\"2026-11-29T23:14:21\",\"serial_number\":\"05394f07b853bc55043a45be26fcc01e7d10\"},{\"issuer_ca_id\":432476,\"issuer_name\":\"C=US, O=Let's Encrypt, CN=YR1\",\"common_name\":\"memo.example.net\",\"name_value\":\"memo.example.net\",\"id\":28975558547,\"not_before\":\"2026-08-20T22:27:54\",\"not_after\":\"2026-11-18T22:27:53\",\"serial_number\":\"0554fec7bbaa27fd29acf1bd736e4ad55adc\"},{\"issuer_ca_id\":413868,\"issuer_name\":\"C=US, O=SSL Corporation, CN=Cloudflare TLS Issuing ECC CA 3\",\"common_name\":\"example.net\",\"name_value\":\"*.example.net\\nexample.net\",\"id\":27000000001,\"not_before\":\"2026-07-20T10:00:00\",\"not_after\":\"2026-10-18T10:00:00\",\"serial_number\":\"0ffbc4fba7b8b237ecfda4bf0719133f\"},{\"issuer_ca_id\":432477,\"issuer_name\":\"C=US, O=Let's Encrypt, CN=YR2\",\"common_name\":\"www.example.net\",\"name_value\":\"example.net\\nwww.example.net\",\"id\":27653267941,\"not_before\":\"2026-07-02T22:25:03\",\"not_after\":\"2026-09-30T22:25:02\",\"serial_number\":\"05caf9fdeb36a0076ab7c98d1553a4e1\"},{\"issuer_ca_id\":183267,\"issuer_name\":\"C=US, O=Let's Encrypt, CN=R3\",\"common_name\":\"old-shop.example.net\",\"name_value\":\"old-shop.example.net\\nshop.partner-store.example\",\"id\":9000000001,\"not_before\":\"2023-03-01T08:00:00\",\"not_after\":\"2023-05-30T08:00:00\",\"serial_number\":\"03aa11bb22cc33dd44ee55ff66778899aabb\"},{\"issuer_ca_id\":1449,\"issuer_name\":\"C=US, O=DigiCert Inc, CN=DigiCert TLS RSA SHA256 2020 CA1\",\"common_name\":\"example.net\",\"name_value\":\"example.net\\nwww.example.net\",\"id\":5000000001,\"not_before\":\"2021-12-10T00:00:00\",\"not_after\":\"2023-01-10T23:59:59\",\"serial_number\":\"0a1b2c3d4e5f60718293a4b5c6d7e8f9\"}]"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CertificateTransparencyExplorerResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tool": {
      "get": {
        "operationId": "getToolDefinition",
        "summary": "Inputs, output schema and examples for this tool",
        "responses": {
          "200": {
            "description": "Tool definition.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Problem": {
        "type": "object",
        "description": "RFC 9457 problem details. 422 responses include per-field `errors`.",
        "required": [
          "type",
          "title",
          "status",
          "detail"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "field",
                "message"
              ],
              "properties": {
                "field": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "CertificateTransparencyExplorerInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "mode": {
            "title": "Mode",
            "type": "string",
            "enum": [
              "live",
              "pasted"
            ],
            "default": "live"
          },
          "domain": {
            "title": "Domain",
            "description": "Also used in pasted mode to tell subdomains from other domains.",
            "type": "string",
            "maxLength": 253
          },
          "includeSubdomains": {
            "title": "Include subdomains (%.domain, slower)",
            "type": "boolean",
            "default": true
          },
          "expiringWithinDays": {
            "title": "Warn when a name expires within",
            "type": "integer",
            "minimum": 1,
            "maximum": 365,
            "default": 30,
            "x-unit": "days"
          },
          "pasted": {
            "title": "crt.sh JSON",
            "description": "Pasted mode: the JSON array from https://crt.sh/?q=example.com&output=json",
            "type": "string",
            "maxLength": 200000
          }
        },
        "required": []
      },
      "CertificateTransparencyExplorerResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "domain",
              "counts",
              "certificates",
              "names",
              "subdomains",
              "wildcards",
              "relatedDomains",
              "issuers",
              "issuersOverTime",
              "findings"
            ],
            "properties": {
              "domain": {
                "type": "string"
              },
              "counts": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "certificates",
                  "valid",
                  "expiring",
                  "expired",
                  "wildcardCertificates"
                ],
                "properties": {
                  "certificates": {
                    "type": "integer"
                  },
                  "valid": {
                    "type": "integer"
                  },
                  "expiring": {
                    "type": "integer"
                  },
                  "expired": {
                    "type": "integer"
                  },
                  "wildcardCertificates": {
                    "type": "integer"
                  }
                }
              },
              "certificates": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "serial",
                    "crtShIds",
                    "issuer",
                    "issuerOrg",
                    "names",
                    "notBefore",
                    "notAfter",
                    "validityDays",
                    "wildcard",
                    "state"
                  ],
                  "properties": {
                    "serial": {
                      "type": "string"
                    },
                    "crtShIds": {
                      "type": "array",
                      "items": {
                        "type": "integer"
                      }
                    },
                    "issuer": {
                      "type": "string"
                    },
                    "issuerOrg": {
                      "type": "string"
                    },
                    "names": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "notBefore": {
                      "type": "string"
                    },
                    "notAfter": {
                      "type": "string"
                    },
                    "validityDays": {
                      "type": "integer"
                    },
                    "wildcard": {
                      "type": "boolean"
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "valid",
                        "expiring",
                        "expired",
                        "not-yet-valid"
                      ]
                    }
                  }
                }
              },
              "names": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "name",
                    "inDomain",
                    "wildcard",
                    "firstSeen",
                    "lastSeen",
                    "latestExpiry",
                    "certificates",
                    "issuers",
                    "coverage"
                  ],
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "inDomain": {
                      "type": "boolean"
                    },
                    "wildcard": {
                      "type": "boolean"
                    },
                    "firstSeen": {
                      "type": "string"
                    },
                    "lastSeen": {
                      "type": "string"
                    },
                    "latestExpiry": {
                      "type": "string"
                    },
                    "certificates": {
                      "type": "integer"
                    },
                    "issuers": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "coverage": {
                      "type": "string",
                      "enum": [
                        "covered",
                        "expiring",
                        "expired"
                      ]
                    }
                  }
                }
              },
              "subdomains": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "name",
                    "inDomain",
                    "wildcard",
                    "firstSeen",
                    "lastSeen",
                    "latestExpiry",
                    "certificates",
                    "issuers",
                    "coverage"
                  ],
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "inDomain": {
                      "type": "boolean"
                    },
                    "wildcard": {
                      "type": "boolean"
                    },
                    "firstSeen": {
                      "type": "string"
                    },
                    "lastSeen": {
                      "type": "string"
                    },
                    "latestExpiry": {
                      "type": "string"
                    },
                    "certificates": {
                      "type": "integer"
                    },
                    "issuers": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "coverage": {
                      "type": "string",
                      "enum": [
                        "covered",
                        "expiring",
                        "expired"
                      ]
                    }
                  }
                }
              },
              "wildcards": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "name",
                    "inDomain",
                    "wildcard",
                    "firstSeen",
                    "lastSeen",
                    "latestExpiry",
                    "certificates",
                    "issuers",
                    "coverage"
                  ],
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "inDomain": {
                      "type": "boolean"
                    },
                    "wildcard": {
                      "type": "boolean"
                    },
                    "firstSeen": {
                      "type": "string"
                    },
                    "lastSeen": {
                      "type": "string"
                    },
                    "latestExpiry": {
                      "type": "string"
                    },
                    "certificates": {
                      "type": "integer"
                    },
                    "issuers": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "coverage": {
                      "type": "string",
                      "enum": [
                        "covered",
                        "expiring",
                        "expired"
                      ]
                    }
                  }
                }
              },
              "relatedDomains": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "issuers": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "issuer",
                    "certificates",
                    "firstIssued",
                    "lastIssued"
                  ],
                  "properties": {
                    "issuer": {
                      "type": "string"
                    },
                    "certificates": {
                      "type": "integer"
                    },
                    "firstIssued": {
                      "type": "string"
                    },
                    "lastIssued": {
                      "type": "string"
                    }
                  }
                }
              },
              "issuersOverTime": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "year",
                    "issuers"
                  ],
                  "properties": {
                    "year": {
                      "type": "string"
                    },
                    "issuers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "issuer",
                          "count"
                        ],
                        "properties": {
                          "issuer": {
                            "type": "string"
                          },
                          "count": {
                            "type": "integer"
                          }
                        }
                      }
                    }
                  }
                }
              },
              "findings": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "severity",
                    "area",
                    "finding"
                  ],
                  "properties": {
                    "severity": {
                      "type": "string",
                      "enum": [
                        "high",
                        "medium",
                        "low",
                        "info"
                      ]
                    },
                    "area": {
                      "type": "string"
                    },
                    "finding": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    }
  }
}