Google Custom Search for Image Returns 500 Error
Asked Answered
C

2

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.

Collard answered 10/12, 2014 at 21:5 Comment(3)
Same here, called their Google Apps support (Not cloud platform support) with no luck. Couldn't help me or notify the tech team.Bluebeard
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. :-)Harrar
This kind of blatant disregard of this issue by Google is definitely making me reconsider their services and reputation in general. It's embarrassing.Medic
E
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).

Erective answered 11/12, 2014 at 20:51 Comment(0)
M
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

Moriahmoriarty answered 11/9, 2018 at 4:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.