需要通过R访问Google自定义搜索API

dat*_*-gg 5 api ssl r google-custom-search

如何使用R进行Google自定义搜索?我有自定义搜索引擎ID和api密钥.我目前尝试这样做:

getURL("https://www.googleapis.com/customsearch/v1?key=API_KEY&cx=ENGINE_ID&q=searchterm")
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

函数错误(type,msg,asError = TRUE):SSL证书问题:无法获取本地颁发者证书

虽然我在浏览器中执行get请求时能够在json中获得结果.关于什么事情的任何线索?

dat*_*-gg 4

httr 包有效!

library(httr)
query="https://www.googleapis.com/customsearch/v1?key=API_KEY&cx=ENGINE_ID&q=SEARCH_TERM"
content(GET(query))
Run Code Online (Sandbox Code Playgroud)