8

Started about 40 hours ago, Google Custom Search when used for image search (searchType=image) always returns 500 error. I have double checked with the APIs documentation and there seems to be no change. This is affecting quite a lot of people as you can see in this forum.

https://productforums.google.com/forum/#!category-topic/customsearch/troubleshooting-and-bugs/4bJPzGPLYfw

This is all I get back in the response:

{
   "error": {
       "code": 500,
       "message": null
   }
}

I have tried calling Google, but they just kept redirecting me to the website where there is absolutely no information relating to this.

Has anyone managed to get this to work or have spoken to a person at Google? We are heavily using this feature and it's very costly to have it down for this long.

juminoz
  • 3,168
  • 7
  • 35
  • 52
  • 1
    Same here, called their Google Apps support (Not cloud platform support) with no luck. Couldn't help me or notify the tech team. – bentzy Dec 11 '14 at 07:47
  • As fate would have it I just started to teach myself about the API. Was pulling my hair out for the last 45 minutes until I came across this post. At least I know it wasn't "me" now. :-) – Glenn Snyder Dec 11 '14 at 19:45
  • This kind of blatant disregard of this issue by Google is definitely making me reconsider their services and reputation in general. It's embarrassing. – kangax Dec 12 '14 at 00:55

2 Answers2

1

We worked around it by removing the searchType=image, and changing the code to traverse the json. The code change below conveys the idea:

from:

$.each(response.items, function(index, item) {
      images.push(item.link);
  });

to:

  $.each(response.items, function(index, item) {
    if ((item.pagemap) && (item.pagemap.cse_image) && (item.pagemap.cse_image[0]) && (item.pagemap.cse_image[0].src)) {
      images.push(item.pagemap.cse_image[0].src);
    }
  });

Hope that helps.

Ps: Not cool, Google, not cool.

EDIT: The above workaround probably isn't what you're searching for since Google Custom Search (CSE) for Images is working again (was out for around 3 days, back on +/- 12/12/2014).

0

The solution is simple. You just need to go in the control panel and make sure that "image search" option is active.

enter image description here