he Google PageSpeed API lets SpeedTest Pro analyze your pages without hitting rate limits. Good news: it’s completely free for most users.
Why You Need This
Without an API key, Google limits how many tests you can run. You might see an error like “Your website has been restricted by Google” after a few tests.
With an API key, you get:
- More tests per day
- Faster results
- No random restrictions
Think of it like a VIP pass for your website performance tests.
Before You Start
You’ll need:
- A Google account (Gmail works fine)
- About 5-10 minutes
- Access to your SpeedTest Pro settings
Getting Your API Key
Step 1: Go to Google Cloud Console
- Open the Google Cloud Console. Head to console.cloud.google.com.
- Sign in with your Google account. Use any Gmail or Google Workspace account.
- Accept the terms of service. First-time users will see this popup.
Step 2: Create a Project
Google organizes everything into projects. You need one for your API key.
- Click the project dropdown. It’s at the top of the page, usually says “Select a project.”
- Click New Project. It’s in the top right of the popup.
- Name your project. Something like “My Website Speed Tests” works fine.
- Click Create. Wait a few seconds for it to finish.
- Select your new project. Click the project dropdown again and choose the one you just created.
Step 3: Enable the PageSpeed Insights API
Now you need to turn on the specific API.
- Open the Navigation Menu. Click the three horizontal lines in the top left.
- Go to APIs & Services > Library. This shows all available APIs.
- Search for PageSpeed Insights. Type it in the search box.
- Click on PageSpeed Insights API. It should be the first result.
- Click Enable. Blue button at the top of the page.
This might take a few seconds. You’ll see a confirmation when it’s done.
Step 4: Create Your API Key
Almost there. Time to generate the actual key.
- Go to APIs & Services > Credentials. Use the navigation menu or click the link in the API dashboard.
- Click Create Credentials. Blue button at the top.
- Select API Key. It’s the first option in the dropdown.
- Copy your API key. A popup shows your new key. Copy it now.
Important: Keep this key private. Anyone with it can use your quota.
Step 5: Add the Key to SpeedTest Pro
Final step. Let’s connect everything.
- Open your WordPress admin panel.
- Go to Speedtest Pro > Settings.
- Find the PageSpeed Insights API Key field.
- Paste your API key.
- Click Save Changes.
That’s it. Your page speed tests now use your personal API quota.
Testing Your Setup
Want to make sure it works?
- Go to Speedtest Pro > Page Speed Testing.
- Enter your homepage URL.
- Click Run Test.
If the test runs without errors, you’re all set.
API Key Best Practices
Keep It Secure
- Never share your API key publicly
- Don’t commit it to public code repositories
- Regenerate it if you think it’s been exposed
Monitor Your Usage
The free tier gives you plenty of tests for normal use. But if you’re testing hundreds of pages daily, you might want to check your usage:
- Go to the Google Cloud Console
- Navigate to APIs & Services > PageSpeed Insights API
- Check the quotas and usage graphs
What If You Hit Limits?
The free tier is generous, but here’s what happens if you max out:
- Tests will fail with a quota error
- Wait 24 hours for the quota to reset
- Or upgrade to a paid tier (rarely needed)
For most websites running a few tests per day, you’ll never hit these limits.
Troubleshooting
Invalid API Key Error
Double-check you:
- Copied the entire key (they’re long)
- Enabled the PageSpeed Insights API
- Selected the correct project
Try regenerating the key if none of that helps.
API Not Enabled Error
Go back to the Google Cloud Console:
- Open APIs & Services > Library
- Search for PageSpeed Insights
- Make sure it says “Enabled” (not a blue Enable button)
Still Getting Rate Limited
Your key might not be configured correctly. Try:
- Delete the key from SpeedTest Pro settings
- Run a test (should fail)
- Add the key back
- Try again