google-custom-search - Google 自定义搜索 API - 将结果限制为每个域 1 个

标签 google-custom-search

有什么方法可以将 Google Custom Search API 返回的结果限制为每个域 1 个?

最佳答案

是的。如果您正在寻找第一个结果。如果您熟悉 Python,则可以尝试以下操作。

res = service.cse().list(query,cx='YOURSEARCHENGINEIDHERE,).execute()

name = res['items'][0]['title']     #title of the first search result
url = res['items'][0]['link']       #url of the first search result

关于google-custom-search - Google 自定义搜索 API - 将结果限制为每个域 1 个,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30266770/

相关文章:

adsense - Google 自定义搜索广告 : When and why it is needed to use maxTop?

css - Google Custom Search Foundation 5 Zurb 显示问题

r - 需要通过 R 访问 Google Custom search api

ssl - 显示搜索结果时如何避免混合内容错误?

python - 使用自定义搜索以编程方式在 Python 中搜索 google

css - Google CSE 自定义搜索 CSS

google-custom-search - 图像搜索期间 Google Custom Search API 的多个文件类型

google-custom-search - 使用自定义搜索 JSON/Atom API 时是否默认显示广告?

javascript - 如何在页面加载后加载 Google 的自定义搜索引擎 (CSE) JS API?

java - 谷歌日历 API。处理事件的共享扩展属性