There seem to be two elements needed to use the Google Search API, the API key setting, and credentials.
Install the API key here https://console.developers.google.com/project
and create your own CSE here https://www.google.co.uk/cse/all
I made a mistake, like many people ignoring the CSE part of the installation (it was logical not to search only my own site).
You need to create a CSE, although you need to point to a search for any URL (I donβt think it matters very much), and then where it says "Sites to search" chose "Search the entire network, but select the included sites" . Then set the image search to βOnβ.
Once you navigate to the new CSE, the URL should contain your CX code, for example. cx = 014341056213260336986: v4fl8n8sabc, you need to use this in the query string of the request.
Your API request should now start returning results.
source share