rest - Google Search API - 获得 "regular"Google 结果

标签 rest google-custom-search

我想做一些 Google 搜索并获得与在 www.google.se 上搜索相同的结果(我在瑞典)。我在此处创建了一个 Google API 帐户以获取 API key ,https://code.google.com/apis/console/b/0/ .

我这样调用 API:

https://www.googleapis.com/customsearch/v1?key=KEY&cx=013036536707430787589:_pqjad5hr1a&gl=se&cr=se&googlehost=google.se&q=bästa espressomaskin&alt=json

然而,这与我通常会搜索“bästa espressomaskin”的结果不同,我不知道为什么。

我的第二个问题是关于参数“cx”。它实际上是什么,它有什么作用?我只是使用了 Google API 介绍站点上提供的那个。

我还想要 10 个以上的结果,我的 API 控制台帐户上有一些美元,但是如何才能将“num”参数设置为 10 以上?

谢谢

最佳答案

cx 是您注册其自定义搜索服务时获得的 Google key 。它允许您自定义搜索。请参阅此处了解更多信息:https://developers.google.com/custom-search/v1/getting_started

至于结果,谷歌在他们的文档中说你的结果可能会有所不同。请参阅此处了解更多信息:http://support.google.com/customsearch/bin/answer.py?hl=en&answer=2633385

关于rest - Google Search API - 获得 "regular"Google 结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16405810/

相关文章:

css - Google 自定义搜索引擎和 Bootstrap3 样式问题

http - 如何查询google自定义搜索引擎多个关键词?

c++ - C++ REST SDK 中的 URI 编码 ("Casablanca")

json - 如何在 JSON 响应中拆分参数的多个值?

java - Restful API 将分层/嵌套数据发布到 Web 服务

Java SSLException : hostname in certificate didn't match for www. googleapis.com

rest - API 调用返回的结果是否可能多于默认限制允许的结果?

REST: "actions"的另一个问题

google-api - 在哪里可以找到 Google 自定义搜索 API 的国家/地区代码值列表?

regex - 如何使用非拉丁词的正则表达式定义促销?