I won't be using the official API (if there's any) because all of Google's APIs of this nature require payments, instead I will be using a URL which I believe is found in many small scale apps and websites everywhere.
I will be referencing Google of course with a "Google Suggestions" title and all of them when clicked will redirect to a Google page within the browser.
Here's the request URL reverse engineered from the Chrome web browser:
http://google.com/complete/search?output=toolbar&client=chrome&q=SEARCHTERM
It returns the suggestions in JSON format.
Will I be violating their terms of use/service or guidelines?
I didn't discover the URL myself, it was an answer to another question here and I guess in small scale projects it might go unnoticed but what about the legal side of things?
Excuse me, I don't know which tags to use.
Reverse engineering software is not. If the law changes and reverse engineering is made illegal, then a serious blow will be dealt to the common user of software (especially the common and curious user). A law completely outlawing reverse engineering would be like a law making it illegal to open the hood of your car to repair it.
A law completely outlawing reverse engineering would be like a law making it illegal to open the hood of your car to repair it. Under such a system, car users would be required by law to go to the dealership for all repairs and maintenance.
Software engineers use the process of obfuscation to achieve similar results. But the law does not prevent a determined researcher from finding ways around such design strategies. Still, there are wrong ways to go about reverse engineering, which can provide potential remedies for innovators who feel their work has been unlawfully copied.
According to the article Trade Secret, Contract and Reverse Engineering (also note end note 5), the copyright act broadly protects actions (including reverse engineering) for the following purposes:
I found your question intriguing, therefore I did some research and stumbled upon a Google Webmaster Central Blog post that states that Google was well aware of users using the Autocomplete API (aka Suggestions API):
"For years, a number of developers have integrated the results of autocomplete within their own services using a non-official, non-published API that also had no restrictions on it"
Then they go on and say:
"However, there are some times when using an unsupported, unpublished API also carries the risk that the API will stop being be available. This is one of those situations. We built autocomplete as a complement to Search, and never intended that it would exist disconnected from the purpose of anticipating user search queries."
They conclude that:
"In the interest of maintaining the integrity of autocomplete as part of Search, we will be restricting unauthorized access to the unpublished autocomplete API as of August 10th, 2015."
So, regarding your question, "Will I be violating their terms of use/service or guidelines?"
It don't think so. They are aware of that developers may attempt to access the autocomplete API, it's likely that at some point your application will be restricted or banned.
Read more about this here
Although I am no lawyer, here is an approach you can take ...
URLs are open game for discovery. The best invention comes from doing something new and different, I believe google agrees. If you have come across a URL that does what you want as a API query that you can take advantage of, do so, assuming you know what to do with that JSON output. APIs are fundamentally open unless the provider restricts it with appropriate authentication controls. You can embed a basic google search in many things without issue today via a simple Javascript query, or template HTML form submission. This would be no different in my point of view.
If you are doing this commercially, that is where you need caution. Google's search is generally open in the context that you may see a terms and conditions on the page when you visit https://www.google.com, however the agreement is fundamentally one way, and has limited enforcement to a general end consumer. Its more an admission that they are subjecting you to things they legally must disclose as you consume the open service.
https://policies.google.com/terms?fg=1
That being said, if you commercially use the open / discovered API and then increase awkward demand they may come after you for commercial damage - because to stop it, they likely will need to not only process thier API for the query string but other patterns in the HTTP post meta data. They do indicate that any interferrence with thier services directly (which this could be if commercial and significant) is something they take seriously.
As it is seen, there isn't actually any official statement that there will be violation of terms by using this API.
But for example, Google Suggest/Autocomplete API is explained in "Data Source Handbook: A Guide to Public Data by Pete Warden" as below:
Also, there is a blog entry that introduces the restriction on their unofficial Autocomplete API. CORS policy is an example of that restriction. But, of course it still works on browser when a separate new tab/window is opened while AJAX call is restricted. [1]
See this: https://webmasters.googleblog.com/2015/07/update-on-autocomplete-api.html
It is clear that Google wants developers to implement autocomplete as using Google Custom Search Engine on their websites but there is no any official global search suggestions API that Google allows.
[1]
$.ajax({
'url' : 'https://suggestqueries.google.com/complete/search?output=toolbar&q=test',
'type' : 'GET',
'dataType' : 'XML',
'success' : function(data) {
document.body.innerHTML = 'Data: '+data;
},
'error' : function(xhr, status, error){
document.body.innerHTML = "Request: "+ JSON.stringify(xhr);
}
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
But since you will be using this link on the browser window, you will not face the problem above.
Also, there may be ban of IP or a restriction on the application (when commercially used or not) or Google may think the request origin as suspicious as detecting unusual activity (ex. asking for CAPTCHA on further requests to Google) if too many requests sent to the unofficial autocomplete API.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With