Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Include Google Maps API Key in open source project?

Is it okay to put your Google Maps API Key into your source code and publish it?

Others could take it and misuse it, but I don't want every developer / user to get their own API key and type it in somewhere. If the owner of the key is responsible, should I create a new google account for the project? (The project is a desktop application in Objective-C and a small developer tool.)

What would be the best way to make this convenient?

like image 926
Christian Avatar asked Jul 11 '09 09:07

Christian


People also ask

Can you expose Google Maps API key?

When you use API keys in your Google Cloud Platform (GCP) applications, take care to keep them secure. Publicly exposing your credentials can result in your account being compromised, which could lead to unexpected charges on your account.

Does Google Maps need API key to embed?

You must include an API key with every Maps Embed API request.


1 Answers

I don't think it's legal, but even it were, it's technically impossible, because the Google Maps API Key is tied to your domain name. Google will check the referrer of the HTTP request to validate the key.

The key isn't secret anyway: simply viewing the source of a website using Google Maps reveals the API key.

like image 143
Philippe Leybaert Avatar answered Sep 28 '22 10:09

Philippe Leybaert