Finding a date range using the Google UI API

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

URL url = new URL("https://ajax.googleapis.com/ajax/services/search/images?"
                + "v=1.0&q=barack%20obama&userip=INSERT-USER-IP");

How do I change the URL to restrict search results, for example: 2014-08-15and 2014-09-31?

+3
source share
1 answer

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

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

, Google Java API, Query setSort(), URL.

+2

All Articles