title: Getting more than 10 results by Google Custom Search API V1 in Java
body: <p>I am using Google Custom Search API in Java to get results of Google in response to a query. I have written this code with the help of other posts, code is as follows:</p>
  
  <pre><code>    url = new URL("https://www.googleapis.com/customsearch/v1?key="+key+ "&amp;cx="+ cx +"&amp;q="+    searchText+"&amp;alt=json"+"&amp;start="+0+"&amp;num="+30);
      HttpURLConnection conn2 = (HttpURLConnection) url.openConnection();
      System.out.println("Connection opened!");
      conn2.setRequestMethod("GET");
      conn2.setRequestProperty("Accept", "application/json");
      BufferedReader br = new BufferedReader(new InputStreamReader(
      (conn2.getInputStream())));
  </code></pre>
  
  <p>The problem is that whenever I am using the above code without num and start parameters it is executing properly, but giving only top 10 results. So I have used num and start parameters. But they are creating problems. Here I cannot understand where to put the <b>num</b> and <b>start</b> parameters in the url. It is always giving HTTP 400 i.e. Bad Request. I have read the Documentation page, there also no clear instruction is given about where to put these two parameters in Url. </p>
  
  <p>So if anyone helps me to solve this problem I will be really grateful. Thank you.</p>