Google Custom Search Engine API Image Search not returning results
Asked Answered
P

2

8

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?

Polaris answered 25/4, 2014 at 13:13 Comment(0)
H
13

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.

Homolographic answered 17/3, 2015 at 20:27 Comment(1)
wasted 2 hours, this ans saved me. Thanx @Russ Taylor. Hey user3573043 pls mark this as accepted ans man.Bria
C
2

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

Colston answered 6/9, 2017 at 17:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.