views:

366

answers:

1

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?

+1  A: 

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.

Philippe Leybaert
But in case of desktop applications the key is tied to the URL of the download site of the application. So Google can't validate it.
Christian
The terms of use and FAQ sections on the Google Maps api aren't very clear about that.
Philippe Leybaert
"You may use the API (except for the Static Maps API) in websites or in software applications. For websites, please sign up with the URL where your implementation can be found. For other software applications, please sign up with the URL of the page where your application can be downloaded."What's not clear about that?
Christian
I mean that it's not clear if you can distribute the key or not. Wasn't that your question? :)
Philippe Leybaert
Ah yes, sorry I misunderstood you.
Christian