Google Custom Search results based on custom filtering based on URL

191 Views Asked by At

I am using the Google search API to get the search results for a specific website. By providing the website link in the “siteSearch” query string parameter for the google API. Find the format of the google API link used below.

https://www.googleapis.com/customsearch/v1?key={key}&cx={cxvalue}:asy-vyluh2i&q={searchKeyWord}&num=10&start=1&sort=&siteSearch=https://www.sample.com/forums/

Currently, I am using the “siteSearch” filter as the below sample link. Which yields the results from the entire forum list based on the keyword search.

https://www.sample.com/forums/

And I am trying to filter the search by category. So I am trying to provide the categorized URL in the “siteSearch” query string like below which lists only the results based on the category.

Categorized URL: https://www.sample.com/forums/category

Google API : https://www.googleapis.com/customsearch/v1?key={key}&cx={cxvalue}:asy-vyluh2i&q={searchKeyWord}&num=10&start=1&sort=&siteSearch=https://www.sample.com/forums/category

But the actual forum links are not coming in the result, by providing the “Categorized URL” in the Google API. How can I get the forum links based on specified categorized URL in the “siteSearch” query string parameter?

0

There are 0 best solutions below