Google 映射包含 2 个以上元素的距离矩阵 returns OVER_QUERY_LIMIT

Google Maps Distance Matrix with more than 2 elements returns OVER_QUERY_LIMIT

我真的很怀疑我的理智,希望有人能提供帮助。

查询具有 2 个元素的 google 地图距离矩阵工作正常(1 个起点,2 个目的地):

$ curl "https://maps.googleapis.com/maps/api/distancematrix/json?origins=Seattle&destinations=Victoria+BC|San+Francisco&key=$GOOGLE_MAPS_API_KEY"

如果有 3 个或更多元素,我总是会收到 OVER_QUERY_LIMIT 错误:

$ curl "https://maps.googleapis.com/maps/api/distancematrix/json?origins=Seattle&destinations=Victoria+BC|San+Francisco|New+York&key=$GOOGLE_MAPS_API_KEY"
{
   "destination_addresses" : [],
   "error_message" : "You have exceeded your rate-limit for this API.",
   "origin_addresses" : [],
   "rows" : [],
   "status" : "OVER_QUERY_LIMIT"
}

基于 standard usage limits(粘贴在下面),我不应该在仅包含 3 个元素(1 个起点和 3 个目的地)的单个请求中看到此错误。

Each query sent to the Google Maps Distance Matrix API is limited by the number of allowed elements, where the number of origins times the number of destinations defines the number of elements.

  • 2,500 free elements per day, calculated as the sum of client-side and server-side queries.
  • Maximum of 25 origins or 25 destinations per request.
  • 100 elements per request.
  • 100 elements per second, calculated as the sum of client-side and server-side queries.

无论 2 个查询的顺序如何,该模式都成立。 2 元素查询总是成功,3 元素查询总是失败。有什么想法吗?

编辑:刚刚尝试了 3 个起点和 1 个终点,结果相同,所以它看起来肯定与请求中的元素数量有关。

如果它对其他人有帮助,它看起来像是 API 如何强制执行自定义配额限制的错误。如果您将限制重置为默认值(通过开发人员 console/api 仪表板),您应该会得到预期的行为:

  • 每天元素:2,500
  • 每 100 秒元素数:10,000
  • 每个用户的元素:无限制