Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Image Search API, does anyone have an example that works?

Trying to find out how to do Google image searches via an API / REST call. Apparently the image search API is deprecated and directs us to the Custom Search API.

But my first experiments with the Custom Search API, return results from my own website !!&*%%%$@@!, which is not helpful in the slightest.

I need image results from Google images. Anyone have an example query that works?

like image 816
Fraggle Avatar asked Oct 04 '13 23:10

Fraggle


1 Answers

You will basically want to generate a URL like this. Note the search type parameter at the end.

https://www.googleapis.com/customsearch/v1?key=YOUR API KEY&cx=YOUR CUSTOM SEARCH ENGINE IDENTIFIER&q=your query&searchType=image

You can read more here https://developers.google.com/custom-search/json-api/v1/using_rest

edit: changed searchType to lowercase based on comment below

like image 59
Jun Wei Lee Avatar answered Oct 14 '22 11:10

Jun Wei Lee