I use an API to get Whois data of a domain
Sample response from API:
For domain 1:
registrant_contact":{
"full_name": "WHOISGUARD PROTECTED",
"company_name": "WHOISGUARD, INC.",
}
For domain 2:
"registrant_contact":{
"full_name": "Whois Privacy Protection Service by onamae.com",
"company_name": "Whois Privacy Protection Service by onamae.com",
}
registrant_contact.full_name may vary depending on the provider
Is there an easy or programmatic way to determine if domain has WHOIS privacy?
Thanks!
Whois Privacy is not a standard service. This is offered by multiple companies, including registrars themselves, with varying degree of service and features.
It can also be done on the registry level in some cases, specially in ccTLDs for individuals.
So, besides listing all specific text strings you can get back, I do not see a solution to your problem, except some heuristics (like the form of email addresses or postal addresses, etc.)
See this other answer for some heuristics: https://stackoverflow.com/a/25233555/6368697