估计搜索结果数 Google 搜索 API

发布于 2024-07-24 08:04:32 字数 322 浏览 5 评论 0原文

当您搜索谷歌时,它会估计搜索结果的数量,例如

hello world 的结果 1 - 10 约为 103,000,000

我如何以编程方式获取数字 103,000,000?

我对结果不感兴趣,只对那个数字感兴趣,而且我需要一次执行大约 100 个这样的搜索,因此网页抓取不是一个选项,因为谷歌倾向于阻止此类事情。

我已经看到了一些解决方案,您可以使用谷歌肥皂 API 来执行此操作,但这不再是一个选项,因为它已被弃用,并且它们不再提供 API 密钥,并且 AJAX API 似乎不提供此字段:/

When you search google, it estimates the number of search results e.g.

Results 1 - 10 of about 103,000,000 for hello world

How do I get the number 103,000,000 programmically?

I'm not interested in the results, just that number, and I need to do about 100 of these searches at a time so webpage scrapping is not an option since google tends to block this kind of thing.

I've seen solutions where you can use the google soap API to do this but that's no longer an option since it's deprecated and they're no longer giving away API keys, and the AJAX API doesn't seem to offer this field :/

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

还不是爱你 2024-07-31 08:04:32

返回搜索对象时,它将具有“results”属性(作为包含结果对象的数组)和“Cursor”属性,其中包含具有estimatedResultsCount属性的游标对象。 这就是你要找的人。

When the search object is returned, it will have a property of 'results' as an array that contains the results objects, and a 'Cursor' property that contains the cursor object that has an estimatedResultsCount property. That's the fella your after.

时光倒影 2024-07-31 08:04:32

我使用 C# 和 Bing 而不是 Google 完成了此任务。 您可以在此处找到答案:

Google Search API - 结果数量

I completed this using C# with Bing instead of Google. You can find the answer here:

Google Search API - Number of Results

孤城病女 2024-07-31 08:04:32

也许不是一个选择,也许不允许,甚至可能不起作用,但是只进行这 100 次搜索并使用不同的 Google 服务器并不断更改您的身份(浏览器、cookie 等)并在搜索之间留出足够的时间怎么样? 例如,如果我们在 google.com、google.net、google.co.uk 或 google.jp 上进行 nslookup,我们会得到几个不同的服务器(google.jp 为 74.125.95.104、74.125.91.104、72.14.203.104) 。 对其他服务器执行同样的操作,您将轻松获得 30-40 台甚至更多服务器。 如果您每轮只在服务器上进行 1 或 2 次搜索,这可能是最好的。 祝你好运!

更新

刚刚查看了“Flash 和其他非 Javascript” AjaxSearch 的环境”,似乎有一个您可能感兴趣的名为“estimatedResultCount”的字段(包括 php、flash 的代码示例)。 一个简短的说明:对不起,伙计们,我试图对我的答案保持不可知论,而不是通过不给出可能的选项来审查自己。

Maybe not an option, maybe not allowed and maybe not even working, but what about just doing these 100 searches and just use different Google servers and constantly change your identification (browser, cookies etc) and leave enough time between your searches? For example, if we take a nslookup on google.com, google.net, google.co.uk or google.jp we get a couple of different servers (74.125.95.104, 74.125.91.104, 72.14.203.104 for google.jp). Do the same for the others and you will easily come up with 30-40 of these servers or even more. It would probably be best, if you only do 1 or 2 searches on a server for each of your rounds. Good luck!

Update

Just looked at the "Flash and other Non-Javascript Environments" for the AjaxSearch and there seems to be a field called "estimatedResultCount" that you are maybe interested in (incl. code example for php, flash). One quick note: Sorry guys, I try to be agnostic towards my answers and not censor myself by not giving out possible options.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文