是否可以使用搜索API在特定国家/地区的Google网站中进行搜索? [英] Is the a way to search in a country specific Google site using the search API?
问题描述
我有一个脚本,该脚本使用Google自定义搜索API读取Google结果,我浏览了文档,并设法设置了用于过滤结果的语言和国家/地区,但结果仍与从网站获得的结果有所不同.
I have a script that reads Google results using Google custom search API, I went through the docs and I managed to set the language and country to filter the results but the results are still different from the results I get from the website.
http://www.google.it/#hl= zh-CN& output = search& q = gelato
是否可以通过API获得与使用网站相同的结果?
Is there a way to get the same results from the API as if I were using the website?
推荐答案
自定义搜索API说"cr"参数适用于国家/地区限制.
Custom Search API says that 'cr' parameters is for Country restrict(s).
'hl'参数用于以特定语言(用户界面语言)显示结果文本.
'hl' parameter is used to show results text in a specific language (user interface language).
'gl'参数.
'lr'参数应与'cr'参数一起使用或代替,以将结果限制为特定语言.
'lr' parameter should be used, in conjunction with or instead of 'cr' parameter, to restrict results to a specfic language.
https://developers.google.com/custom-search/v1/cse/list
这篇关于是否可以使用搜索API在特定国家/地区的Google网站中进行搜索?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!