Here's a step-by-step guide to create and configure a Google Maps Platform API Key from the Google Cloud Console so you can access Place Details (including reviews):
✅ STEP 1: Sign in to Google Cloud Console
- Go to: https://console.cloud.google.com/
- Log in with your Google account.
✅ STEP 2: Create a New Project
- In the top-left dropdown, click "Select a project" > "New Project".
- Enter a name (e.g.,
MyGoogleReviewsProject
) and click "Create". - Wait for it to finish, then click the notification to go to your new project.
✅ STEP 3: Enable the "Places API"
- In the left sidebar, go to “APIs & Services” > “Library”.
- Search for “Places API”.
- Click it and then click “Enable”.
You may also enable Maps JavaScript API and Geocoding API if your app needs them.
✅ STEP 4: Create an API Key
- Go to “APIs & Services” > “Credentials”.
- Click “+ Create Credentials” > “API key”.
- A key will be generated — copy this key.
✅ STEP 5: Restrict the API Key (Important for Security)
- On the same credentials page, click your newly created API key to edit it.
- Under "Application restrictions", choose:
- "IP addresses" for backend usage — enter your server IP(s).
- OR "None" for testing (not recommended for production).
- Under "API restrictions", choose:
- "Restrict key"
- Check ✅ “Places API”
- Click "Save"
✅ STEP 6: Use the API Key in Your .env
File
GOOGLE_API_KEY=your_real_api_key_here
PLACE_ID=your_place_id_here
Get your PLACE_ID
using:
✅ STEP 7: Make the API Call in Your Backend
const response = await fetch(
`https://maps.googleapis.com/maps/api/place/details/json?place_id=${PLACE_ID}&fields=reviews,rating&key=${GOOGLE_API_KEY}`
);
⚠️ Notes:
- Reviews will only appear if the business has public reviews on Google.
- Google may limit the number of reviews returned (typically 5).
- You may need to add billing to your Google Cloud account, even for free tier usage.