Google Search API - 获得“常规”Google 结果

Osk*_*son 6 rest google-custom-search

我想做一些 Google 搜索并获得与在 www.google.se 上搜索相同的结果(我在瑞典)。我在此处创建了一个 Google API 帐户来获取 API 密钥,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
Run Code Online (Sandbox Code Playgroud)

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

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

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

谢谢

Jes*_*rks 2

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

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