删除谷歌搜索API中的重复?

时间:2010-09-14 07:05:35

标签: python google-search-api

我正通过谷歌搜索API在我的应用程序中执行谷歌搜索。它给了我重复的结果。如何避免它。我引用了http://code.google.com/apis/ajaxsearch/documentation/reference.html#_intro_fonje

1 个答案:

答案 0 :(得分:0)

您可以查看以下使用的过滤选项:

它使用两种类型的过滤器:

  • 重复的代码段过滤器
  • 重复目录过滤器

因此,在调用时,请标记Filter = True

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

API提供以下参数:

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"