Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Custom Search Engine API Image Search not returning results

Just setup my CSE with Image Search enabled in the Basics tab, but still ain't getting results.

If I don't use searchType=image in the query it works, if I put it back it stops working with no errors, just no results.

Any inputs?

like image 301
user3573043 Avatar asked Apr 25 '14 13:04

user3573043


People also ask

Is there an API for Google Search results?

The Search Console API provides programmatic access to the most popular reports and actions in your Search Console account. Query your search analytics, list your verified sites, manage your sitemaps for your site, and more. Official Google Search updates and SEO best practices.

How do I customize Google Search engine?

Customize your own theme for your search engineClick Look and feel from the left menu in Control Panel, and open the Customize tab. Select the element you want to customze from the box on the left. Choose the font, border color, and background color for that element.


2 Answers

It seems there are two elements required to consume the Google search API, the configuration of the API key and credentials.

Setup 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 the mistake like a lot of people of ignoring the CSE side of the setup (it didn't seem logical to search only my own site).

You need to create a CSE though, point it to search any url (I don't think it matters greatly), and then where it says "Sites to search" chose "Search the entire web but emphasise included sites". Also then set image search to "On".

Once you've done this browse to your new CSE, the url should contain your CX code e.g. cx=014341056213260336986:v4fl8n8sabc, you then need to use this in your request query string.

Your API query should now start returning results.

like image 126
Russ Taylor Avatar answered Sep 28 '22 08:09

Russ Taylor


Image search needs to be switched to ON at the Custom Search Setup->Basics

like image 31
Jana Avatar answered Sep 28 '22 09:09

Jana