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:
"snippet": "photo of flower",
"htmlSnippet": "photo of \u003cb\u003eflower\u003c/b\u003e",
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