Custom Key Instructions
Custom Key Instructions
Disclaimer: Google requires you to create a billing account in order to get the free $200 USD
credit per month. It is essentially impossible to exceed this limit on your own so it is unlikely you
will ever get billed.
There will be steps shown at the end of this tutorial that will help prevent ever going over the
free tier, but ultimately if you decide to use your own API key, the responsibility of managing
your billing is on you. GeoHub is not responsible for any costs you incur using your own key.
Step 4: Click “Enable” to enable the Maps JavaScript API in your new project
Step 5: You may now be asked to verify your account information and enter a payment method
Step 6: Click on the navigation menu in the top left, hover over APIs & Services until you see
the popup and then click “Credentials”.
Once on the Credentials page, click on the button “Create Credentials” and choose “API key”
Step 7: Once the key is created, click on it to go to the edit page. Here you can add a restriction
on the key so that only GeoHub can use your key. This way, if someone else gets a hold of the
API key, they will not be able to use it. Note though, that if you share the key with someone, they
can use it as their own custom key on GeoHub and it will use your credits. So only share the
key with others you trust and monitor your usage even more if multiple people are using your
key.
To restrict the key you want to first select “Websites” as your application restriction. Then you
want to add: *geohub.gg as a website restriction. Then under API restrictions, select “Restrict
key” and restrict the key to only be able to use the “Maps JavaScript API”. Lastly, click “Save”.
Step 8: Finally, you have to create your billing account. Click on the navigation menu and click
“Billing”. You should be automatically asked to set up your billing account.
After this step is complete, your key should be ready to use! If you did not already copy it, go
back to the Credentials page and copy your key. Then paste it into your account settings on
GeoHub and save your changes. Now you just have to refresh the page and all future games
will use your own API key.
- Search for “Quotas” and click the one that says “Google Maps Platform”.
- Then in the dropdown select “Maps JavaScript API”.
- Then you want to go to the section that says “Map loads” and click the down arrow.
- This will show you a chart of how many API calls you are making with your key each day.
- At the time of writing, you get 28,500 calls per day for free. That would mean to be on
the safe side you don’t want to ever exceed 900 calls per day.
- Since you likely won’t even get near that on any given day, it would be wise to set the
“Map loads per day” quota to around 600.
- You can change it at your own discretion but 600 map loads is still 200+ games each
day!
- This is more of a backup in case you somehow exceed the free tier. You can set an alert
that will email you before costs get too crazy. But if you follow Tip 1 by setting an
appropriate daily quota, you should be okay. This is just another layer of safety.
- Search for “Budgets & alerts” or find it under Billing on the navigation menu.
- Create a new budget (You likely want to set it to $1 since budgets seem to only work
after the free tier is used up).
- Ensure that “Email alerts to billing admins and users” is checked.
- You can view your current bill at any point by going to the “Billing” section on the sidebar.
- The free tier is $200 USD each month, so you want to make sure you are below that.
- It is also important to keep in mind that Billing and Quota figures are sometimes not up to
date, and can be slightly inaccurate. So if you don’t want to risk going over the free tier,
make sure to give yourself a good margin.