We offer a free and simple API endpoint to grab all the hostnames for a domain based on the certificate transparency logs: https://ctl.shodan.io/
Sample Python code available in the Shodan book: https://book.shodan.io/developer-apis/certificate-transparency/