Google search api 在googleapi中过滤显式图像

Google search api 在googleapi中过滤显式图像,google-search-api,google-image-search,Google Search Api,Google Image Search,嗨,我想在运行应用程序时过滤显式图像(在本地和服务器中)。 如何限制包含成人图像的图像使用谷歌自定义搜索引擎限制图像我该怎么做请任何人帮助我 我使用下面的代码,但它不工作 <script type="text/javascript"> google.load('search', '1'); function initialize() { var searchControl = new google.search.Sea

嗨,我想在运行应用程序时过滤显式图像(在本地和服务器中)。 如何限制包含成人图像的图像使用谷歌自定义搜索引擎限制图像我该怎么做请任何人帮助我

我使用下面的代码,但它不工作

 <script type="text/javascript">


        google.load('search', '1');

        function initialize() {

            var searchControl = new google.search.SearchControl();          
            searchControl.addSearcher(new google.search.ImageSearch());
            searchControl.draw(document.getElementById("searchcontrol"));
            searchControl.execute("sunset");
        }
        google.setOnLoadCallback(initialize);
</script>

load('search','1');
函数初始化(){
var searchControl=new google.search.searchControl();
searchControl.addSearcher(新的google.search.ImageSearch());
searchControl.draw(document.getElementById(“searchControl”);
searchControl.execute(“日落”);
}
setOnLoadCallback(初始化);

您可以使用以下代码

var searcher=new google.search.ImageSearch()
searcher.setRestriction(
google.search.search.RESTRICT\u SAFESEARCH,
google.search.search.SAFESEARCH(严格要求)

imageSearch.setSearchCompleteCallback…
imageSearch.execute

另请注意:

  • 成人过滤仅适用于少数语言()

  • 此API标记为已弃用。也许将来你应该使用某种类型的。我仍然在使用不推荐的API,但谷歌可以随时禁用这个API


  • 这跟阿彭金有什么关系?这是客户端javascript代码,正在使用与AppEngine无关的google搜索服务。一旦在服务器上发布,我想在我的应用程序中实现安全的搜索过滤。