Google Custom search API returning Access Not Configured

☆樱花仙子☆ 提交于 2019-12-13 04:29:35

问题


We are calling API by url:

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

getting error in reponse:

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

WE have enabled Custom Search API and Google + API. Still getting above error. Should we needto enable some other API too?

Please help.


回答1:


(I'm repeating here the answer I gave you here).

No, I believe that custom search API is the only API that you need to enable.

So, I would consider whether you have the right key and CSE ID.

To verify your CSE ID, do a test query from here (fill in ): https://console.developers.google.com/project/PROJECT_ID/apiui/api/customsearch/method/search.cse.list

If your query works there, but still doesn't work in your code, then perhaps the issue is your key. If you are just doing a simple URL request (as you show in your Q), then I would expect you are using a server key. And, of course, the key you are using must be from the same project where you have enabled the CSE API.



来源:https://stackoverflow.com/questions/22706642/google-custom-search-api-returning-access-not-configured

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!