Google custom search API for images not working

539 Views Asked by At

My requirement is, i need image search based on google API.

so i registered in Google developer console and enabled "custom search API"

GET Request: https://www.googleapis.com/customsearch/v1?key=apikey&cx=017576662512468239146:omuauf_lfve&searchType=image&fileType=jpg&q=https://i.natgeofe.com/n/548467d8-c5f1-4551-9f58-6817a8d2c45e/NationalGeographic_2572187_square.jpg

FYI: In the above GET request. i removed apikey for security issue

For the above request it is not throwing any error but it is showing 0 results for any type of image. I added "searchType=image" still it is not showing results

I tried with below approach Search Images in Google and get JSON response but its not working out

Can somebody help me where is the issue.

1

There are 1 best solutions below

0
Asha Datla On

The issue is fixed now with below changees:

  1. At https://programmablesearchengine.google.com/, "Image search" is enabled and in the option "Sites to search" all search sites were removed

  2. The image i uploaded was not indexed by google search engine so it was resulting 0 items. Once i selected indexed image link it was returning image links.