Google API 返回的结果与网站不同 [英] Google API returning different results than website

查看:27
本文介绍了Google API 返回的结果与网站不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在 google.com 上进行特定于站点的搜索时:

When I do a site-specific search on google.com:

站点:http://one-month-of-chat-logs.github.io security

我得到 12 个结果.我注册了一个自定义搜索引擎 (cx: 015271449006306103053:mz6wkimeenc) 和 API 密钥,当我运行相同的搜索时,我只得到 3 个结果:

I get 12 results. I signed up for a custom search engine (cx: 015271449006306103053:mz6wkimeenc) and API key, and I get only 3 results when I run the same search:

$ curl 'https://www.googleapis.com/customsearch/v1?key=$MY_API_KEY&cx=015271449006306103053%3Amz6wkimeenc&q=security'

为什么结果不同?我的 API 请求实际上查询的内容与我在 google.com 上执行的搜索不同吗?

Why do the results differ? Is my API request actually querying something different than the search I performed on google.com?

推荐答案

此 google 页面包含您要查找的内容 https://support.google.com/customsearch/answer/70392?hl=en

This google page has what you are looking for https://support.google.com/customsearch/answer/70392?hl=en

您的结果不太可能与 Google 网页搜索返回的结果相匹配,原因如下:

your results are unlikely to match those returned by Google Web Search, for several reasons:

  1. 即使将自定义搜索引擎配置为搜索整个网络,它旨在强调来自您自己网站的结果.
  2. 您的自定义搜索引擎不包括 Google 网页搜索功能,例如单一框、实时结果、通用搜索、社交功能或个性化的结果.
  3. 如果您的自定义搜索引擎包含超过十个站点,结果可能来自我们索引的一个子集,并且可能不同于在 Google.com 上进行站点:"搜索的结果.

这篇关于Google API 返回的结果与网站不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆