views:

25

answers:

1

I am performing a google search in my application through google search api. It gives me the duplicate results. How to avoid it. I refer http://code.google.com/apis/ajaxsearch/documentation/reference.html#_intro_fonje

A: 

You can look at the filtering option used at :

It uses two types of filter:

  • Duplicate Snippet Filter
  • Duplicate Directory Filter

So when calling, mark Filter=True

results = server.doGoogleSearch(key, 'mark', 0, 10, False, "", ...)

The API provides the following argument:

key - Your Google API key
q - The search word
start - The index of the result to start on
maxResults - The number of results to return.
filter - If True, Google will filter out duplicate pages
restrict - Set this to country plus a country code to get results only from a particular country
safeSearch - If True, Google will filter out porn sites
lr (“language restrict”) - Set this to a language code
ie and oe must be "utf-8"
pyfunc
Are you sure those work on the public google?
Byron Whitlock
Google API accepts Filter=True / False option and I assume that the duplicate filter is enabled for public google too.
pyfunc
@Byron Whitlock : The Ajax search API documentation , google Appliance API both provides filter as options for search API
pyfunc