New Google Maps Platform - How do I set my own usage limits?
Asked Answered
H

3

15

In their notifications about the new billing system for the Google Maps APIs, Google very clearly state that you "can set usage limits to protect against unexpected increases". However, I haven't found any documentation regarding how to set these usage limits against an API key. Does anyone know how to do this?

To clarify, I would like to set my own daily usage limits against my API key to prevent it ever going over the free threshold for the static maps API.

Hurdle answered 11/5, 2018 at 9:37 Comment(1)
This article may help: theredmarker.com/blog/how-to-set-quota-limit-for-your-api-keysCamel
O
16

I understand Google means that you can set your custom daily quota for each individual API in order to stay within free 200$, not a global per API key/project/Billing account daily quota. As far as I know there is no such thing as limit per daily usage in $ per Billing account yet.

There are alerts that you can establish in your Billing account and receive notifications if your usage is close to the defined budget. Have a look at the following document that explain how to set alerts:

https://cloud.google.com/billing/docs/how-to/budgets?hl=en

If your project uses only Static Maps API, it is easy to set daily quota to stay within 200$ per month. The price sheet says that you can have up to 100 000 free requests per month. That means 100 000 / 31 = 3225 free requests per day. You can go to Quota section of Static Maps API in your project

https://console.developers.google.com/google/maps-apis/apis/static-maps-backend.googleapis.com/quotas?project=YOUR_PROJECT_ID&duration=PT1H

and change your daily quota as shown in my screenshots

enter image description here

edit number requests per day

enter image description here

and you are set.

I hope this helps!

Octavie answered 13/5, 2018 at 11:36 Comment(2)
I don't think your pricing is quite correct. For up to 100,000 requests per month requests are $7/1000 which gives a monthly limit of 28,000 requests or 900 per day to stay under $200 a monthWetzel
@AlanBirtles Please note that I used Static Maps API in my example, not Maps JavaScript API. Price for static maps is 2$ per 1K calls.Octavie
D
2

OK a bit late for reply, but maybe somebody else can use this.
You do get tons of free map hits etc. If you don't link a pay account, then you are limited to 1 hit per day (that's google maps) which is useless. All other quotas like 10000 per 100 sec etc are secondary to the 1 hit per day.

Now once you have linked your pay account or a Credit Card etc, to google development console then you get full quota for free user, plus more if you go over your quota covered by your Credit Card.

However don't panic, for first year it's all free and you get $300 (at this moment) worth of free stuff.

Even if you go over this limit Google will first ask you if you wish to change to payment system or continue with free. If you decide to pay then you will be charged per indicated on google dev site. If you decide to go with free option then the service to your site will stop until next rotation, i.e. day or month etc depending on service.

see this table.

Unless you have millions of hit on your map page or app, then the free quota is more than enough for normal sites.

Here is a price calculator by google.

As you see you get a lot of unlimited stuff and some paid if you go over your recurring credit of $200 or $300

Google makes it so complicated because it involves people coming from old system and those registering between roll over etc.

perhaps this will help too.

You can also set budgets and alerts just in case you go over budget (via Billing section of dev site)

So in short :) you get tons of free and if you have a lot of visitors the surely you make some money to pay for the services.

Note that google charges for all their API services in 1 place so if you use say Geocoding and firebase and cloud dev etc then you will soon start paying.

Sorry for any typos, I did this fast.

Dowable answered 3/9, 2018 at 12:38 Comment(3)
You may get tons of free counts, but I still just got hit with a £141 'after credit' bill that I wasn't expecting... Have put measures in place to reduce the number of counts but monitoring daily shows that i'm already up to £35 so far in September 'after credit'.Procedure
oh google.., is there any alternative for this? I am a student and i don't have any credit cardGremlin
@GustiArya mapbox is an alternativeEllersick
D
-2

Capping API Usage

Depending on the API, you can explicitly cap requests in a variety of ways, including: requests per day, requests per 100 seconds, and requests per 100 seconds per user. You might want to limit the billable usage by setting caps. For example, to prevent getting billed for usage beyond the free courtesy usage limits, you can set requests per day caps.

For more info, check this doc: https://cloud.google.com/apis/docs/capping-api-usage

Dumbfound answered 8/10, 2019 at 23:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.