Date range search using Google Custom Search API

后端 未结 1 332
一生所求
一生所求 2021-01-05 11:02

I am using the Google Custom Search API to search for images. My implementation is using Java, and this is how I build my search string:

URL url = new URL(\"         


        
1条回答
  •  礼貌的吻别
    2021-01-05 12:06

    You can specify a date range using the sort parameter. For your example, you would add this to your query string: sort=date:r:20140815:20140931.

    This is documented at https://developers.google.com/custom-search/docs/structured_data#page_dates

    Also if you use Google's Java API you can use the Query class and its setSort() method rather than building the URL by hand.

    0 讨论(0)
提交回复
热议问题