3

Is there a way to programatically upload an image file to search in Google, and then downloading the first one (the one with best resolution)?

EDIT: The Google Search API would not work for me, as I would have much more than 100 requests per day, and I am not willing to pay, since I am not a company

Sartheris Stormhammer
  • 2,534
  • 8
  • 37
  • 81
  • I would try th upload with a GoogleAPI, and then get the first one with some HTML thing (eg.: HTMLAgilityPack). The one with the best resolution is harder: I'd get all the resolutions (HTMLAgilityPack, and get int parseable strings like this: 0x0). Then get the best resolution, and the download link for that one. Just the idea, not the code, because i don't know the solution. good luck :) – RAPTOR May 10 '15 at 08:45
  • 1
    But, please remember that on SO you must provide a code snippet, what have you tried... – RAPTOR May 10 '15 at 08:46
  • @RAPTOR I know of that rule, but first, there isnt such relevant question, second, there is no code that could be tried if thats not possible – Sartheris Stormhammer May 10 '15 at 09:15
  • 1
    I understand you of course, just tried to explain the reason of the -1s :) I hope Márton's answer will be OK for you – RAPTOR May 10 '15 at 09:20
  • 1
    I’m pretty sure that circumventing the request quota from the API by going a different route (using the normal search interface) is against Google’s terms and conditions. – poke May 22 '15 at 06:56
  • thats why I said the Google Search API does not work for my needs – Sartheris Stormhammer May 22 '15 at 07:42
  • 2
    @poke is right. The API is the only officially supported and legal way. If you want to use the services someone provides and they ask you to pay for it, you should pay for it. – molnarm May 23 '15 at 08:04
  • what do you mean legal? if I can program a software myself that can do that, I will – Sartheris Stormhammer May 23 '15 at 17:10
  • @SartherisStormhammer: Possible doesn't make it legal/correct. People have been prosecuted under the http://en.wikipedia.org/wiki/Computer_Fraud_and_Abuse_Act – ceejayoz May 28 '15 at 16:43
  • 5
    Your assumption that only companies need to pay for services is wrong. Honest people also need to do it. – ereOn May 28 '15 at 16:48

1 Answers1

26

Yes, there is. The Google Custom Search API allows you to submit queries (including images) and retrieve results programmatically. There are even client libraries available for multiple languages.

EDIT: After OP changed his question, basically saying that he doesn't want to use the Google API, I can only refer to this(a bit outdated) question and quote the Google Terms of Service:

1.4 Appropriate Conduct. You shall not, and shall not allow any third party to: ... (i) directly or indirectly generate queries, or impressions of or clicks on Results, through any automated, deceptive, fraudulent or other invalid means (including, but not limited to, click spam, robots, macro programs, and Internet agents);

So to recap, it is possible, but it is only legal via the API I linked above.

Community
  • 1
  • 1
molnarm
  • 9,856
  • 2
  • 42
  • 60
  • what exactly do I need from there? as usual, I am in a link loophole from the terrible google documentations... – Sartheris Stormhammer May 10 '15 at 12:28
  • also, will I have a limit of 100 queries per day with that? Because I will likely need much more – Sartheris Stormhammer May 10 '15 at 12:36
  • @SartherisStormhammer I never used this one so you'll have to figure it out. They usually have excellent documentation for their APIs, with introduction and code samples at the second link in my answer. If the documentation states that you have a limit, then probably you have to pay more for a higher quota. – molnarm May 10 '15 at 14:27
  • Violating Terms of Service is not illegal. Illegal means that you go to prison if you do that, a violation of Terms of Service is just an action that potentially exposed you to a civil action against you from Google – TheQult Oct 21 '16 at 07:24