How to Use Google API to Make a Geoguessr Game!

by morannc in Circuits > Computers

284 Views, 4 Favorites, 0 Comments

How to Use Google API to Make a Geoguessr Game!

My-Geoguessr-Game.jpg

I made a simple game inspired by Geoguessr for me and my brother to play together on the same device, pass-and-play style. Players look at a location, make a guess, and see who is closer.

This project is also a good way to learn how to use Google API, useful for many coding projects that use maps.

Supplies

You don't really need many things, but you should have a Google account and a device on which coding can be done.

Making the Game's Code

To start you need to make the the code for the game. I made it in html, but you can make in any language you want! If you do not know how to code but still want to make the game, you can use Chatgpt to help you.

Google API

How to Get a Google Maps API Key in 2 Mins

Now go to Google Cloud Console and sign in. Create a project, and generate an API key. This key connects your code to Google’s map tools. I found a video by Steve Builds Websites to make the step clearer and easier to follow.

Enter Your API Key

Copy your API key into your code where your map setup is located. Be careful to keep your key private and do not share it publicly.

Test and Refinement

Untitled.png

Now that the API is connected, you can test your game! Thank you for reading my Instructable! And I hope it helps!