Question

I am very much new to Google search API.I need to bring search results to my Java client from specific websites.As a part I created a free Google search-engine api and received cx code.But I tried this url over browser:

"http://www.google.com/search?start=0&num=10&q=red+sox&cr=countryIN&client=google-csbe&output=xml_no_dtd&cx=00*******************:****-l****8";

But what I get is:

<GSP VER="3.2">
<ERROR>403</ERROR>
<TM>0.061511</TM>
<Q>red sox</Q>
<PARAM name="start" value="0" original_value="0" url_escaped_value="0" js_escaped_value="0"/>
<PARAM name="num" value="10" original_value="10" url_escaped_value="10" js_escaped_value="10"/>
.
.
.

I'm using free version ,I have not exceeded free usage limit. I crosschecked cx codes and are perfect. As I goto this url:https://www.google.com:443/cse/publicurl?cx=00**************:****-l****8 I'm getting a good search bar where I get search results from prescribed sites. Do I require any authentication even while checking with url?Could anyone help with this?

Was it helpful?

Solution

Solved: Apart from creating a search engine we also need to create custom search engine CSE/GSS JSON API. By registering over there we get an api key. Using both these api key and cx codes we need to build our request url accordingly. The output would be in JSON format.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top