抓取工具/漫游器会消耗Maps API积分吗?

时间:2018-09-03 08:47:43

标签: google-maps google-maps-api-3

由于Google Maps API更改为“信用”,所以我的问题是: 搜寻器/漫游器(来自搜索引擎或诸如“上升趋势”之类的监视程序)是否会消耗Maps API积分?

如果是这样,是否有可能像Google Analytics(分析)中那样“排除”它们?

我想避免“无”的大量费用。

预先感谢 托比

4 个答案:

答案 0 :(得分:2)

我的经验是,是的,对Maps API的请求确实会创建一个交易,即使漫游器或抓取工具访问该页面也是可收费的。当免费配额方法取消后,Google更改为$ 200的积分系统时,我也不得不仔细研究一下。我的网站每天要发出大约3,000个地图请求。但是,Google Analytics(分析)显示,我每天需要地图请求的网页浏览量仅为700!为了避免为此付出高昂的代价,我能够切换到使用无限制且免费的嵌入地图。

对我的服务器访问日志的分析表明,确实,大多数页面视图都来自搜寻器和机器人。这与我看到的包含52% of website visits are from crawlers and bots的报告是一致的。在我的网站上,爬虫/漫游器百分比接近75%。那是因为我有大约50,000页。人流量集中在热门网页的一小部分上,而爬虫/漫游器则全部访问它们。

您的第二个问题询问是否有一种方法可以排除漫游器,例如Google Analytics(分析)中提供的选项。不,它不是Maps API中的选项。您可以在代码中检测到机器人的存在,并像在PHP Stop Bot solution中那样禁止api请求。这是过滤掉它们的基本开始。可以使用像这样的漫游器/爬虫检测器来增强此功能:https://github.com/JayBizzle/Crawler-Detect

我要指出,有好机器人和坏机器人。您当然希望您的网页内容被Google和Bing索引并显示地图。不要盲目排斥所有漫游器/爬虫程序。

在需要收费的Map and Places API请求的项目中,我对此非常重视。我可能会使用https://51degrees.com/提供的服务来进行机器人检测。他们有针对设备检测的免费和付费解决方案。在此过程中,它们的API可以识别人类!

祝你好运。

答案 1 :(得分:0)

为了回答您的问题,我建议您看一下Google Maps JavaScript API的robots.txt文件

http://maps.googleapis.com/robots.txt

当前它具有以下规则

User-agent: *
Disallow: /maps/api/js/AuthenticationService.Authenticate
Disallow: /maps/api/js/DirectionsService.Route
Disallow: /maps/api/js/DistanceMatrixService.GetDistanceMatrix
Disallow: /maps/api/js/ElevationService.GetElevationForLine
Disallow: /maps/api/js/GeocodeService.Search
Disallow: /maps/api/js/QuotaService.RecordEvent

根据此文件,爬网程序禁用了配额服务,因此它们不应消耗您的配额。

答案 2 :(得分:0)

Google Maps JavaScript API的robots.txt文件已更改。参见:

http://maps.googleapis.com/robots.txt

现在是:

User-agent: AdsBot-Google
Allow: /maps/api/js?
Disallow: /maps/api/js/
Disallow: /maps/api/place/js/
Disallow: /maps/api/staticmap?
Disallow: /maps/api/streetview?
Disallow: /maps/api/streetview/

User-agent: *
Allow: /maps/api/js?
Disallow: /maps/api/js/
Disallow: /maps/api/place/js/
Disallow: /maps/api/staticmap?
Disallow: /maps/api/streetview?
Disallow: /maps/api/streetview/

所以我想调用maps / api / js吗?被允许将有助于api配额。

答案 3 :(得分:0)

从Google Maps团队收到的回复中获取答案(2020年10月)

  1. 使用Googlebot和Google Adsbot确实可以生成对Maps API的合法请求,但是,对于这些漫游器,Google Maps不收费。

  2. 但是,Google Maps不能阻止Bing Bots之类的其他漫游器进行合法调用并增加使用率。

解决方案是检测包含“ Googlebot”,“ AdsBot-Google”,“ SemrushBot”或“ Bingbot”,“ etc”的HTTP User-Agent,并阻止它们调用Maps API请求。

例如: 例如:

User-agent: Bingbot
Disallow: /maps/api/js/AuthenticationService.Authenticate
Disallow: /maps/api/js/DirectionsService.Route
Disallow: /maps/api/js/DistanceMatrixService.GetDistanceMatrix
Disallow: /maps/api/js/ElevationService.GetElevationForLine
Disallow: /maps/api/js/GeocodeService.Search
Disallow: /maps/api/js/QuotaService.RecordEvent
Disallow: /maps/api/js/AutocompletionService.*
Disallow: /maps/api/js/PlaceService.*
Disallow: /maps/api/place/js/AutocompletionService.*
Disallow: /maps/api/place/js/PlaceService.*
Disallow: /maps/api/js/ViewportInfoService.*
Disallow: /maps/api/js/GeoPhotoService.*
相关问题