44

I'd like to add an API_KEY for GoogleMaps for testing and in documentation I've read this :

Tip: During development and testing, you can register a project for testing purposes in the Google Cloud Platform Console and use a generic, unrestricted API key. When you are ready to move your app into production, register a separate project for production, create an Android-restricted API key, and add the key to your application.

My question is, do I have to put my Credit card even if it's a testing API_KEY? I do not get the purpose to put my Creadit card to use Google Maps, isn't it free?

Skizo-ozᴉʞS ツ
  • 19,464
  • 18
  • 81
  • 148
  • See: https://developers.google.com/maps/billing/understanding-cost-of-use?hl=en_US#maps-product Note that the change was recent so other documentation may not have been updated. – Morrison Chang Sep 09 '18 at 21:21
  • @Divyanshu can you PLS add Custom Search API to your api key project ^^ – A. El-zahaby Jan 22 '20 at 23:30

4 Answers4

43

There seems no way to have google maps api key free without credit card. To test the functionality of google map you can use it while leaving the api key field "EMPTY". It will show a message saying "For Development Purpose Only". And that way you can test google map functionality without putting billing information for google map api key.

<script src="https://maps.googleapis.com/maps/api/js?key=&callback=initMap" async defer></script>
Mashiur
  • 568
  • 4
  • 7
  • 14
    Unfortunately, it's not working. I am geting this error. You must use an API key to authenticate each request to Google Maps Platform APIs. For additional information, please refer to http://g.co/dev/maps-no-account – Mustkeem K Jul 25 '20 at 14:28
  • 4
    This answer is no longer valid unfortunately. You must send a key – James Dec 13 '21 at 07:47
33

Updated Answer

As of June11, 2018 it is now mandatory to have a billing account to get API key. You can still make keyless calls to the Maps JavaScript API and Street View Static API which will return low-resolution maps that can be used for development. Enabling billing still gives you $200 free credit monthly for your projects.

This answer is no longer valid

As long as you're using a testing API key it is free to register and use. But when you move your app to commercial level you have to pay for it. When you enable billing, google gives you $200 credit free each month that means if your app's map usage is low you can still use it for free even after the billing enabled, if it exceeds the credit limit now you have to pay for it.

Hussam
  • 1,606
  • 9
  • 20
  • 1
    But how do I get the free API_KEY? When I'm trying to get it I need to put my credit card number – Skizo-ozᴉʞS ツ Sep 09 '18 at 21:18
  • 3
    Try this [link](https://console.developers.google.com/). Go to developers console create a new project. – Hussam Sep 09 '18 at 21:22
  • Yes, but how do I get the APIKEY? I enabled it – Skizo-ozᴉʞS ツ Sep 09 '18 at 21:25
  • 2
    Select Maps SDK for android, Enable API, choose your project. Once it is enabled. Go to navigation menu, api and services and select credentials. There you will find your key. – Hussam Sep 09 '18 at 21:29
  • Do I have to add restrictions aswell? I just selected API RESTRICTIONS and selected Maps, is it ok? – Skizo-ozᴉʞS ツ Sep 09 '18 at 21:32
  • You can just leave them for now. And start using the API in your app. If this solved your problem mark the answer accepted. – Hussam Sep 09 '18 at 21:34
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/179716/discussion-between-skizo-oziks-and-ali-hussam). – Skizo-ozᴉʞS ツ Sep 09 '18 at 21:34
  • It now shows an error, where you are asked to Enable Billing for Places API. – Denys Fiialko Nov 23 '21 at 23:53
  • @DenysFiialko So you are getting an error when you are enabling billing for your account? – Hussam Nov 25 '21 at 09:05
  • It seems to me that there is no longer a testing API key. At least I can't generate one, I can just generate normal keys. Also, if oyu use google mpas without key, it seems to work for development purposes – Adam Aug 08 '22 at 05:45
  • @Adam as mentioned, test keys are no longer valid, keyless calls are the way to go for development – Hussam Aug 10 '22 at 19:37
7

You can test it: It will show a message saying "For Development Purpose Only". And that way you can test Google Maps functionality without putting billing information for the Google Maps API key.

<script src="https://maps.googleapis.com/maps/api/js?sensor=false&callback=myMap"></script>
Atif Saleem
  • 126
  • 1
  • 4
-1

Firstly Google cloud billing account loaded a $300 load(for trial purposes) to your account after that they start to charge any if you will allow them else they will not charge you automatically. If you are interested to know the whole process of how you can get Google Maps API Key please read this article this is written in very detail. How To Create Google Maps API KEY For Free?

Sohail Qureshi
  • 689
  • 11
  • 24