使用Google自定义搜索API时收到403错误消息

时间:2015-03-28 15:32:48

标签: json google-search-api

我在使用Google custom search API时收到此消息。我得到了API key(服务器和浏览器)和search ID

为什么会说usageLimits?约束是每天100次查询,但我运行程序的方式不到100次....

哪里出错......请帮助!!

"error": { "errors": [ { "domain": "usageLimits", "reason": "ipRefererBlocked", "message": "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 API key configuration if request from this IP or referer should be allowed.", "extendedHelp": "https://console.developers.google.com" } ], "code": 403, "message": "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 API key configuration if request from this IP or referer should be allowed." }

1 个答案:

答案 0 :(得分:0)

我认为您的API密钥或CX参数可能有误。 转到自定义搜索引擎编辑器并重新复制值。

确保添加了一些网站进行搜索。

尝试使用右侧窗格中的链接来测试自定义搜索引擎的工作情况。