启用Google自定义搜索需要哪些API?

时间:2014-03-28 08:57:23

标签: objective-c google-custom-search

我们通过网址调用API:

https://www.googleapis.com/customsearch/v1?key=MY_KEY&cx=CUSTOM_SEARCH_ID&q=flower

在回复中收到错误:

"error": { "errors": [ { "domain": "usageLimits", "reason": "accessNotConfigured", "message": "Access Not Configured. Please use Google Developers Console to activate the API for your project." } ], "code": 403, "message": "Access Not Configured. Please use Google Developers Console to activate the API for your project." }

我们已启用自定义搜索API和Google + API。仍然高于错误。我们是否还需要启用其他API?

请帮忙。

2 个答案:

答案 0 :(得分:0)

不,我相信自定义搜索API是您需要启用的唯一API。

所以,我会考虑你是否拥有正确的密钥和CSE ID。

要验证您的CSE ID,请从此处进行测试查询(填写):
https://console.developers.google.com/project/PROJECT_ID/apiui/api/customsearch/method/search.cse.list

如果您的查询在那里工作,但仍然无法在您的代码中运行,那么问题可能就是您的关键。如果您只是在做一个简单的URL请求(正如您在Q中所示),那么我希望您使用的是服务器密钥。当然,您使用的密钥必须来自启用CSE API的同一项目。

答案 1 :(得分:0)

转到https://console.developers.google.com/apis/dashboard 在仪表板屏幕中有一个Enable API链接(靠近仪表板标题) 选择要启用的API。 启用的API将列在仪表板中。 通过URL调用API并检查。