Google Custom Search “Popular Queries” BAD REQUEST ERROR

In Google CSE, when I attempt to get Popular Queries, I'm getting this error in the FireBug Console:

NetworkError: 400 Bad Request - http://www.google.com/cse/api/xxxxxxxxx:xxxxxxx/cse/xxxxxxx/queries/js?callback=(new+PopularQueryRenderer(document.getElementById(%27queries%27))).render .... .. ..

Why is it happening? I just simply copy/paste the code from Google:

<html>
<head>
</head>
<body>
    <!-- CODE COPIED FROM GOOGLE : START -->
    <div id="queries"></div>
    <script src="http://www.google.com/cse/query_renderer.js"></script>
    <script src="http://www.google.com/cse/api/XXXX184908680XXXX:xxxxywrndxx/cse/xxxtywrnxxx/queries/js?callback=(new+PopularQueryRenderer(document.getElementById('queries'))).render"></script>
    <!-- CODE COPIED FROM GOOGLE : END -->
</bodY>
</html>

Answers:

Answer

I just figured this out, at least for me. The code Google gives you is wrong. They give you the URL:

http://www.google.com/cse/api/USERID:CSEID/cse/CSEID/queries/js?…

This puts the CSEID in twice. I was able to get it working by removing the first instance of the colon and the CSEID:

http://www.google.com/cse/api/USERID/cse/CSEID/queries/js

I'm not surprised they got confused: they use the term User Id to refer to the User string, but they use the term CSE Id to refer to both the portion after the colon and the combined User Id + colon + CSE Id.

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.