# Get a Google API key

- Source: https://plugstack.dev/docs/google-pagespeed-insights/google-api-key/
- Published by: PlugStack
- Last updated: 2026-10-14

The plugin talks to Google through the PageSpeed Insights API, and Google asks for an API key for that. The key is free. All you need is a Google account, like a Gmail address.

 

Google changes the look of its Cloud Console from time to time, so your screens may not match ours exactly. The steps stay the same: create a project, turn on the PageSpeed Insights API, create a key and paste it into the plugin.

 

## 1. Create a project

 
1. 1
   Go to [console.cloud.google.com](https://console.cloud.google.com/) and sign in.
2. 2
   Click the project picker at the top of the page, then **New project**.
3. 3
   Give it any name, for example *PageSpeed*, leave the location as it is and click **Create**. It takes a few seconds.
4. 4
   Make sure the new project is selected in the project picker before you go on.

 
![New Project form in Google Cloud with the project name PageSpeed](https://plugstack.dev/wp-content/uploads/2026/10/insights-pagespeed-gcloud-new-project.webp)
 
  
**Info**Already have a Google Cloud project you want to use? Select it and skip to the next step.
 
 

## 2. Turn on the PageSpeed Insights API

 
1. 1
   Open the menu and go to **APIs & Services**, then click **Enable APIs and services** at the top.
2. 2
   Search for *PageSpeed Insights API* and open it.
3. 3
   Click **Enable**.

 
![APIs and Services dashboard with the Enable APIs and services button](https://plugstack.dev/wp-content/uploads/2026/10/insights-pagespeed-gcloud-enable-apis.webp)
 
![API Library search showing PageSpeed Insights API](https://plugstack.dev/wp-content/uploads/2026/10/insights-pagespeed-gcloud-library-search.webp)
 
![PageSpeed Insights API page with the Enable button](https://plugstack.dev/wp-content/uploads/2026/10/insights-pagespeed-gcloud-enable-api.webp)
 
  
**Info**Shortcut: the **Get an API key** link in the plugin settings opens this page directly. Pick your project and click Enable.
 
 

## 3. Create the API key

 
1. 1
   Go to **APIs & Services → Credentials**.
2. 2
   Click **Create credentials → API key**.

 
![Create credentials menu with API key highlighted](https://plugstack.dev/wp-content/uploads/2026/10/insights-pagespeed-gcloud-create-credentials.webp)
 

A window opens where you set up the key before Google creates it:

 
1. 1
   Give the key a name you will recognise later, for example *PageSpeed for my site*.
2. 2
   Under **Select API restrictions**, tick *PageSpeed Insights API* and click **OK**. This way the key can only be used for PageSpeed checks, which is safer if it ever leaks.
3. 3
   Under **Application restrictions**, keep **None**. If you know your server’s IP address, you can choose **IP addresses** and enter it instead.
4. 4
   Click **Create**, then copy the key Google shows you. You can always come back to the Credentials page to copy it again.

 
![Create API key window with the PageSpeed Insights API restriction and application restrictions set to None](https://plugstack.dev/wp-content/uploads/2026/10/insights-pagespeed-gcloud-create-api-key.webp)
 
  
**Warning**Do not choose *Websites* under application restrictions. The plugin calls Google from your server, not from a browser, so a website restriction blocks every scan. This is the most common reason a key does not work.
 
 

## 4. Add the key to the plugin

 
1. 1
   In WordPress go to **Tools → Pagespeed Insights → Settings**.
2. 2
   Paste the key into **API key** and click **Check key**.
3. 3
   When you see *The API key works*, click **Save settings**.

 
![API key field with the Check key button in the plugin settings](https://plugstack.dev/wp-content/uploads/2026/10/insights-pagespeed-settings-api-key.webp)

*Check key tests the key with Google before you save it.*

 

If the check fails, the message tells you why: the key is wrong, the API is not turned on yet, or a restriction blocks your server. After enabling the API, give Google a minute before you check again.

 

## How many checks can I run?

 

Google gives each project 25,000 requests per day for free. One page is one request, or two if you check both desktop and mobile. That is enough for about 12,000 pages a day, far more than most sites need. If you ever hit the limit, the plugin stops the scan and tells you. The quota resets at midnight Pacific Time.
