[SOLVED] How did you configure Google Custom Search?

[SOLVED] How did you configure Google Custom Search?
0

#1

I’m working on the image search project (or rather, about to start it), but I’m stuck with trying to get Google Custom Search to work. The JSON responses I get are not meaningful. How did you configure the custom search? My guess is that the sites to search are incorrect (I just used google.com). I’d appreciate help :slight_smile:


#2

I assume you have got your API key etc.
Go to https://cse.google.com/cse/all and add search engine, then on “Basics” tab set “Image search” to ON, copy from “Details” your “Search Engine ID”.


My request was like this (I split it on multiple lines for this example):

https://www.googleapis.com/customsearch/v1?

key=API_KEY&
cx=SE_ID&  // Search Engine ID
q=SEARCH_TERM&  // What are you searching for
searchType=image&  // Optional, you set it in settings
start=10  // offset  Optional

Google search free tier has only 50 searches per day, so be frugal :wink:


#3

Great, it’s working now! :smiley:

I missed this little option in the “Sites to search” section that says “Search the entire web but emphasize included sites”.

Thanks! :slight_smile: