Google image search API

心不动则不痛 提交于 2020-02-04 14:33:48

问题


I have a website where users can submit pictures. I'd like to search Google automatically with these images to minimise the chance that the pictures are stolen from an other website. I know about the Firefox extension, but that requires me right-clicking every picture and waiting for the result to appear. I'd like to automate this.

I was looking for an API, but the Google Image Seach API (https://developers.google.com/image-search/) clearly mentions it's deprecated. I've also found a Google Custom Search API, but that seems build for those that want to search their own site (which is not what I'm looking for).

I'd like to do what the Firefox extension does, ie, submit an image to the Google Image Search, and retrieve the resulting page in PHP.

Best way with an API, but if that is not available: how is the image uploaded/encoded to Google so that it can be searched? Anybody knows more about it?


回答1:


Update: The following API is deprecated.

The Google Image Search API has been officially deprecated as of May 26, 2011. It will continue to work as per our deprecation policy, but the number of requests you may make per day may be limited. We encourage you to use the Custom Search API, which now supports image search. https://developers.google.com/image-search/v1/jsondevguide

You get the all details at

https://developers.google.com/image-search/

https://developers.google.com/image-search/v1/

Sign in using Google Account. Fill the details and you can get the api.




回答2:


Now I found a workaround SerpAPI.

This web service enables to search through Google Images and returns a clean json. it integrates with most of the programming languages: python, php, java, golang, nodejs...

https://serpapi.com/images-results

Google limit the number of search per day. but this service provides unlimited searches...



来源:https://stackoverflow.com/questions/10119842/google-image-search-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!