gpt4 book ai didi

r - 需要通过 R 访问 Google Custom search api

转载 作者:太空宇宙 更新时间:2023-11-03 12:45:44 27 4
gpt4 key购买 nike

如何使用 R 进行 Google 自定义搜索?我有自定义搜索引擎 ID 和 API key 。我目前正在尝试这样做:

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

我收到以下错误:

Error in function (type, msg, asError = TRUE) : SSL certificate problem: unable to get local issuer certificate

尽管当我在浏览器中执行获取请求时,我能够在 json 中获取结果。有什么线索吗?

最佳答案

httr 包成功了!!

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

关于r - 需要通过 R 访问 Google Custom search api,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30246787/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com