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/plain | PEM of the single (currently active) leaf certificate |
GET /chain?d=<domain> | text/plain | Full chain: leaf → intermediates → root |
GET /history?d=<domain> | application/json | Issuance history from crt.sh (CORS-friendly) |
GET /?d=<domain> | application/json | Both PEMs with metadata |
GET / | application/json | Endpoint listing (documentation) |
GET /health | application/json | Simple health check |
02curl examples
curl "https://ssl.ee/api/pem?d=wikipedia.org"
curl "https://ssl.ee/api/chain?d=wikipedia.org"
curl -o wikipedia.pem "https://ssl.ee/api/pem?d=wikipedia.org"
openssl x509 -in wikipedia.pem -noout -subject -dates
curl "https://ssl.ee/api/chain?d=wikipedia.org&format=json" | jq .count
curl "https://ssl.ee/api/history?d=wikipedia.org" | jq '.count, .rows[0]'
curl "https://ssl.ee/api/?d=wikipedia.org" | jq '{certificate, chainCount}'
03Parameters
| Parameter | Required | Description |
|---|---|---|
d | yes | Domain name. Also accepts https://… prefixes and subdomains. Example: wikipedia.org. |
format | no | Add 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.
| Status | Code | Meaning |
|---|---|---|
| 200 | ok | Request succeeded |
| 400 | invalid_domain | Missing d parameter or invalid domain |
| 404 | pem_not_found | No PEM data available for this domain |
| 404 | unknown_endpoint | Unknown path — see GET / |
| 405 | method_not_allowed | Only GET and OPTIONS are supported |
| 502 | chain_unavailable | Trustico API did not return a chain |
| 502 | crtsh_unavailable | crt.sh history request failed |
| 502 | upstream_error | Upstream 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.