我正在尝试使用 Google 自定义搜索 API 我遵循了自定义搜索文档,我完成了控制面板的内容并获得了搜索引擎ID,实现了API并从开发人员控制台获得了API密钥
公共 API 访问密钥 - AIzaSyC0m8w-NEP3yrKolboNbPLbhlhmHJc_cB0
搜索引擎 ID - 005717290701474541337:1mc_u_r_i94
提出上述请求后,我得到了这个结果
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "accessNotConfigured",
"message": "Access Not Configured. The API is not enabled for your project, or there is a per-IP or per-Referer restriction configured on your API key and the request does not match these restrictions. Please use the Google Developers Console to update your configuration.",
"extendedHelp": "https://console.developers.google.com"
}
],
"code": 403,
"message": "Access Not Configured. The API is not enabled for your project, or there is a per-IP or per-Referer restriction configured on your API key and the request does not match these restrictions. Please use the Google Developers Console to update your configuration."
}
}
我没有得到预期的结果,所以请帮忙.. 谢谢
一切似乎都没问题,可能是 API 密钥问题。 尝试为浏览器创建一个 API 密钥,它可能会起作用
这是错误情况
1.启用自定义搜索API
2.操作在https://developers.google.com/custom-search/v1/overview页面
获取密钥