I would like to know if it\'s possible to check if URL is indexed by Google using PHP.
Is this against their ToS?
To do so without an API is against the TOS. For low volume, you can:
// CHECK IF PAGE IS IN GOOGLE INDEX
$domain = 'stackexchange.com';
if (strstr(file_get_contents("http://www.google.com/search?q=site:$domain"), 'did not match any documents')) {
// Page is not in the index
print 'No Go!';
}
else {
print 'All Good!';
}
exit;