简体   繁体   English

如何免费使用 Google Directions API 密钥?

[英]How to use Google Directions API key free?

I'm asking this question since my Final Year Project requires calculating distance between two markers.我问这个问题是因为我的最后一年项目需要计算两个标记之间的距离。 But upon using the Google Directions API key which I've registered and created it, the server returns me this result (Screenshot link below, click to see).但是在使用我注册并创建的 Google Directions API 密钥后,服务器会返回这个结果(下面的屏幕截图链接,点击查看)。 It does not create the polyline and does not return the distance between two markers.它不会创建折线,也不会返回两个标记之间的距离。

ScreenShot of the result结果截图

If there's no choice but to create a billing account, how much would it costs for a student like me?如果别无选择,只能创建一个计费帐户,像我这样的学生要花多少钱? Is there a student package where they'll provide free access to this API service?是否有学生 package 可以免费访问此 API 服务? Please help, thanks.请帮忙,谢谢。

This might not be the answer you want to hear but this is the best answer we can provide you.这可能不是您想听到的答案,但这是我们可以为您提供的最佳答案。

Google Maps Platform offers a free $200 monthly credit for Maps, Routes, and Places once you enable billing in your project.一旦您在项目中启用计费功能,Google Maps Platform 就会为地图、路线和地点提供每月 200 美元的免费信用额度。 With the $200 monthly credit, the vast majority of customers find their use cases are completely free.凭借每月 200 美元的信用额度,绝大多数客户发现他们的用例是完全免费的。 You won't be charged until your usage exceeds $200 in a month.在您每月的使用量超过 200 美元之前,我们不会向您收费。

You can avoid surprises on your bill by doing the following:您可以通过执行以下操作来避免账单上的意外:

  • Set a budget alert , to track how your spend is growing toward a particular amount.设置预算提醒,以跟踪您的支出如何朝着特定金额增长。 Setting a budget does not cap API usage, it only alerts you when your spend amount gets near the specified amount.设置预算不会限制 API 的使用量,它只会在您的支出金额接近指定金额时提醒您。
  • Cap your daily API usage , to manage your cost of use of billable APIs.限制您的每日 API 使用量,以管理可计费 API 的使用成本。 By setting caps on requests per day, you can limit your spend.通过设置每天请求的上限,您可以限制支出。 Use a simple equation to determine your daily cap depending on how much you want to spend.使用一个简单的等式来确定您的每日上限,具体取决于您想要花费的金额。 For example: (Monthly spend / price per each )/30 = requests per day cap (for one API).例如:(每月支出/每个价格)/30 = 每天请求上限(对于一个 API)。 Note that your implementation may use multiple billable APIs, so adjust your equation as needed.请注意,您的实现可能会使用多个计费 API,因此请根据需要调整您的等式。 Remember, a $200 USD Google Maps Platform credit is available each month, so be sure to factor that into your calculation.请记住,每月可获得 200 美元的 Google Maps Platform 信用额度,因此请务必将其计入您的计算中。

Here's the pricing for the Directions API.这是方向 API 的价格

Hope you find it helpful and good luck on your project.希望您发现它对您的项目有帮助并祝您好运。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM