IP2Whois.com has an API for getting WHOIS data at https://www.ip2whois.com/developers-api. Perhaps, you can consider adding that API into your code.