Search code examples
searchgoogle-search-apigoogle-image-search

Image search integration


I'm looking for a solution, where users of my site can use an image search engine (e.g. Google), instead of uploading an image, they can search and pick one of the results.

My problem is:

  • Google image search API is deprecated!
  • Google custom search requires me to add "sites to search" when creating a custom search API key. However, I do not want to search my own site, I want to search the internet!

Which Google API is ment to search images on the internet? Would it be plausible to include normal image search in an iframe, and somehow capture an image selection (i.e. when clicked)?


Solution

  • Google made it really difficult:

    TL;DR: You have to use Google custom search, add a random site when creating the API key, afterwards you can tweak the settings to search the entire web instead.