2016-06-01 174 views
1

我想创建一个应用程序,通过特定的过滤器和限制将搜索推到谷歌搜索,然后将结果显示给用户(过去x天的结果中的特定关键字)。如何才能做到这一点? https://developers.google.com/custom-search/json-api/v1/introduction#background-data-model改进谷歌搜索引擎结果

有没有人尝试过类似的事情:

这可以通过使用谷歌网站搜索https://www.google.com/work/search/products/gss.html连同这个API来完成?

回答

1

是的。这是可能的限制。 只能使用GoogleCustomSearch(你上面的链接)

  1. [ PARAM]去开发者控制台,打开 “自定义搜索API” - https://console.developers.google.com创造API_KEY( “服务器” 型)
  2. [ CX PARAM]去CustomSearch控制台https://cse.google.com/cse并创建自定义搜索引擎( “CX” 参数)

使用GET模板创建一个请求(https://developers.google.com/custom-search/json-api/v1/using_rest

https://www.googleapis.com/customsearch/v1?key= GET YOUR_KEY & CX = YOUR_CX & Q =站点:lenta.ru &网站搜索= lenta.ru