Golden_flash
Golden_flash

Reputation: 492

Google Image search in Php

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.

Upvotes: 1

Views: 9044

Answers (1)

chrki
chrki

Reputation: 6323

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}

Upvotes: 3

Related Questions