How to Get Google Maps JavaScript API Key


The Google Maps JavaScript API provides the easiest way to embed a map in the web page. To get started using Google Maps JavaScript API, an API key is needed. Google Maps JavaScript API is free to create and you can get API key from Google API Console. This step-by-step tutorial will help you to generate an API key on Google Developer Console and get API key for Google Maps JavaScript API.

  • Log in to your Google account and go to the Google API Console.
  • Click Project » Create project at the top left corner to creating a project.
    google-maps-javascript-api-key-console-create-project-codexworld
  • Enter the Project name and click on Create. It will take some seconds for creating a new project, please wait.
    google-maps-javascript-api-key-console-project-details-codexworld
  • Click the Library link on the left navigation menu. Under the Google Maps APIs section and click Google Maps JavaScript API link.
    google-maps-javascript-api-key-console-library-codexworld
  • Click ENABLE to use Google Maps JavaScript API.
    google-maps-javascript-api-key-enable-codexworld
  • Click on Credentials on the left navigation menu. On the Credentials page, click Create credentials » API key.
    google-maps-javascript-api-key-credentials-codexworld
  • A dialog box will appear with your newly created API Key. Use this API key with Google Maps JavaScript API.
    get-google-maps-javascript-api-key-codexworld

API Key need to be specified in key parameter.

<script src="https://maps.googleapis.com/maps/api/js?key=Your_API_KEY"></script>

Leave a reply

Connect With CodexWorld