Image results now available from the Custom Search API

FEB 14, 2012
Author Photo
By Nam Nguyen, Software Engineer

Last year we added image results to Google Custom Search Engines to enable sites to offer image-only results that showcase photos and other digital images. For site owners who want more flexibility in presentation, they are also now available from the Custom Search API.

Read more about accessing Image Results from the Custom Search API or try it out in the Custom Search API Explorer. For billing purposes, image queries will be treated the same as web queries. If you are still using the deprecated Google Image Search API, now’s a great time to switch!

Below is an example of an image search to find small jpeg images of flowers:

With a valid key and cse id, here is a possible json result returned for an image item:
"kind": "customsearch#result",
"title": "flower-photo",
"htmlTitle": "\u003cb\u003eflower\u003c/b\u003e-photo",
"link": "",
"displayLink": "",
"snippet": "photo of flower",
"htmlSnippet": "photo of \u003cb\u003eflower\u003c/b\u003e",
"mime": "image/jpeg",
"image": {
"contextLink": "",
"height": 100,
"width": 100,
"byteSize": 6104,
"thumbnailLink": "",
"thumbnailHeight": 82,
"thumbnailWidth": 82

which you can use to render the image in your own site.

Note that you need to enable image search in your custom search engine control panel for the custom image search to work.

Nam Nguyen works on the JSON/Atom Custom Search API, which lets developers retrieve and display results from Google Custom Search programmatically. He is dedicated to making developers' lives a little easier by providing a simple API.

Posted by Scott Knaster, Editor