Simple HTTP API · PEM and full chain

ssl.ee API

Fetch a certificate PEM or the full chain served by a server with a single curl command. The API uses exactly the same data sources and selection logic as the website.

01Endpoints

Method & path Returns Description
GET /pem?d=<domain>text/plainPEM of the single (currently active) leaf certificate
GET /chain?d=<domain>text/plainFull chain: leaf → intermediates → root
GET /history?d=<domain>application/jsonIssuance history from crt.sh (CORS-friendly)
GET /?d=<domain>application/jsonBoth PEMs with metadata
GET /application/jsonEndpoint listing (documentation)
GET /healthapplication/jsonSimple health check

02curl examples

Certificate PEM only
curl "https://ssl.ee/api/pem?d=wikipedia.org"
Full chain only
curl "https://ssl.ee/api/chain?d=wikipedia.org"
Save PEM straight to a file
curl -o wikipedia.pem "https://ssl.ee/api/pem?d=wikipedia.org"
openssl x509 -in wikipedia.pem -noout -subject -dates
Structured JSON response
curl "https://ssl.ee/api/chain?d=wikipedia.org&format=json" | jq .count
Issuance history
curl "https://ssl.ee/api/history?d=wikipedia.org" | jq '.count, .rows[0]'
Everything at once (JSON)
curl "https://ssl.ee/api/?d=wikipedia.org" | jq '{certificate, chainCount}'

03Parameters

ParameterRequiredDescription
dyesDomain name. Also accepts https://… prefixes and subdomains. Example: wikipedia.org.
formatnoAdd format=json to receive a JSON object with metadata instead of a raw PEM. Defaults to text/plain.

04Responses & errors

The PEM response is text/plain and ends with a newline — ready for openssl or saving as a .pem file. JSON responses always include an ok field.

If the domain starts with www. and no PEM is found, the pem_not_found error message includes a hint to retry the same domain without the www prefix.

StatusCodeMeaning
200okRequest succeeded
400invalid_domainMissing d parameter or invalid domain
404pem_not_foundNo PEM data available for this domain
404unknown_endpointUnknown path — see GET /
405method_not_allowedOnly GET and OPTIONS are supported
502chain_unavailableTrustico API did not return a chain
502crtsh_unavailablecrt.sh history request failed
502upstream_errorUpstream request failed (e.g. timeout)

05Data sources & notes

The single certificate PEM comes from Certificate Transparency logs (Cert Spotter) and is set to the currently valid leaf certificate. The full chain comes from Trustico SSL Tools and shows exactly the certificates the server is serving right now — it may differ from the leaf found in CT logs.

Issuance history comes from crt.sh and is also available on the website through this Worker – avoiding the crt.sh CORS restriction in the browser.

Responses include Access-Control-Allow-Origin: * and Cache-Control: public, max-age=3600. No API key is required. To restrict usage, add your own authentication check to the Worker.