> ## Content Index
> Fetch the complete content index at: https://serpapi.com/blog/llms.txt
> Use this file to discover other available public pages before exploring further.

# Filtering Google Shopping results
- URL: https://serpapi.com/blog/filtering-google-shopping-results/
- Published: 2023-06-30T14:46:55.000Z
- Updated: 2023-11-17T10:20:05.000Z
- Description: In this blog post, you will learn how to use filters in SerpApi's Google Shopping API correctly!
- Author: Bartek Marmolowski
- Tags: Tips&Tricks

## Introduction

Despite utilizing the same `tbs` parameter as Google Search, News, Images, and Videos, Google Shopping filters are more dynamic, and the values change depending on your search query. In this blog post, we'll go through many possible filters and how to find and use them.

## Sorting results to your liking

There are four different ways you can sort your results in Google Shopping. All four of them are constant, and the values are as below:

![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/2023/06/image-29.png)

Sorting options in Google Shopping

- [Sort results by relevance with the tbs=p\_ord:r parameter.](https://serpapi.com/playground?engine=google%5Fshopping&q=Coffee&tbs=tbs%3Dp%5Ford%3Ar) [This is the default sorting with Google Shopping API, so you don't need to provide it.](https://serpapi.com/playground?engine=google%5Fshopping&q=Coffee)
- [Sort results by the review score with the tbs=p\_ord:rv parameter.](https://serpapi.com/playground?engine=google%5Fshopping&q=Coffee&tbs=p%5Ford%3Arv)
- [Sort results by the price, from lowest to highest, with the tbs=p\_ord:p parameter.](https://serpapi.com/playground?engine=google%5Fshopping&q=Coffee&tbs=p%5Ford%3Ap)
- [Sort results by the price, from highest to lowest, with the tbs=p\_ord:pd parameter.](https://serpapi.com/playground?engine=google%5Fshopping&q=Coffee&tbs=p%5Ford%3Ap)

## Dynamic filters in Google Shopping

While sorting filters are the same, no matter the query, the other parameters may vary depending on what you are looking for. We will discuss how to find those filters with Google Shopping API and use them correctly. Please remember that some filters are the same for each search, and only values are dynamic, while others may be totally specific to a given keyword.

### Finding available filters for your query

There are two easy ways to find filters available for your search. The first one, recommended, is by running your search query with all parameters and checking the JSON response for the [filters](https://serpapi.com/shopping-filters-results) block, like in the example below:

![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/2023/06/image-31.png)

Filters present in the JSON response

You can then grab the filters you need and use them in the following query to get the results you are looking for.

The second way is to run your query directly through Google Shopping, apply appropriate filters, and check the URL for the `tbs` value. An example can be seen below:

![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/2023/06/image-32.png)

`tbs` value for specific filters

While the method is up to you, we strongly recommend the first one, as it's more efficient if you are looking for all the filters for a given query. With the second method, you must perform multiple searches to extract all available filters. With the first method, you only need to make one API call with our Google Shopping API.

### The *`Show only`* and *`Price`* filters

Those two filters will likely be available for most of your searches. The values may change, but the filter itself should still be available. 

We'll use the default `Coffee` keyword to discuss examples, but you can adjust your parameters and check available filters, as explained above.

For the `Show only` filter, there are three options available for our query. Below you can find examples with the proper `tbs` values for each:

![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/2023/06/image-33.png)

Show only filters

- [Buy on Google with the tbs=mr:1,buy:g parameter](https://serpapi.com/playground?engine=google%5Fshopping&q=Coffee&tbs=mr%3A1%2Cbuy%3Ag)
- [On sale with the tbs=mr:1,sales:1 parameter](https://serpapi.com/playground?engine=google%5Fshopping&q=Coffee&tbs=mr%3A1%2Csales%3A1)
- [Available nearby with the tbs=mr:1,local\_avail:1 parameter](https://serpapi.com/playground?engine=google%5Fshopping&q=Coffee&location=Austin%2C+TX%2C+Texas%2C+United+States&gl=us&hl=en&tbs=mr%3A1%2Clocal%5Favail%3A1)
- [You can even use all of those filters at once with the tbs=mr:1,local\_avail:1,ss:55,sales:1,buy:g parameter](https://serpapi.com/playground?engine=google%5Fshopping&q=Coffee&location=Austin%2C+TX%2C+Texas%2C+United+States&gl=us&hl=en&tbs=mr%3A1%2Clocal%5Favail%3A1%2Css%3A55%2Csales%3A1%2Cbuy%3Ag)

The `Price` filter can be used to specify the price ranges for your search or to set the minimum or maximum price. The price ranges are always constructed with the `tbs=mr:1,price:1,ppr_min:X,ppr_max:Y` parameter, where the X value is the minimum price, and the Y value is the maximum price. If you want to set only minimum or maximum value, you can just drop the `ppr_max:Y` or `ppr_min:X` parts from the tbs parameter.

![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/2023/06/image-34.png)

Price filters

- [Up to $10 with the tbs=mr:1,price:1,ppr\_max:10 parameter](https://serpapi.com/playground?engine=google%5Fshopping&q=Coffee&location=Austin%2C+TX%2C+Texas%2C+United+States&gl=us&hl=en&tbs=mr%3A1%2Cprice%3A1%2Cppr%5Fmax%3A10)
- [$10 - $100 with the tbs=mr:1,price:1,ppr\_min:10,ppr\_max:100 parameter](https://serpapi.com/playground?engine=google%5Fshopping&q=Coffee&location=Austin%2C+TX%2C+Texas%2C+United+States&gl=us&hl=en&tbs=mr%3A1%2Cprice%3A1%2Cppr%5Fmin%3A10%2Cppr%5Fmax%3A100)
- [Over $100 with the tbs=mr:1,price:1,ppr\_min:100 parameter](https://serpapi.com/playground?engine=google%5Fshopping&q=Coffee&location=Austin%2C+TX%2C+Texas%2C+United+States&gl=us&hl=en&tbs=mr%3A1%2Cprice%3A1%2Cppr%5Fmin%3A100)

### Using query-dependent dynamic filters

As mentioned above, some filters are only available for specific keywords. For example, for the `q=Coffee`, you can find `Flavor`, `Container Type` or `Roast` among filters. While those are available for the `Coffee` search, they will be different for queries like `Playstation` or `Football`.

![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/2023/06/image-35.png)

Example filters for `Coffee`query

These filters, even though they change from query to query, are used the same way as the ones mentioned above. Below you can find a couple of examples:

- [Medium roast with the tbs=mr:1,pdtr0:973849|973851 parameter](https://serpapi.com/playground?engine=google%5Fshopping&q=Coffee&location=Austin%2C+TX%2C+Texas%2C+United+States&gl=us&hl=en&tbs=mr%3A1%2Cpdtr0%3A973849%257C973851)
- [Chocolate flavor with the tbs=mr:1,pdtr0:1658504|1658508 parameter](https://serpapi.com/playground?engine=google%5Fshopping&q=Coffee&location=Austin%2C+TX%2C+Texas%2C+United+States&gl=us&hl=en&tbs=mr%3A1%2Cpdtr0%3A1658504%257C1658508)
- [Coffee contained in a jar with the tbs=mr:1,pdtr0:1658497|1658499 parameter](https://serpapi.com/playground?engine=google%5Fshopping&q=Coffee&location=Austin%2C+TX%2C+Texas%2C+United+States&gl=us&hl=en&tbs=mr%3A1%2Cpdtr0%3A1658497%257C1658499)

### Combining different types of filters

Combining filters is not as straightforward as you might think. Your `tbs` value always needs to start with `mr:1` no matter how many filters you'd like to apply. The 2nd part of the `tbs` value depends on the filter you choose. For example, the `tbs` value for the `Brand=Jacobs` is `mr:1,pdtr0:906016|3136105`, and for the `Flavor=Chocolate` is `mr:1,pdtr0:1658504|1658508`. They need to be combined in the following way:

- [Brand=Jacobs \+ Flavor=Chocolate with the tbs=mr:1,pdtr0:906016|3136105,pdtr1:1658504|1658508 parameter](https://serpapi.com/playground?engine=google%5Fshopping&q=Coffee&location=Austin%2C+TX%2C+Texas%2C+United+States&gl=us&hl=en&tbs=mr%3A1%2Cpdtr0%3A906016%7C3136105%2Cpdtr1%3A1658504%7C1658508)

As you can see, both of the filters contain the `pdtr0` part. However, since those are different types of filters, they need to be separated by a comma, and the 2nd filter used needs to have `pdtr1` instead of `pdtr0`. This is the same if you'd like to use three or more filters of different types. The `pdtr0` changes to `pdtr2`, `pdtr3`, and so on. Example below:

- [Jacobs coffee in the Chocolate flavor with medium roast contained in a box with the tbs=mr:1,pdtr0:906016|3136105,pdtr1:1658504|1658508,pdtr2:1658497|1658511,pdtr3:973849|973851 parameter](https://serpapi.com/playground?engine=google%5Fshopping&q=Coffee&location=Austin%2C+TX%2C+Texas%2C+United+States&gl=us&hl=en&tbs=mr%3A1%2Cpdtr0%3A906016%7C3136105%2Cpdtr1%3A1658504%7C1658508%2Cpdtr2%3A1658497%7C1658511%2Cpdtr3%3A973849%7C973851)

Some filters do not contain the `pdtr0` part. In that case, simply combine the parts after `mr1` of different filters:

- [Coffee up to $10 from the Jacobs brand with the tbs=mr:1,price:1,ppr\_max:10,pdtr0:906016|3136105 parameter](https://serpapi.com/playground?engine=google%5Fshopping&q=Coffee&location=Austin%2C+TX%2C+Texas%2C+United+States&gl=us&hl=en&tbs=mr%3A1%2Cprice%3A1%2Cppr%5Fmax%3A10%2Cpdtr0%3A906016%7C3136105)

### Combining filters from the same type

For filters of the same type, you need first to find the common part of the filter and combine it with the unique part of each filter you want to use, separated with the correct separator . For example, `Brand` filters are as below:

![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/2023/06/image-36.png)

Common parts of the `Brand` filter

You can see that the common part for each of them is `mr:1,pdtr0:906016|`, and the unique parts are `1083000` for `NESCAFÉ`, `3136105` for `Jacobs`, and so on. Simply combine the common part with the unique part of each `Brand` separated by `!`:

- [Coffee search with NESCAFÉ and Jacobs brands with the tbs=mr:1,pdtr0:906016|1083000!3136105 parameter](https://serpapi.com/playground?engine=google%5Fshopping&q=Coffee&location=Austin%2C+TX%2C+Texas%2C+United+States&gl=us&hl=en&tbs=mr%3A1%2Cpdtr0%3A906016%7C1083000!3136105)

For the `Sellers` filter, the applicable separator is `|`. Once again, you need to find the common part for each filter of that type and combine it with the unique parts of each filter:

![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/2023/06/image-37.png)

Common parts of the `Seller` filter

- [The Coffee query with the Ami Ventures and Blackout Coffee Co. sellers with the tbs=mr:1,merchagg:m138811544|m126559184 parameter](https://serpapi.com/playground?engine=google%5Fshopping&q=Coffee&location=Austin%2C+TX%2C+Texas%2C+United+States&gl=us&hl=en&tbs=mr%3A1%2Cmerchagg%3Am138811544%7Cm126559184)

There could be other separators like `,` or `;`. The easiest way to find the separator for your filter is to[ perform an API call with one of the filters and check what values are provided for the 2nd filter of the same type](https://serpapi.com/playground?engine=google%5Fshopping&q=Coffee&location=Austin%2C+TX%2C+Texas%2C+United+States&gl=us&hl=en&tbs=mr%3A1%2Cbuy%3Ag):

![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/2023/06/image-38.png)

Finding a separator for different filters of the same type

## Conclusion

As you can see, the Google Shopping filters are more dynamic than Google Search, News, Images, and Videos filters. If you want to test your implementation, I recommend checking the [Playground](https://serpapi.com/playground?engine=google%5Fshopping&q=Coffee) first. If you are interested in filtering results for different Google engines, check the blog posts below:  
[Filtering Google Search and Google News results](https://serpapi.com/blog/filtering-google-search-and-google-news-results/)  
[Filtering Google Images and Google Videos results](https://serpapi.com/blog/filtering-google-images-and-google-videos-results/)  
You can also contact us directly with any questions or concerns at contact@serpapi.com. We will be more than happy to help!

---

> Check our [Tips and Tricks blog post](https://serpapi.com/blog/tips-and-tricks-of-google-search-api/#advanced-search-operators)  
> Use [the Playground](https://serpapi.com/playground) to test our APIs  
> Join us on [Twitter](https://twitter.com/serp%5Fapi) | [YouTube](https://www.youtube.com/channel/UCUgIHlYBOD3yA3yDIRhg%5Fmg)