Your code is working pretty fine.
As you can see the image.. Google have blocked the request from your IP
address as it detected unusual traffic activity.
You can always check the HTTP Status Code what your requesting URL gives
echo $http_status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
If everything is normal , you would get a
else you will get some other status code.
Here are the most common HTTP Status Codes..