Retrieve just the latest certificate

229 views
Skip to first unread message

Brian Orpin

unread,
Mar 31, 2021, 5:40:54 PM3/31/21
to crt.sh
Is it possible to retrieve just the latest certificate for a domain?

Where the renewal has occurred before the expiry of the previous certificate, you obviously get both.

I'm looking at pulling the response into HomeAssistant so I get a dashboard of my Certificates and when they are due for renewal.  The JSON output is great and I can post process it, but if it was available via the API that would be even better.

Ethan Wang

unread,
Mar 31, 2021, 10:56:25 PM3/31/21
to crt.sh
Add exclude=expired in query parameters
eg. https://crt.sh/?CN={}&exclude=expired

Brian Orpin

unread,
Apr 1, 2021, 12:24:18 AM4/1/21
to crt.sh
That doesn't work as I'm getting multiple values for a domain as I did a couple of forced renewals to test.

r...@sectigo.com

unread,
Apr 6, 2021, 8:51:49 AM4/6/21
to crt.sh
Hi Brian.  You'll need to either post-process the response or execute your own custom SQL query directly.

Brian Orpin

unread,
Apr 6, 2021, 10:49:31 AM4/6/21
to crt.sh
Ok thanks. Just checking I was not missing something from the API.
Reply all
Reply to author
Forward
0 new messages