Professional Documents
Culture Documents
Setup Tab: Enable Image Search Option
Setup Tab: Enable Image Search Option
button
Now Use this code to get images ( thumb & full url )
<html>
<head>
<title>JSON/Atom Custom Search API Example</title>
</head>
<body>
<div id="content"></div>
<script>
function hndlr(response) {
Object.keys(response).forEach(function (key) {
console.log(response[key]);
});
for (var i = 0; i < response.items.length; i++) {
var item = response.items[i];
// in production code, item.htmlTitle should have the HTML entities
escaped.
//document.getElementById("content").innerHTML += "<img
src="+item.link+" />" ;
var thumbnailLink = item.image.thumbnailLink ;
var FullImagelLink = item.link ;
document.getElementById("content").innerHTML += "<img src="+
thumbnailLink+" />" ;
}
}
</script>
<script src="https://www.googleapis.com/customsearch/v1?
key=AIzaSyAGxspFSKOT3cmFNUfFW4N8463rXJjHZek&cx=00907672
2715317521305:pgtgbitiq5w&q=nature&searchType=image&a
mp;callback=hndlr">
</script>
</body>
</html>