Google Custom Search key not working

I am having trouble setting up Google Custom Search. It keep returning this error:

Forbidden - perhaps check your credentials?
This project does not have the access to Custom Search JSON API.

I have restricted my key but it still returns same error

1 Like

Hi @Ebere Welcome!
Many project sometimes get 403 this project does not have the access to Custom Search JSON API so right fix is to use a Google Cloud project where Custom Search JSON API is explicitly enabled and allowed (older API or without billing sometimes) and then use that project’s API key and matching Search Engine ID, let me know if that works.

Hi @Ebere, welcome to the n8n community! One additional thing I would double check is billing and project alignment. From my experience, the Custom Search JSON API requires billing to be enabled on the Google Cloud project, and both the API key and the Search Engine ID need to come from the same project. If billing is disabled or the CSE was created under a different project, you will still get this 403 error even if the API is enabled.

I used to use this API some time ago, but after testing it again now, it’s indeed no longer working:

and after spending some time investigating, I found that Google mentioned this API will be discontinued in 2027:

The weird thing is that it still works via the APIs Explorer on their docs page (the panel on the right)!

So in theory, you could copy the request along with its headers and parameters and try to replicate it, I haven’t tried that myself, though..

That said, since it’s going to be discontinued anyway, it looks like Google has already started restricting access for users..

My advice: save yourself the headache and switch to an alternative like SerpAPI, Brave Search API, or any similar service..

2 Likes