3

I use Google Custom Search API. url example;

https://www.googleapis.com/customsearch/v1?key=Api_Key&cx=Client_ID&q=Search_Keyword&alt=json&sort=date-sdate:d&lr=lang_tr&cr=countryTR

This url working correctly a year, but return error code 500 since last week. What is the reason for this error. Any one can help me?

note: There are no invoices outstanding

1
  • OP notes "There are no invoices outstanding" which hints at it, but I'll say it explicitly for posterity: It appears if your account is overdue, you will also get the 500-null response. Commented May 9, 2014 at 15:36

3 Answers 3

3

We were also confronted by this problem. It seems that Google has changed its custom search API a bit on 2013-03-06.

We used to have the cx ID point to Google Custom Search API project ID. That no longer works and now gives this unhelpful 500 Internal Server Error response:

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

Based on our tests, here is how you can solve the problem:

  1. create a new CSE engine at http://www.google.com/cse/all.
  2. configure it: enable image search, check to use the whole web, if needed
  3. click Search Engine ID button under search engine's Setup section. The new search engine ID is in form [~15 numbers]:[~10 letters and numbers] (e.g. 09238519823059291357:vsdoijv7svdkij7).
  4. Use this search engine ID as the cx parameter in API queries and it should work.

I hope this helps! :)

Sign up to request clarification or add additional context in comments.

Comments

0

Old question, but, for the record: I had this same result when I had a bug which created a $ character as a parameter separator in the URL, instead of an &. So, it appears that a malformed query can also result in this error being returned.

Comments

0

If account is expired error is again 500

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.