title: Google custom search for images only
body: <p>Since <a href="http://code.google.com/apis/imagesearch/">Google image search API</a> is deprecated, one should use <a href="http://www.google.com/cse/">Google custom search API</a> for this.</p>
  
  <p>I've made a small example using it. My problem is I want to return google image search results <strong>only</strong>. Whereby this shows web results, and the user may switch to the image result. <strong>How can I show only the image results by default?</strong></p>
  
  <pre><code>&lt;div id="cse" style="width: 100%;"&gt;Loading&lt;/div&gt;
  &lt;script src="http://www.google.com/jsapi" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
    google.load('search', '1', {language : 'hu'});
    google.setOnLoadCallback(function() {
      var customSearchOptions = {
          enableImageSearch: true,
          imageSearchOptions: {
                layout: google.search.ImageSearch.LAYOUT_CLASSIC
          }
      };
  
      var options = new google.search.DrawOptions();
      options.setAutoComplete(true);
  
      var customSearchControl = new google.search.CustomSearchControl('XXX', customSearchOptions);
  
      customSearchControl.setResultSetSize(google.search.Search.LARGE_RESULTSET);
      customSearchControl.setAutoCompletionId('XXX');
  
      customSearchControl.draw('cse', options);
    }, true);
  &lt;/script&gt;
  &lt;link rel="stylesheet" href="http://www.google.com/cse/style/look/default.css" type="text/css" /&gt;
  </code></pre>
  
  <p>The API documentation is quite poor, it only describes how to add additional results.</p>