Search code examples
htmlxmlurlgoogle-apigoogle-custom-search

How can I apply filtering and sorting results in a URL for Google Custom Search?


I am trying to sort and filter results using URL the only thing that works is writing a search query in the URL. here are some examples of what I'm trying to achieve but it's not working!

https://www.listoc.com/search/homes.htm?q=homes&sort=date:a:w https://www.listoc.com/search/homes.htm?q=homes&sort=review-date:r::20091231

If anyone did this before please let me know! I've read a lot in the guide: https://developers.google.com/custom-search/docs/structured_search but I couldn't figure out how to do it.


Solution

  • The Custom Search Element won't parse out url parameters in the page it is hosted on (except for 'q')

    What you can do is either: