muratbasci
muratbasci

Reputation: 31

Google Custom Search (CSE) API returns error code 500 ({"error": {"code": 500, "message": null } })

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

Upvotes: 3

Views: 4331

Answers (3)

dyd
dyd

Reputation: 54

If account is expired error is again 500

Upvotes: 0

emrys57
emrys57

Reputation: 6806

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.

Upvotes: 0

Timo Saloranta
Timo Saloranta

Reputation: 160

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! :)

Upvotes: 3

Related Questions