Google Shopping Filters API

SerpApi Google Shopping API scrapes the type, text, and tbs of filters which are needed to narrow down the search results.
Google shopping supports list and grid layouts. You should use the tbs parameter to force a specific layout. Set tbs=vw:l to force list layout. Set tbs=vw:g to force grid layout.

JSON structure overview

{
  ...
  "filters": [
    {
      "type": "String - Block title (Ex: 'Shipping & returns')",
      "options": [
        {
          "text": "String - Filter name (Ex: 'Free returns')",
          "tbs": "String - tbs value (Ex: 'mr:1,free_return:1')"
        },
        ...
      ]
    },
    ...
  ],
  ...
}

API Examples

Results with tbs values

To apply filters for the Google Shopping search, you need to update the tbs parameter with the appropriate value. SerpApi is able to extract and make sense of this type of data.
e.g. To select "Buy on Google" option, you need to pass vw:l,mr:1,cat:404,root_cat:529656,buy:g,ss:67,init_ar:SgVKAwiUA0oHsgQECPipIA%3D%3D value to tbs parameter.
e.g. To select multiple filter options, tbs parameter has to be constructed in the following sequence: value + : + value.
Results with tbs values

JSON Example

  {
    ...
    "filters": [
      {
        "type": "Show only",
        "options": [
          {
            "text": "Buy on Google",
            "tbs": "vw:l,mr:1,cat:404,root_cat:529656,buy:g,ss:67,init_ar:SgVKAwiUA0oHsgQECPipIA%3D%3D"
          },
          {
            "text": "New items",
            "tbs": "vw:l,mr:1,cat:404,root_cat:529656,new:1,init_ar:SgVKAwiUA0oHsgQECPipIA%3D%3D"
          }
        ]
      },
      {
        "type": "Price",
        "options": [
          {
            "text": "Up to $400",
            "tbs": "vw:l,mr:1,cat:404,root_cat:529656,price:1,ppr_max:400,init_ar:SgVKAwiUA0oHsgQECPipIA%3D%3D"
          },
          {
            "text": "$400 – $900",
            "tbs": "vw:l,mr:1,cat:404,root_cat:529656,price:1,ppr_min:400,ppr_max:900,init_ar:SgVKAwiUA0oHsgQECPipIA%3D%3D"
          },
          {
            "text": "$900 – $1,500",
            "tbs": "vw:l,mr:1,cat:404,root_cat:529656,price:1,ppr_min:900,ppr_max:1500,init_ar:SgVKAwiUA0oHsgQECPipIA%3D%3D"
          },
          ...
        ]
      },
      {
        "type": "Category",
        "options": [
          {
            "text": "TVs",
            "tbs": "vw:l,mr:1,init_ar:SgVKAwiUA0oHsgQECPipIA%3D%3D"
          }
        ]
      },
      {
        "type": "Brand",
        "options": [
          {
            "text": "Samsung",
            "tbs": "vw:l,mr:1,root_cat:529656,cat:404,pdtr0:708987%7C709001,init_ar:SgVKAwiUA0oHsgQECPipIA%3D%3D"
          },
          {
            "text": "LG",
            "tbs": "vw:l,mr:1,root_cat:529656,cat:404,pdtr0:708987%7C708995,init_ar:SgVKAwiUA0oHsgQECPipIA%3D%3D"
          },
          {
            "text": "TCL",
            "tbs": "vw:l,mr:1,root_cat:529656,cat:404,pdtr0:708987%7C761941,init_ar:SgVKAwiUA0oHsgQECPipIA%3D%3D"
          },
          ...
        ]
      },
      ...
    ],
    ...
  }