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.
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With