Skip to main content

Authorization

Follow this guide to create a new Google PageSpeed Insights API credential that will allow Nexla to authenticate to and retrieve web performance data from the Google PageSpeed Insights API.
google_page_speed_insights_api_auth.png

Google PageSpeed Insights API

Prerequisites

Before creating a Google PageSpeed Insights API credential in Nexla, you will need a Google Cloud project with the PageSpeed Insights API enabled and an API key configured for that project.

The Google PageSpeed Insights API uses API key authentication. While the API can be queried without a key for occasional, low-volume use, an API key is required for reliable, automated use in Nexla because it unlocks higher rate limits (up to 25,000 requests per day and 240 requests per minute) and allows Google to associate usage with your project for monitoring and quota management.

Create a Google Cloud Project and Enable the API

  1. Sign in to the Google Cloud Console with your Google account.

  2. Click the project selector dropdown at the top of the page. In the dialog that appears, click New Project.

  3. Enter a Project Name (for example, "Nexla PageSpeed Integration") and click Create.

  4. Once the project is created, navigate to APIs & Services > Library in the left navigation menu.

  5. In the API Library search box, type PageSpeed Insights API and press Enter.

  6. Click on the PageSpeed Insights API result, then click the Enable button to enable the API for your project.

Generate an API Key

  1. In the left navigation menu, navigate to APIs & Services > Credentials.

  2. Click the + Create Credentials button at the top of the page, and select API key from the dropdown menu.

  3. Google Cloud will generate a new API key and display it in a dialog box. Copy the API key value immediately and store it in a secure location, as this is the value you will enter in Nexla.

    To prevent unauthorized use of your API key, Google recommends restricting its usage. In the API key dialog, click Restrict Key (or click the edit icon next to the key later) to limit the key to specific APIs (select PageSpeed Insights API) and, optionally, restrict it to specific IP addresses or referrer URLs. Restrictions can be configured at any time from the APIs & Services > Credentials page in Google Cloud Console.

  4. Click Close to dismiss the dialog. Your new API key will now appear in the API keys list on the Credentials page.

For complete details on managing API keys in Google Cloud, refer to the Google Cloud API key documentation and the PageSpeed Insights API getting started guide.

Create a Google PageSpeed Insights API Credential

  • To create a new Google PageSpeed Insights API credential, after selecting the data source type, click the Add Credential tile to open the Add New Credential overlay.

Credential Name & Description

  1. Enter a name for the credential in the Credential Name field and a short, meaningful description in the Credential Description field.

    Resource descriptions are recommended but are not required. They should be used to provide information about the resource purpose, data freshness, etc. that can help the owner and other users efficiently understand and utilize the resource.

API Key Authentication

The Google PageSpeed Insights API uses a single API key for authentication. The key is appended to all API requests as a query parameter, identifying your Google Cloud project and applying the associated quota and rate limits.

  1. Enter the API key you generated in the Google Cloud Console in the API Key field. This key authenticates Nexla with the Google PageSpeed Insights API and should be kept secure — treat it like a password and avoid sharing it in public repositories or logs.

Save the Credential

  1. Once all of the relevant steps in the above sections have been completed, click the Save button at the bottom of the overlay to save the configured credential.

  2. The newly added credential will now appear in a tile on the Authenticate screen during data source creation and can be selected for use with a new data source.