[Excerpt] programming interface comparison between Baidu and Google

Source: Internet
Author: User
Baidu and Google, as well-known search engines, have a wealth of search Resource Information. Many people want to write valuable data that calls the search engine by programming, the program I wrote yesterday called Baidu's search interface. Why did I use Baidu? There is actually a reason in the middle.

I initially planned to call the Google interface. Google itself also provided the Google soap search API for programmers to call, and one thousand search calls can be made every day. Because the API is provided through web service, therefore, the best call is through java. However, when I debug it somehow, it is okay to search for English. When I search for Chinese, an array overflow error is always reported.

Because my calling program needs to access the ACCESS database, I still intend to use VB to write and directly access the Google search page Through VB, as a result, I quickly wrote a program that directly calls Google query Through VB. I was surprised to find that the program failed, because I wrote similar calling programs in last June, and a small number of direct calls to Google search were successful at that time. The call failed, indicating that this function has been completely disabled. The error page is as follows:

The information mentioned here refers to "Google Terms of service applicable to individuals". One of them is: "No automatic query is allowed: without the prior explicit permission of Google, do not send any form of automatic query to the Google system. Please note that 'automatic query' includes using the software to send a query to Google to determine the Google ranking of the website when different content is searched ."

This item prohibits users from writing programs to directly call Google, but must be called through interfaces such as the Google soap search API. The number of queries per day is limited to less than 1000.

However, when I call the baidu search engine using the same principle, I find that the call is completely normal. Baidu can return the correct search results, although sometimes the search results contain spot price ads. I tried to increase the call frequency and search more than five thousand programs in a short time. I found that the program still works normally and Baidu still returns the query result.

The open application of the search engine can be called directly, which is indeed convenient for many programmers. In this way, even if Baidu does not provide APIs similar to Google, we can program to access its search resources.

Of course, I also guess that Baidu does not necessarily do this for the benefit of the public, because Baidu has previously promoted some search plug-ins, and will also bind Baidu plug-ins similar to the Ziguang Pinyin input method, therefore, it will be stored in a large number of access to Baidu through the client program rather than the browser, and Baidu is difficult to identify this aspect, so it opens the application to directly call the search. Google has not promoted similar client plug-ins. Therefore, to save server resources, simply disable direct calls from the client.

This kind of client call is also under some pressure on Baidu. If you abuse these resources, Baidu may also learn to close the direct call of the client like Google, so resources cannot be abused, for example, the program I provided yesterday limits that up to 500 queries can be performed at a time to avoid excessive load on the search server.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.