1

I'm trying to use google images api with PHP, and I'm really not sure what to do.

I have written the following Code

<?php
$url = "https://ajax.googleapis.com/ajax/services/search/images?".
"v=1.0&q=indian%20institue%20of%20techology";
$jk=file_get_contents($url);
$json = json_decode($jk, true);
echo $json["responseData"]["results"][0]["url"];
?>

I wish to find the url of 1st Image from image search. I'm not getting any result when using the script.

Golden_flash
  • 492
  • 1
  • 6
  • 14

1 Answers1

3

Google has retired the image search API, it is no longer available (see this SO thread with alternatives).

If you open up the URL you provided it will say this:

{"responseData": null, "responseDetails": "This API is no longer available.", "responseStatus": 403}
Community
  • 1
  • 1
chrki
  • 6,143
  • 6
  • 35
  • 55