Appearance
Google Map
Enable Google Map Api Key
Step 1 — Open Google Cloud Console
- Open your browser and go to https://console.cloud.google.com.
- Sign in with your Google account.
- Accept terms if prompted and set up billing (only for new users).
- Once logged in, you’ll see the Google Cloud Console dashboard where you can manage projects and services.
Step 2 — Create (or Select) a Project
- In the Google Cloud Console dashboard, click the project dropdown at the top of the page.
- To use an existing project, simply select it from the list.
- To create a new project, click New Project, enter a Project Name, choose a Billing Account (if required), and click Create.
- Wait a few seconds — your project will be ready, and you’ll be switched to it automatically.
Step 3 — Enable Required APIs
- In the Google Cloud Console, open the Navigation menu (☰) and select APIs & Services → Library.
- Search for the API you need (e.g., Maps JavaScript API, Geocoding API, etc.).
- Click on the API result, then click Enable.
- Repeat the process for each required API.
After enabling, complete these 2 steps:
- Click Agree and Continue.
- If you agree, fill out the form and click Start Free. If you do not agree, remove the red-marked URL and refresh the page.
Step 4 — Create Credentials (API Key)
- In the Google Cloud Console, go to APIs & Services → Credentials.
- Click + Create Credentials and select API key.
- A new API key will be generated and shown in a popup.
- Copy the key and keep it secure — you’ll use it to access Google APIs.
- (Optional) Click Restrict Key to limit usage by IP, HTTP referrer, or API for better security.
Step 5 — Restrict Your API Key (Important)
Edit the key → Application restrictions and API restrictions.
- In the Credentials page, find your API key and click Edit.
- Under Key restrictions, choose a restriction type:
- HTTP referrers (websites): Allow only your domains.
- IP addresses: Allow only trusted server IPs.
- Android/iOS apps: Restrict by app package or bundle ID.
- Under API restrictions, select Restrict key, then choose only the APIs you enabled (e.g., Maps, Geocoding).
- Click Save to apply restrictions.
Step 6 — Use the Key in Your App
- Copy your restricted API key from the Google Cloud Console.
- Add it to your application’s configuration, code, or environment file depending on the platform:
- Web app: Include it in the script tag when loading Google Maps or APIs.
- Server app: Store it in environment variables (.env) for security.
- Mobile app: Add it in the app configuration (Android/iOS).
- Deploy or run your app, and the API key will authenticate your requests.