Google 自定义搜索引擎错误代码 403:未配置访问

问题描述 投票:0回答:2

我正在尝试使用 Google 自定义搜索 API 我遵循了自定义搜索文档,我完成了控制面板的内容并获得了搜索引擎ID,实现了API并从开发人员控制台获得了API密钥

公共 API 访问密钥 - AIzaSyC0m8w-NEP3yrKolboNbPLbhlhmHJc_cB0

搜索引擎 ID - 005717290701474541337:1mc_u_r_i94

https://www.googleapis.com/customsearch/v1?&key=AIzaSyC0m8w-NEP3yrKolboNbPLbhlhmHJc_cB0&cx=005717290701474541337:1mc_u_r_i94&q=paris

提出上述请求后,我得到了这个结果

 {
 "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."
 }
}

我没有得到预期的结果,所以请帮忙.. 谢谢

google-apps-script google-custom-search
2个回答
2
投票

一切似乎都没问题,可能是 API 密钥问题。 尝试为浏览器创建一个 API 密钥,它可能会起作用


0
投票

这是错误情况

© www.soinside.com 2019 - 2024. All rights reserved.