Skip to main content

Connect to Google Search Console

Google Search Console is a Google service that reports how a website performs in Google Search. Retool connects to Google Search Console through the Search Console API using either OAuth 2.0 or a Google service account.

After you create a Google Search Console resource in Retool, you can:

  • Pull search analytics such as clicks, impressions, click-through rate, and average position.
  • List the sites your account can access in Search Console.
  • List, submit, and delete sitemaps.
  • Display search performance data in tables, charts, and dashboards.

Before you begin​

To connect Google Search Console to Retool, you need the following:

  • Beta feature enabled: The Google Search Console integration is an opt-in beta. In Retool, go to Settings → Beta and turn on Google Search Console integration.
  • Google account: A Google account or Google Workspace user with access to the Search Console properties you want to query.
  • Custom OAuth 2.0 client: A Google OAuth 2.0 client configured for your Retool instance. Self-hosted instances cannot use Retool's hosted OAuth app and must provide their own client ID and secret. Service account authentication does not require an OAuth client.
  • Network access: Your Retool instance must be able to reach accounts.google.com, oauth2.googleapis.com, www.googleapis.com, and searchconsole.googleapis.com over HTTPS.
  • Retool permissions: Ability to create and manage resources in your organization.

Create a Google Search Console resource​

Follow these steps to create a Google Search Console resource in your Retool organization.

Create a new resource​

In your Retool organization, navigate to Resources in the main navigation and click Create new → Resource. Search for Google Search Console and click the Google Search Console tile to begin configuration.

Best practice

Use folders to organize your resources by team, environment, or data source type. This helps keep your resource list manageable as your organization grows.

Configure general settings​

Specify a name and description for the resource that indicates which Google account or Search Console properties it connects to. The description provides more context to users and the app builder about how to use the resource.

Example nameExample description
Google Search ConsoleDefault Google Search Console resource for the marketing team. Reads search performance data for company websites.
Google Search Console (read only)Read-only Google Search Console resource for displaying search traffic on internal dashboards.
Note

When configuring a resource with OAuth, you typically only need one resource. Each user authenticates individually and can only access the Search Console properties they have access to. Creating multiple resources is usually unnecessary unless you need to support multiple OAuth applications or mix OAuth with service account authentication.

Configure authentication​

Configure the connection settings for your Google Search Console resource under the Credentials section of the resource configuration form.

Google Search Console resource configuration form.

Authentication​

Google Search Console supports two authentication methods. Choose based on whether queries should run as the signed-in user or as a non-interactive service identity.

Authentication methodUse cases
OAuth 2.0Interactive apps where each user authenticates with their own Google account. Each user only sees the properties they have access to in Search Console.
Google Service AccountAutomated workflows, scheduled queries, and shared internal apps that need to act as a non-interactive service identity. The service account must be added as a user on each Search Console property it queries.
Option A: OAuth 2.0 with a custom app (recommended)

Self-hosted instances must provide their own Google OAuth 2.0 client. Retool's hosted OAuth app is only available for Cloud organizations.

  1. In Retool, select OAuth 2.0 as the Authentication method and copy the OAuth callback URL.
  2. Create an OAuth 2.0 client in the Google Cloud Console and add the OAuth callback URL as an authorized redirect URI.
  3. Enable the Search Console API for your Google Cloud project.
  4. In Retool, enter the Client ID and Client secret from your OAuth 2.0 client.
  5. Choose the Type described in the next section.
  6. Optionally enable Share credentials between users to allow all users of the resource to share a single set of credentials.
  7. Click Connect with OAuth and authorize Retool to access Google Search Console.
  8. Click Create resource to save.
Option B: Google service account

Use a service account when queries should run as a non-interactive service identity rather than as the signed-in user. Service accounts do not require a custom OAuth client.

  1. Create a service account in the Google Cloud Console and generate a JSON key.
  2. Enable the Search Console API for your Google Cloud project.
  3. In Search Console, add the service account's email address as a user on each property it needs to query. Only a property owner can add users.
  4. In Retool, select Google Service Account as the Authentication method.
  5. Choose the Type described in the next section.
  6. Paste the JSON contents of your service account key into the Service account key field.
  7. Click Create resource to save.

Type​

The Type setting controls the OAuth scope used for Search Console API calls. Choose the most restrictive option that still supports your apps.

TypeScopeAPI access
Read onlyhttps://www.googleapis.com/auth/webmasters.readonlyRead search analytics, site lists, and sitemaps. Use for apps that only display Search Console data.
Read and writehttps://www.googleapis.com/auth/webmastersRead and write access, including adding or removing sites and submitting or deleting sitemaps.

To change the Type after a resource has been created, update the authentication settings and re-authorize the resource. For OAuth 2.0, users are prompted to re-consent on their next query.

Configure advanced options​

Configure optional settings available under the Advanced options section of the resource configuration form.

Outbound region​

By default, requests originate from your organization's outbound region (for example, us-west-2). Enable Override default outbound Retool region to route requests through a different region. This is useful when Search Console API access is restricted by IP. Outbound regions do not change where Retool stores your apps or data. For details, refer to Configure Retool outbound regions.

Save the resource​

Click Create resource to save your Google Search Console resource. You can now use it in queries across your Retool apps and automations.

To verify your configuration, save the resource and run a query, such as listing your sites with /webmasters/v3/sites GET.

Interact with Google Search Console data​

Once you've created a Google Search Console resource, you can interact with Google Search Console data using Retool.

Switch to the new app builder

Retool recommends using the new app builder so you can use natural language to build React-based apps using AI.

  • To use Google Search Console data in the app builder, reference the resource in the prompt with @, such as @Google Search Console. Refer to the data and functions documentation to learn more.
  • For classic apps, workflows, and agents, refer to the resource queries documentation to learn how to write a resource query. For the full list of available operations, refer to the Search Console API reference.

Best practices​

  • Choose the narrowest scope that meets your needs: Use Read only for apps that only display search data. Use Read and write only when your app manages sites or sitemaps.
  • Share property access deliberately: A service account can query every Search Console property it's added to as a user. Add it only to the properties your apps need, and use the lowest permission level that works.
  • Be careful with shared credentials: When you enable Share credentials between users, every user of the resource queries Search Console as the account that authorized it, regardless of their own access.
  • Use environments for separate credentials: If you manage production and staging sites separately, configure different credentials for each using Retool environments.