Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The problem is that <code>tbs</code> query parameter only applies to a regular image search on Google. For example, if you wanted to search for cat pictures with a square aspect ratio, you could do a search like this:</p> <p><a href="http://images.google.com/?q=cat&amp;tbs=iar:s" rel="noreferrer">http://images.google.com/?q=cat&amp;tbs=iar:s</a></p> <p>But the Custom Search API uses a completely different set of parameters. The full list of supported parameters is shown in the <a href="https://developers.google.com/custom-search/v1/using_rest#query-params" rel="noreferrer">REST documentation</a>.</p> <p>Some of the tbs queries do have equivalents. For example:</p> <ul> <li><code>tbs=ic:gray</code> translates to <code>imgColorType=gray</code></li> <li><code>tbs=isz:m</code> translates to <code>imgSize=medium</code></li> <li><code>tbs=itp:clipart</code> translates to <code>imgType=clipart</code></li> </ul> <p>But sadly there appears to be no equivalent for the <code>iar</code> aspect ratio filter. I tried guessing a few queries (things like <code>imgAspectRatio=square</code>) in case there was an undocumented parameter, but didn't have any luck with that.</p> <p>The best alternative I could suggest is using <code>imgSize=icon</code>. This tends to return images that have a square aspect ratio, but with the unfortunate side effect that the images also tend to be rather small (the largest size I've seen returned is 256x256). Depending on your needs though, this may be good enough.</p> <p>I apologise if this isn't particularly useful to you. I'm not just trying to grab the bounty on this question, so feel free not to vote this answer up. I just wanted to let you know what I had found in case it was of some help.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload