Filtering Google Images and Google Videos results
Introduction
Similarly to regular Google Search and Google News, Google Images and Video also have multiple filtering options to help users find the results they are looking for. In this blog post, we will try to cover most of them with live examples from our APIs.
Common filtering options
Several filtering options work for both Google Images and Google Videos APIs. Those include:
safe
parameter to exclude explicit contentnfpr
parameter to force Google to show results even when the spelling is considered incorrectfilter
parameter if you don't want Google to exclude or omit similar or duplicate results
The in-depth explanation for each of the mentioned parameters is linked above, as they were covered in the previous blog post about filtering options in Google Search and Google News APIs. You can also test them using our Playground, where you can choose both Google Images and Google Videos APIs.
Using tbs
parameter to display certain results
While we already covered how to set the date using the tbs
parameter in the Google Search and Google News APIs filtering blog, it's the same in Google Images and Google Videos. We will focus on the different values of the tbs
parameter to get certain results.
Google Videos tbs
values
You can filter Google Videos in many ways. Below you can find a couple of them. Please note that Google evolves dynamically, and while writing this blog post, those values are relevant; they might not be in the future if Google decides so.
Google allows filtering videos by duration. Specifically, there are three video durations that you can set for your search:
- Short (0-4 min) with the
tbs=dur:s
parameter - Medium (4-20 min) with the
tbs=dur:m
parameter - Long (20+ min) with the
tbs=dur:l
parameter
On top of the duration filter, you can search for high-quality videos or videos with closed captions. Below you can find examples from our Playground with the correct tbs
parameter used for each:
There is one more filter for Google Videos: the source filter. However, using it is more complex, as the tbs
values are encrypted for each website. The easiest way to get the results from a specific source is to go to search with Google Videos and copy the tbs
value from the URL once the correct source is set:
Below you can find a couple of examples with the most popular sources. You can use them as a reference for your API calls with Google Videos API or find the value for another source using the abovementioned method.
- Videos with YouTube as a source
- Videos with Instagram as a source
- Videos with Twitter as a source
- Videos with Facebook as a source
- Videos with TikTok as a source
- Videos with Twitch as a source
Google Images tbs
values
Just like with Google Videos, you can filter Google Images with the tbs
filter in various ways. Below you will find examples of valid tbs
values.
The first filter I'd like to discuss is the size filter. It's commonly used with Google Images, and you can set it generally with small, medium, and large images, but you can also set specific sizes:
- Icon-sized images with the
tbs=isz:i
parameter - Medium images with the
tbs=isz:m
parameter - Large images with the
tbs=isz:l
parameter - Images larger than 400x300 with the
isz:lt,islt:qsvga
parameter - Images larger than 640×480 with the
isz:lt,islt:vga
parameter - Images larger than 800×600 with the
isz:lt,islt:svga
parameter - Images larger than 1024×768 with the
isz:lt,islt:xga
parameter - Images larger than 2 MP with the
isz:lt,islt:2mp
parameter - Images larger than 4 MP with the
isz:lt,islt:4mp
parameter - Images larger than 8 MP with the
isz:lt,islt:8mp
parameter
Another filter you can use is color. You can set your tbs
parameter to only search images with a certain color theme or with transparent background:
- Images in full color with the
tbs=ic:color
parameter - Black and white images with the
tbs=ic:gray
parameter - Images with transparent backgrounds with the
tbs=ic:trans
parameter - Images in specific colors with the
tbs=ic:specific,isc:X
, where the X is the color you'd like to use for filtering (e.g., red, yellow, blue). The red color was used in this example.
The next filter we're going to discuss is the Type. You can search for specific kinds of images, including GIFs, Clip art, and more. As always, please refer to the examples below to learn more about how to use those filters with SerpApi:
- Clip art-type images with the
tbs=itp:clipart
parameter - Line Drawing-type images with the
tbs=itp:lineart
parameter - GIF-type images with the
tbs=itp:animated
parameter - Images focused on the face with the
tbs=itp:face
parameter - Photos with the
tbs=itp:photo
parameter
The last type of the tbs
parameter specific to Google Images is Use Rights. There are two options you can choose from; Creative Common Licenses and Commercial & other licenses:
- Images with the Creative Common Licenses with the
tbs=sur:cl
parameter - Images with Commercial & other licenses with the
tbs=sur:ol
parameter
While we discussed examples with each of the tbs
parameters used alone, you can combine multiple options in one if you'd like to filter results more narrowly. For example, you can search for blue Football GIFs with Commercial & other licenses.
Using the chips
parameter with Google Images
While tbs
parameter allows you to filter results to your needs, you can also use the chips
parameter to search images within specific categories:
No list specifies values for all categories, and the easiest way to find categories for your search is to make an API call with SerpApi and see in the JSON response what values are available under the suggested_searches
block:
Below you can find a couple of examples from our Playground:
Conclusion
As mentioned before, we already discussed tbs
values for Time filters in the Google Search and Google News blog post. If you notice that some filters are not covered by this blog post, please contact us at contact@serpapi.com or report the issue yourself on our Public Roadmap.
Check our Tips and Tricks blog post
Use the Playground to test our APIs
Join us on Twitter | YouTube