PHP 无需爬行 Google 即可获取网站的 Google 排名

发布于 2024-10-24 04:37:16 字数 1539 浏览 1 评论 0原文

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

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

发布评论

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

评论(4

梦在深巷 2024-10-31 04:37:16

首先你应该明白一些事情:
没有“a”排名。您在谷歌搜索关键字时看到的 SERP 与其他人在谷歌搜索关键字时看到的 SERP 不同。它们是一堆“个性化”因素(位置、启用 cookie、即时搜索、白天时间、之前的搜索、网络历史记录、数据中心……),这些因素会考虑到某些内容的排名。对于一些流行的关键词来说,前 3 个关键词有点静态,5 到 10 个在变化,十个之后就变得非常模糊,二十个之后就像扔骰子一样。

这就是抓取 google serps 的方法。

使用网络搜索 api(已弃用但有效)或自定义搜索 api(== crap == d*ckmove by google)会变得更糟。

所以无论你做什么,你总会得到谷歌结果的近乎毫无意义的快照。

不,没有其他官方 API。

这是坏消息,现在是好消息......如果您担心自己的域名,只需转到“谷歌网站管理员工具”并点击“搜索查询”。这是您可以获得的最佳信息(它仍然很模糊,但这是您找到的信息,您的平均排名)。或者您可以应用一些专门的谷歌分析过滤器来检查谷歌推荐流量的排名位置。

如果你想分析你的竞争对手,那么有很多搜索营销公司专门销售这种服务(其中大多数都是针对每个市场的,例如在德国它是 sistrix,在德国有很多这样的公司)我们)。

但正如我之前所说:数据是毫无意义的快照,大多数时候是不可操作的。

first you should understand something:
there is not "a" ranking. the SERP you see when googling your keywords is not the same SERP other people see when googleing your keywords. they are a sh*tload of "personalization" factors (location, cookie enabled, instant search, day time, previous searches, web history, datacenter, ....) that come into account of where something ranks. for some popular keywords the top 3 are kinda static, 5 to 10 in a flux, after ten it gets really really fuzzy, after 20 its like throwing a dice.

and that is just the crawl the google serps approach.

it gets worse with the web search api (deprecated but working) or the custom search api (== crap == d*ckmove by google).

so whatever you do, you will always just get a near meaningless snapshot of the google results.

and no, there is no other offical API.

that was the bad news, now the good news ... if you worry about your own domain, just go to "google webmaster tools" and click on "search queries". that's the best information you can get (it's still fuzzy, but it's what you get found for, where you rank on average). or you can apply some specialized google anlaytics filter to check the rank postion of google referred traffic.

if you want to analyse your competition, well there are a lot of search marketing companies which sell exactly that kind of service (most of them are specialized per market, i.e. in germany it's sistrix, there are a sh*tload of such companies in the us).

but as i said before: the data is a meaningless snapshot and most of the time just not actionable.

那些过往 2024-10-31 04:37:16

几个月前他们提供了一个免费的 API。但现在已弃用。

您可以尝试他们的新自定义搜索 API。

限制:仅限 100 个免费查询/
日。

they were offering a free api , few months ago. but now its Deprecated.

you can try their new Custom Search API.

limitations : only 100 free queries /
day.

彡翼 2024-10-31 04:37:16

这可以通过使用不同的代理在请求之间随机睡眠时间以及读取和发送 cookie 以获取本地化结果和正确的用户代理集来抓取 google SERP 来完成,我遵循这种方法,我使用 300 个代理的代理农场,我可以整天抓取任何网站而不会被阻止,您可以遵循很多提示来防止被阻止,例如避免顺序访问网页:/page/1、/page/2 等。并且不要请求新网页正好每 N 秒一次。这两个错误都会引起对您的网络请求的注意,因为真实用户的浏览更加随机。因此,我们需要确保以无序的方式抓取网页,并为请求之间的延迟添加随机偏移量。

This can be done with crawling google SERP by using different proxies with random sleep time between requests and reading and sending cookies for localized results and proper set of user agents ,, i follow this approach, i use a proxy farm of 300 proxies and i can crawl any website all day long without getting blocked,, there is a lot of tips you can follow to prevent getting blocked like avoid accessing webpages sequentially: /page/1, /page/2, etc. And don't request a new webpage exactly every N seconds. Both of these mistakes can attract attention to your web requests because a real user browses more randomly. So we need to make sure to crawl webpages in an un-ordered manner and add a random offset to the delay between requests.

忱杏 2024-10-31 04:37:16

我不喜欢所选的答案。

首先,它太笼统了,有一个 SERP 排名,它主要取决于语言和国家/地区。
其他因素很少是真正的因素,而且非常次要(例如,在 Google 中,您可以收藏您的网站,它们将排名在顶部)。

我个人做了很多测试,当我从国外抓取关键词并询问那里的人时,我得到了完全相同的关键词。

现在是中心问题
Google 自定义搜索 API 不是排名跟踪的选项,它仅对少量数据研究有用。
对于 Bing 来说也是如此,而且对于较大的金额来说,两者都非常昂贵。

如果您想获得排名数据,您只能抓取(爬行)搜索引擎,这绝对是可能的(我这样做),或者您使用抓取服务来为您完成此操作并将原始数据传递到您的软件(也使用该服务)我自己也有一个)。

正如您所说,您不想自行抓取,请查看 scraping.services
这是一项主要为开发人员设计的抓取服务,如果我没记错的话,您可以为大量关键字制作一个功能齐全的排名跟踪引擎。
如果您不想自己动手,他们还有一些用于生成图表和报告的 API 模块(与 sistrix 不同,但功能相同)。

就我个人而言,我还没有使用过他们的关键字跟踪器,我直接使用了 Google 和 Bing 他们的抓取 API,到目前为止它的工作没有任何问题。

如果您对自己抓取搜索引擎感兴趣,我可以帮助您,这并不困难(对于大容量也是可能的)。

I don't like the selected answer.

First of all it is too generalizing, there IS a SERP rank and it mostly depends on language and country.
The other factors are rarely a real factor and very minor (for example in Google you can favorite your websites, they will be ranked on top).

I've personally made a lot of testing and when I scrape keywords from foreign countries and ask people from there I get the exactly same ones.

Now the central problem
The Google custom search API is not an option for rank tracking, it's useful for a small amount of data research only.
Same counts for Bing and both are really expensive for larger amounts.

If you want to get that ranking data you only can either scrape (crawl) the search engines, that's definitely possible (I do it) or you use a scraping service which does it for you and delivers raw data to your software (also using that one myself).

As you said you don't want to crawl yourself, take a look at scraping.services.
That's a scraping service mostly designed for developers if I am not mistaken, you can make a full featured rank tracking engine that way for high volumes of keywords.
They also have some API module for generating charts and reports (different from sistrix but same same sort of sauce) if you don't want to do it yourself.

Personally I have not used their keyword tracker yet, I used Google and Bing their scraping API directly and it works without issues so far.

If you get interested in scraping search engines on your own I can help you out, it's not difficult (also possible for large volumes).

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