Check SSL certificate expiry for any domain

Expired certificates still take sites down, usually on a weekend and usually on a domain someone forgot existed. A daily check that alerts at 21 days is cheap insurance, and it also catches certificates that auto-renewal silently stopped renewing.

Prefer video? · 0:52

Check SSL certificate expiry for any domain

Issuer, validity dates, days until expiry and covered names, so certificates never expire by surprise.

Make the request

Send your API key in the x-api-key header. Free accounts include 1,000 calls a month.

curl -X POST https://apistack.online/api/web/ssl-certificate-checker/v1 \
  -H "x-api-key: $APISTACK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"hostname":"github.com"}'
200 OK · response
{
  "success": true,
  "message": "SSL certificate checked successfully",
  "data": {
    "hostname": "github.com",
    "port": 443,
    "certificate": {
      "commonName": "github.com",
      "subjectAltNames": [
        "github.com",
        "www.github.com"
      ],
      "issuer": {
        "commonName": "Sectigo Public Server Authentication CA DV E36",
        "organization": "Sectigo Limited",
        "country": "GB"
      },
      "validFrom": "2026-09-01T00:00:00.000Z",
      "validTo": "2026-11-29T23:59:59.000Z",
      "daysUntilExpiry": 64,
      "isExpired": false,
      "willExpireSoon": false
    }
  }
}

Response abridged: some fields (timestamps, metadata) omitted.

Run it on a schedule

Loop over your domains once a day (a cron job, GitHub Actions schedule or Vercel Cron) and alert when daysUntilExpiry drops below your threshold. At one call per domain per day, the free plan covers about 30 domains.

Check the names, not just the date

Compare subjectAltNames with the hostnames you actually serve. A renewed certificate that dropped www is a common cause of "works for me" outages.

Give it to your AI agent

The same API is available as an MCP tool. Add APIStack to Claude, Cursor, VS Code or any MCP client:

{
  "mcpServers": {
    "apistack": {
      "url": "https://apistack.online/api/mcp/connect",
      "headers": { "x-api-key": "YOUR_API_KEY" }
    }
  }
}

Then ask: “When does the SSL certificate for github.com expire, and who issued it?” See MCP setup for every client.

Related guides